Browse Source

Testfall Import dbtest mit Excel, neue Spalte qa_dbtest_assertion.def_col_function #4

qa_0.6_Release
Daniel Quathamer 2 years ago
parent
commit
d632fae55c
  1. 10
      scripts/groovy/groovyJobsStrip.x
  2. 5
      src-modules/module/qa/conf/qa.xml
  3. 11
      src-modules/module/qa/datentabellen/qa_dbtest_ausfuehren.sql
  4. BIN
      src-modules/module/qa/etl/testfall_import/qa_importdatei_dbtest.xlsx
  5. 75
      src-modules/module/qa/etl/testfall_import/testfall_import.kjb
  6. 508
      src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.kjb
  7. 1511
      src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.ktr
  8. 126
      src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.sql
  9. 1130
      src-modules/module/qa/etl/testfall_import/testfall_import_dbtest_def.ktr

10
scripts/groovy/groovyJobsStrip.x

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/bash
#bitte im Verzeichnis des Scripts ausführen
mkdir -p tmp_testfall_import
groovy ~/git/superx/scripts/groovy/copy_kettlejob.groovy --strip-connections ../../src-modules/module/qa/etl/testfall_import/testfall_import.kjb tmp_testfall_import
groovy ~/git/superx/scripts/groovy/copy_kettlejob.groovy --strip-connections ../../src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.kjb tmp_testfall_import
groovy ~/git/superx/scripts/groovy/copy_kettlejob.groovy --strip-connections ../../src-modules/module/qa/etl/testfall_import/testfall_import_xml.kjb tmp_testfall_import
#Wenn man die Entwicklung beendet hat, kann man diese Dateien ins richtige git Verzeichnis kopieren und committen:
#cp -a tmp_testfall_import/* ../../src-modules/module/qa/etl/testfall_import

5
src-modules/module/qa/conf/qa.xml

@ -585,7 +585,8 @@ notnull="false"> @@ -585,7 +585,8 @@ notnull="false">
<column name="rownr" type ="INTEGER" size ="10" default ="" notnull ="false" description="Zeilennr."/>
<column name="def_col_caption" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Spalte Beschriftung"/>
<column name="def_col_name" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Spalte Name"/>
<column name="def_col_value" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Zellwert"/>
<column name="def_col_value" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Zellwert"><comment>Standardmäßig vom Typ STRING, wenn nicht füllen Sie "Funktion"</comment></column>
<column name="def_col_function" type ="VARCHAR" size ="255" default ="" notnull ="false" description="Funktion (optional)"><comment>z.B. "decval", um Zahlen mit Nachkommastellen zu erhalten, oder "val", um INTEGER zu erhalten.</comment></column>
</columns>
<indexes></indexes>
<primaryKeys><rs>
@ -1089,7 +1090,7 @@ mode="full"> @@ -1089,7 +1090,7 @@ mode="full">
<customfield name="def_col_name" nullFieldValue="" visibleSize="10" />
<customfield name="def_col_caption" nullFieldValue="" visibleSize="20" />
<customfield name="def_col_value" nullFieldValue="" visibleSize="5" />
<customfield name="def_col_function" nullFieldValue="" visibleSize="10" />
</customfield>
<customfield name="active" visibleSize="10" nullFieldValue="" />

11
src-modules/module/qa/datentabellen/qa_dbtest_ausfuehren.sql

@ -28,7 +28,8 @@ A.tid, @@ -28,7 +28,8 @@ A.tid,
A.rownr ,
A.def_col_caption,
A.def_col_name,
A.def_col_value
A.def_col_value,
A.def_col_function
FROM qa_dbtest_assertion A
where A.dbtest_id in (select T.tid
from qa_dbtest T where T.active=1)
@ -88,7 +89,13 @@ select @@ -88,7 +89,13 @@ select
${dbtest_assertion.tid},
A.beginn,
now(),
case when T.${dbtest_assertion.def_col_name}='${dbtest_assertion.def_col_value}' then 0
case when T.${dbtest_assertion.def_col_name}=
<#if dbtest_assertion.def_col_function !="">
${dbtest_assertion.def_col_function}('${dbtest_assertion.def_col_value}')
<#else>
'${dbtest_assertion.def_col_value}'
</#if>
then 0
else 1 end as result_code,
T.${dbtest_assertion.def_col_name} as result_value
from tmp_anfang A left outer join tmp_rs T

BIN
src-modules/module/qa/etl/testfall_import/qa_importdatei_dbtest.xlsx

Binary file not shown.

75
src-modules/module/qa/etl/testfall_import/testfall_import.kjb

@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><job>
<?xml version="1.0" encoding="UTF-8"?>
<job>
<name>testfall_import</name>
<description/>
<extended_description/>
<job_version/>
<job_status>0</job_status>
<directory>/</directory>
<directory>&#x2f;</directory>
<created_user>-</created_user>
<created_date>2020/02/23 21:14:53.737</created_date>
<created_date>2020&#x2f;02&#x2f;23 21&#x3a;14&#x3a;53.737</created_date>
<modified_user>-</modified_user>
<modified_date>2020/02/23 21:14:53.737</modified_date>
<modified_date>2020&#x2f;02&#x2f;23 21&#x3a;14&#x3a;53.737</modified_date>
<parameters>
<parameter>
<name>PATH_TO_UPLOADFILE</name>
<default_value>file:///home/superx/git/Memtext-Interna/Projekte/duisburg-essen_uni/impl/db_module/qa/ects_testfaelle/qa_importdatei.xlsx</default_value>
<default_value>file&#x3a;&#x2f;&#x2f;&#x2f;home&#x2f;superx&#x2f;git&#x2f;Memtext-Interna&#x2f;Projekte&#x2f;duisburg-essen_uni&#x2f;impl&#x2f;db_module&#x2f;qa&#x2f;ects_testfaelle&#x2f;qa_importdatei.xlsx</default_value>
<description/>
</parameter>
<parameter>
@ -21,7 +22,32 @@ @@ -21,7 +22,32 @@
<description/>
</parameter>
</parameters>
<slaveservers/>
<connection>
<name>eduetl</name>
<server>localhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>eduetl_ude</database>
<port>9998</port>
<username>superx</username>
<password>Encrypted 2be98afc86aa7f292a20aa77fd0c3fa9e</password>
<servername>superx_host_iso</servername>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>9998</attribute></attribute>
<attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>Y</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>
</connection>
<slaveservers>
</slaveservers>
<job-log-table>
<connection/>
<schema/>
@ -321,7 +347,7 @@ @@ -321,7 +347,7 @@
<type>TRANS</type>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>${Internal.Job.Filename.Directory}/testfall_import.ktr</filename>
<filename>&#x24;&#x7b;Internal.Job.Filename.Directory&#x7d;&#x2f;testfall_import.ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>N</params_from_previous>
@ -354,36 +380,7 @@ @@ -354,36 +380,7 @@
<name>create table tmp_testfall_import</name>
<description/>
<type>SQL</type>
<sql>
drop table if exists tmp_testfall_import_felder;
drop table if exists tmp_testfall_import_feldwerte;
drop table if exists tmp_testfall_import_erg;
create table tmp_testfall_import_felder(
testfall_schluessel varchar(255),
feldnr integer,
feldname varchar(255)
);
create table tmp_testfall_import_feldwerte(
systeminfo_id integer,
testfall_schluessel varchar(255),
maskeninfo_id integer,
feldnr integer,
feldwert varchar(255)
);
create table tmp_testfall_import_erg(
testfall_schluessel varchar(255),
systeminfo_id integer,
mask_execution_id INTEGER ,
rownr INTEGER ,
colnr INTEGER ,
result_value_min FLOAT ,
result_value_max FLOAT ,
is_active smallint default 1 not null,
caption varchar(255)
);</sql>
<sql>&#xa;drop table if exists tmp_testfall_import_felder&#x3b;&#xa;drop table if exists tmp_testfall_import_feldwerte&#x3b;&#xa;drop table if exists tmp_testfall_import_erg&#x3b;&#xa;drop table if exists tmp_testfall_import_felder&#x3b;&#xa;&#xa;create table tmp_testfall_import_felder&#x28;&#xa;testfall_schluessel varchar&#x28;255&#x29;,&#xa;feldnr integer,&#xa;feldname varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;create table tmp_testfall_import_felder&#x28;&#xa;testfall_schluessel varchar&#x28;255&#x29;,&#xa;feldnr integer,&#xa;feldname varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;&#xa;&#xa;create table tmp_testfall_import_feldwerte&#x28;&#xa;systeminfo_id integer,&#xa;testfall_schluessel varchar&#x28;255&#x29;,&#xa;maskeninfo_id integer,&#xa;feldnr integer,&#xa;feldwert varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;&#xa;create table tmp_testfall_import_erg&#x28;&#xa;testfall_schluessel varchar&#x28;255&#x29;,&#xa;systeminfo_id integer,&#xa;mask_execution_id INTEGER , &#xa;rownr INTEGER , &#xa;colnr INTEGER , &#xa;result_value_min FLOAT , &#xa;result_value_max FLOAT , &#xa;is_active smallint default 1 not null,&#xa;caption varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
@ -402,7 +399,7 @@ caption varchar(255) @@ -402,7 +399,7 @@ caption varchar(255)
<sql/>
<useVariableSubstitution>T</useVariableSubstitution>
<sqlfromfile>T</sqlfromfile>
<sqlfilename>${Internal.Job.Filename.Directory}/testfall_import.sql</sqlfilename>
<sqlfilename>&#x24;&#x7b;Internal.Job.Filename.Directory&#x7d;&#x2f;testfall_import.sql</sqlfilename>
<sendOneStatement>F</sendOneStatement>
<connection>eduetl</connection>
<parallel>N</parallel>
@ -443,7 +440,7 @@ caption varchar(255) @@ -443,7 +440,7 @@ caption varchar(255)
</hops>
<notepads>
<notepad>
<note>TODO: Parameter userid aus Maskenfeld</note>
<note>TODO&#x3a; Parameter userid aus Maskenfeld</note>
<xloc>472</xloc>
<yloc>234</yloc>
<width>273</width>

508
src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.kjb

@ -0,0 +1,508 @@ @@ -0,0 +1,508 @@
<?xml version="1.0" encoding="UTF-8"?>
<job>
<name>testfall_import</name>
<description/>
<extended_description/>
<job_version/>
<job_status>0</job_status>
<directory>&#x2f;</directory>
<created_user>-</created_user>
<created_date>2020&#x2f;02&#x2f;23 21&#x3a;14&#x3a;53.737</created_date>
<modified_user>-</modified_user>
<modified_date>2020&#x2f;02&#x2f;23 21&#x3a;14&#x3a;53.737</modified_date>
<parameters>
<parameter>
<name>PATH_TO_UPLOADFILE</name>
<default_value>file&#x3a;&#x2f;&#x2f;&#x2f;home&#x2f;superx&#x2f;git&#x2f;Memtext-Interna&#x2f;Projekte&#x2f;duisburg-essen_uni&#x2f;impl&#x2f;db_module&#x2f;qa&#x2f;ects_testfaelle&#x2f;qa_importdatei_dbtest.xlsx</default_value>
<description/>
</parameter>
<parameter>
<name>userid</name>
<default_value>803</default_value>
<description/>
</parameter>
</parameters>
<connection>
<name>eduetl</name>
<server>localhost</server>
<type>POSTGRESQL</type>
<access>Native</access>
<database>eduetl_ude</database>
<port>9998</port>
<username>superx</username>
<password>Encrypted 2be98afc86aa7f292a20aa77fd0c3fa9e</password>
<servername>superx_host_iso</servername>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>9998</attribute></attribute>
<attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>Y</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>
</connection>
<slaveservers>
</slaveservers>
<job-log-table>
<connection/>
<schema/>
<table/>
<size_limit_lines/>
<interval/>
<timeout_days/>
<field>
<id>ID_JOB</id>
<enabled>Y</enabled>
<name>ID_JOB</name>
</field>
<field>
<id>CHANNEL_ID</id>
<enabled>Y</enabled>
<name>CHANNEL_ID</name>
</field>
<field>
<id>JOBNAME</id>
<enabled>Y</enabled>
<name>JOBNAME</name>
</field>
<field>
<id>STATUS</id>
<enabled>Y</enabled>
<name>STATUS</name>
</field>
<field>
<id>LINES_READ</id>
<enabled>Y</enabled>
<name>LINES_READ</name>
</field>
<field>
<id>LINES_WRITTEN</id>
<enabled>Y</enabled>
<name>LINES_WRITTEN</name>
</field>
<field>
<id>LINES_UPDATED</id>
<enabled>Y</enabled>
<name>LINES_UPDATED</name>
</field>
<field>
<id>LINES_INPUT</id>
<enabled>Y</enabled>
<name>LINES_INPUT</name>
</field>
<field>
<id>LINES_OUTPUT</id>
<enabled>Y</enabled>
<name>LINES_OUTPUT</name>
</field>
<field>
<id>LINES_REJECTED</id>
<enabled>Y</enabled>
<name>LINES_REJECTED</name>
</field>
<field>
<id>ERRORS</id>
<enabled>Y</enabled>
<name>ERRORS</name>
</field>
<field>
<id>STARTDATE</id>
<enabled>Y</enabled>
<name>STARTDATE</name>
</field>
<field>
<id>ENDDATE</id>
<enabled>Y</enabled>
<name>ENDDATE</name>
</field>
<field>
<id>LOGDATE</id>
<enabled>Y</enabled>
<name>LOGDATE</name>
</field>
<field>
<id>DEPDATE</id>
<enabled>Y</enabled>
<name>DEPDATE</name>
</field>
<field>
<id>REPLAYDATE</id>
<enabled>Y</enabled>
<name>REPLAYDATE</name>
</field>
<field>
<id>LOG_FIELD</id>
<enabled>Y</enabled>
<name>LOG_FIELD</name>
</field>
<field>
<id>EXECUTING_SERVER</id>
<enabled>N</enabled>
<name>EXECUTING_SERVER</name>
</field>
<field>
<id>EXECUTING_USER</id>
<enabled>N</enabled>
<name>EXECUTING_USER</name>
</field>
<field>
<id>START_JOB_ENTRY</id>
<enabled>N</enabled>
<name>START_JOB_ENTRY</name>
</field>
<field>
<id>CLIENT</id>
<enabled>N</enabled>
<name>CLIENT</name>
</field>
</job-log-table>
<jobentry-log-table>
<connection/>
<schema/>
<table/>
<timeout_days/>
<field>
<id>ID_BATCH</id>
<enabled>Y</enabled>
<name>ID_BATCH</name>
</field>
<field>
<id>CHANNEL_ID</id>
<enabled>Y</enabled>
<name>CHANNEL_ID</name>
</field>
<field>
<id>LOG_DATE</id>
<enabled>Y</enabled>
<name>LOG_DATE</name>
</field>
<field>
<id>JOBNAME</id>
<enabled>Y</enabled>
<name>TRANSNAME</name>
</field>
<field>
<id>JOBENTRYNAME</id>
<enabled>Y</enabled>
<name>STEPNAME</name>
</field>
<field>
<id>LINES_READ</id>
<enabled>Y</enabled>
<name>LINES_READ</name>
</field>
<field>
<id>LINES_WRITTEN</id>
<enabled>Y</enabled>
<name>LINES_WRITTEN</name>
</field>
<field>
<id>LINES_UPDATED</id>
<enabled>Y</enabled>
<name>LINES_UPDATED</name>
</field>
<field>
<id>LINES_INPUT</id>
<enabled>Y</enabled>
<name>LINES_INPUT</name>
</field>
<field>
<id>LINES_OUTPUT</id>
<enabled>Y</enabled>
<name>LINES_OUTPUT</name>
</field>
<field>
<id>LINES_REJECTED</id>
<enabled>Y</enabled>
<name>LINES_REJECTED</name>
</field>
<field>
<id>ERRORS</id>
<enabled>Y</enabled>
<name>ERRORS</name>
</field>
<field>
<id>RESULT</id>
<enabled>Y</enabled>
<name>RESULT</name>
</field>
<field>
<id>NR_RESULT_ROWS</id>
<enabled>Y</enabled>
<name>NR_RESULT_ROWS</name>
</field>
<field>
<id>NR_RESULT_FILES</id>
<enabled>Y</enabled>
<name>NR_RESULT_FILES</name>
</field>
<field>
<id>LOG_FIELD</id>
<enabled>N</enabled>
<name>LOG_FIELD</name>
</field>
<field>
<id>COPY_NR</id>
<enabled>N</enabled>
<name>COPY_NR</name>
</field>
</jobentry-log-table>
<channel-log-table>
<connection/>
<schema/>
<table/>
<timeout_days/>
<field>
<id>ID_BATCH</id>
<enabled>Y</enabled>
<name>ID_BATCH</name>
</field>
<field>
<id>CHANNEL_ID</id>
<enabled>Y</enabled>
<name>CHANNEL_ID</name>
</field>
<field>
<id>LOG_DATE</id>
<enabled>Y</enabled>
<name>LOG_DATE</name>
</field>
<field>
<id>LOGGING_OBJECT_TYPE</id>
<enabled>Y</enabled>
<name>LOGGING_OBJECT_TYPE</name>
</field>
<field>
<id>OBJECT_NAME</id>
<enabled>Y</enabled>
<name>OBJECT_NAME</name>
</field>
<field>
<id>OBJECT_COPY</id>
<enabled>Y</enabled>
<name>OBJECT_COPY</name>
</field>
<field>
<id>REPOSITORY_DIRECTORY</id>
<enabled>Y</enabled>
<name>REPOSITORY_DIRECTORY</name>
</field>
<field>
<id>FILENAME</id>
<enabled>Y</enabled>
<name>FILENAME</name>
</field>
<field>
<id>OBJECT_ID</id>
<enabled>Y</enabled>
<name>OBJECT_ID</name>
</field>
<field>
<id>OBJECT_REVISION</id>
<enabled>Y</enabled>
<name>OBJECT_REVISION</name>
</field>
<field>
<id>PARENT_CHANNEL_ID</id>
<enabled>Y</enabled>
<name>PARENT_CHANNEL_ID</name>
</field>
<field>
<id>ROOT_CHANNEL_ID</id>
<enabled>Y</enabled>
<name>ROOT_CHANNEL_ID</name>
</field>
</channel-log-table>
<pass_batchid>N</pass_batchid>
<shared_objects_file/>
<entries>
<entry>
<name>START</name>
<description/>
<type>SPECIAL</type>
<start>Y</start>
<dummy>N</dummy>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<intervalSeconds>0</intervalSeconds>
<intervalMinutes>60</intervalMinutes>
<hour>12</hour>
<minutes>0</minutes>
<weekDay>1</weekDay>
<DayOfMonth>1</DayOfMonth>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>112</xloc>
<yloc>80</yloc>
</entry>
<entry>
<name>testfall_import_def</name>
<description/>
<type>TRANS</type>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>&#x24;&#x7b;Internal.Job.Filename.Directory&#x7d;&#x2f;testfall_import_dbtest_def.ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>N</params_from_previous>
<exec_per_row>N</exec_per_row>
<clear_rows>N</clear_rows>
<clear_files>N</clear_files>
<set_logfile>N</set_logfile>
<logfile/>
<logext/>
<add_date>N</add_date>
<add_time>N</add_time>
<loglevel>Basic</loglevel>
<cluster>N</cluster>
<slave_server_name/>
<set_append_logfile>N</set_append_logfile>
<wait_until_finished>Y</wait_until_finished>
<follow_abort_remote>N</follow_abort_remote>
<create_parent_folder>N</create_parent_folder>
<logging_remote_work>N</logging_remote_work>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>448</xloc>
<yloc>80</yloc>
</entry>
<entry>
<name>create table tmp_testfall_import</name>
<description/>
<type>SQL</type>
<sql>&#xa;drop table if exists tmp_qa_dbtest&#x3b;&#xa;drop table if exists tmp_qa_dbtest_assertion&#x3b;&#xa;drop TABLE if exists tmp_qa_resultset&#x3b;&#xa;drop table if exists tmp_testfall_import_felder&#x3b;&#xa;drop table if exists tmp_testfall_import_feldwerte&#x3b;&#xa;&#xa;CREATE TABLE tmp_qa_dbtest&#xa;&#x28;&#xa; tid serial NOT NULL,&#xa; uniquename varchar&#x28;255&#x29; NOT NULL,&#xa; name varchar&#x28;255&#x29;,&#xa; systeminfo_id integer,&#xa; resultset_id integer ,&#xa;resultset_uniquename varchar&#x28;255&#x29;,&#xa; whereclause text,&#xa; description text,&#xa; active smallint DEFAULT 1&#xa;&#x29;&#x3b;&#xa;CREATE TABLE tmp_qa_dbtest_assertion&#xa;&#x28;&#xa; tid serial NOT NULL,&#xa; dbtest_id integer,&#xa;dbtest_uniquename varchar&#x28;255&#x29;,&#xa;systeminfo_id integer,&#xa; rownr integer,&#xa; def_col_caption varchar&#x28;255&#x29;,&#xa; def_col_name varchar&#x28;255&#x29;,&#xa; def_col_value varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;CREATE TABLE tmp_qa_resultset&#xa;&#x28;&#xa; tid serial NOT NULL,&#xa; uniquename varchar&#x28;255&#x29; NOT NULL,&#xa; name varchar&#x28;255&#x29;,&#xa; systeminfo_id integer NOT NULL,&#xa; fromclause text,&#xa; fieldclause text,&#xa; groupbyclause varchar&#x28;255&#x29;,&#xa; orderbyclause varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;create table tmp_testfall_import_felder&#x28;&#xa;feldnr integer,&#xa;feldname varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;create table tmp_testfall_import_erg&#x28;&#xa;feldnr integer,&#xa;feldname varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;&#xa;create table tmp_testfall_import_feldwerte&#x28;&#xa;systeminfo_id integer,&#xa;testfall_schluessel varchar&#x28;255&#x29;,&#xa;resultset_uniquename varchar&#x28;255&#x29;,&#xa;feldnr integer,&#xa;feldwert varchar&#x28;255&#x29;&#xa;&#x29;&#x3b;&#xa;</sql>
<useVariableSubstitution>F</useVariableSubstitution>
<sqlfromfile>F</sqlfromfile>
<sqlfilename/>
<sendOneStatement>F</sendOneStatement>
<connection>eduetl</connection>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>256</xloc>
<yloc>80</yloc>
</entry>
<entry>
<name>finalize</name>
<description/>
<type>SQL</type>
<sql/>
<useVariableSubstitution>T</useVariableSubstitution>
<sqlfromfile>T</sqlfromfile>
<sqlfilename>&#x24;&#x7b;Internal.Job.Filename.Directory&#x7d;&#x2f;testfall_import_dbtest.sql</sqlfilename>
<sendOneStatement>F</sendOneStatement>
<connection>eduetl</connection>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>816</xloc>
<yloc>80</yloc>
</entry>
<entry>
<name>testfall_import 2</name>
<description/>
<type>TRANS</type>
<specification_method>filename</specification_method>
<trans_object_id/>
<filename>&#x24;&#x7b;Internal.Job.Filename.Directory&#x7d;&#x2f;testfall_import_dbtest.ktr</filename>
<transname/>
<arg_from_previous>N</arg_from_previous>
<params_from_previous>N</params_from_previous>
<exec_per_row>N</exec_per_row>
<clear_rows>N</clear_rows>
<clear_files>N</clear_files>
<set_logfile>N</set_logfile>
<logfile/>
<logext/>
<add_date>N</add_date>
<add_time>N</add_time>
<loglevel>Basic</loglevel>
<cluster>N</cluster>
<slave_server_name/>
<set_append_logfile>N</set_append_logfile>
<wait_until_finished>Y</wait_until_finished>
<follow_abort_remote>N</follow_abort_remote>
<create_parent_folder>N</create_parent_folder>
<logging_remote_work>N</logging_remote_work>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
<draw>Y</draw>
<nr>0</nr>
<xloc>608</xloc>
<yloc>80</yloc>
</entry>
</entries>
<hops>
<hop>
<from>START</from>
<to>create table tmp_testfall_import</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>create table tmp_testfall_import</from>
<to>testfall_import_def</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>testfall_import_def</from>
<to>testfall_import 2</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>testfall_import 2</from>
<to>finalize</to>
<from_nr>0</from_nr>
<to_nr>0</to_nr>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
<notepad>
<note>TODO&#x3a; Parameter userid aus Maskenfeld</note>
<xloc>472</xloc>
<yloc>234</yloc>
<width>273</width>
<heigth>27</heigth>
<fontname/>
<fontsize>-1</fontsize>
<fontbold>N</fontbold>
<fontitalic>N</fontitalic>
<fontcolorred>0</fontcolorred>
<fontcolorgreen>0</fontcolorgreen>
<fontcolorblue>0</fontcolorblue>
<backgroundcolorred>255</backgroundcolorred>
<backgroundcolorgreen>205</backgroundcolorgreen>
<backgroundcolorblue>112</backgroundcolorblue>
<bordercolorred>100</bordercolorred>
<bordercolorgreen>100</bordercolorgreen>
<bordercolorblue>100</bordercolorblue>
<drawshadow>Y</drawshadow>
</notepad>
</notepads>
</job>

1511
src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.ktr

File diff suppressed because it is too large Load Diff

126
src-modules/module/qa/etl/testfall_import/testfall_import_dbtest.sql

@ -0,0 +1,126 @@ @@ -0,0 +1,126 @@
delete from qa_resultset
where (systeminfo_id,uniquename)
in (select systeminfo_id,uniquename
from tmp_qa_resultset );
insert into qa_resultset
(
uniquename,
name,
systeminfo_id,
fromclause,
fieldclause,
groupbyclause,
orderbyclause
)
SELECT
uniquename,
name,
systeminfo_id,
fromclause,
fieldclause,
groupbyclause,
orderbyclause
FROM tmp_qa_resultset
;
update tmp_qa_dbtest
set whereclause='';
update tmp_qa_dbtest
set whereclause=whereclause || F.feldname || '::varchar(255)='''|| W.feldwert || ''''
from tmp_testfall_import_felder F, tmp_testfall_import_feldwerte W
where F.feldnr=W.feldnr
and W.testfall_schluessel=tmp_qa_dbtest.uniquename
and W.feldnr=1;
update tmp_qa_dbtest
set whereclause=whereclause || ' and ' || F.feldname || '::varchar(255)='''|| W.feldwert || ''''
from tmp_testfall_import_felder F, tmp_testfall_import_feldwerte W
where F.feldnr=W.feldnr
and W.testfall_schluessel=tmp_qa_dbtest.uniquename
and W.feldnr=2;
update tmp_qa_dbtest
set whereclause=whereclause || ' and ' || F.feldname || '::varchar(255)='''|| W.feldwert || ''''
from tmp_testfall_import_felder F, tmp_testfall_import_feldwerte W
where F.feldnr=W.feldnr
and W.testfall_schluessel=tmp_qa_dbtest.uniquename
and W.feldnr=3;
update tmp_qa_dbtest
set whereclause=whereclause || ' and ' || F.feldname || '::varchar(255)='''|| W.feldwert || ''''
from tmp_testfall_import_felder F, tmp_testfall_import_feldwerte W
where F.feldnr=W.feldnr
and W.testfall_schluessel=tmp_qa_dbtest.uniquename
and W.feldnr=4;
delete from qa_dbtest_assertion
where dbtest_id in (select D.tid
from qa_dbtest D, tmp_qa_dbtest T
where D.systeminfo_id=T.systeminfo_id
and D.uniquename=T.uniquename
);
delete from qa_dbtest
where (systeminfo_id,uniquename) in
(select systeminfo_id,uniquename
from tmp_qa_dbtest T
);
insert into qa_dbtest( uniquename,
name,
systeminfo_id,
resultset_id,
whereclause,
description,
active
)
select distinct
T.uniquename,
T.name,
T.systeminfo_id,
R.tid,
T.whereclause,
T.description,
T.active
FROM tmp_qa_dbtest T, qa_resultset R
where R.uniquename=T.resultset_uniquename
;
insert into qa_dbtest_assertion
( dbtest_id,
rownr,
def_col_caption,
def_col_name,
def_col_value,
def_col_function)
select
D.tid,
1,
E.feldname,
E.feldname,
A.def_col_value,
'decval'
from qa_dbtest D ,tmp_qa_dbtest_assertion A, tmp_testfall_import_erg E
where E.feldnr::varchar(255)=A.def_col_name
and D.uniquename=A.dbtest_uniquename
and D.systeminfo_id=A.systeminfo_id
;
drop table tmp_qa_dbtest_assertion;
drop table tmp_testfall_import_erg;
drop table tmp_qa_dbtest;
drop table tmp_testfall_import_felder ;
drop table tmp_testfall_import_feldwerte;

1130
src-modules/module/qa/etl/testfall_import/testfall_import_dbtest_def.ktr

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save