diff --git a/build.xml b/build.xml index ff20c67..bffc4a2 100644 --- a/build.xml +++ b/build.xml @@ -2,10 +2,10 @@ diff --git a/src-modules/module/hierhin bitte das Kuerzel Ihres moduls.txt b/src-modules/module/hierhin bitte das Kuerzel Ihres moduls.txt deleted file mode 100644 index e69de29..0000000 diff --git a/src-modules/module/qa/conf/excludes.txt b/src-modules/module/qa/conf/excludes.txt new file mode 100644 index 0000000..cce7629 --- /dev/null +++ b/src-modules/module/qa/conf/excludes.txt @@ -0,0 +1,10 @@ +rohdaten/QA_ENV +rohdaten/*.properties +preparation.sql +finalize.sql +rohdaten/*.err +*.log +*.err +rohdaten/unl/* +conf/customize.sql +conf/*.log diff --git a/src-modules/module/qa/conf/includes.txt b/src-modules/module/qa/conf/includes.txt new file mode 100644 index 0000000..31e372b --- /dev/null +++ b/src-modules/module/qa/conf/includes.txt @@ -0,0 +1,2 @@ +doku/qa_modul/qa.html +WEB-INF/conf/edustore/db/bin/SQL_ENV_qa.sam diff --git a/src-modules/module/qa/conf/qa.xml b/src-modules/module/qa/conf/qa.xml new file mode 100644 index 0000000..5e5f4d5 --- /dev/null +++ b/src-modules/module/qa/conf/qa.xml @@ -0,0 +1,916 @@ + + + + + + + + + +Berichtsausführung + + +ID + + +Interner Name + + +Benutzer + + +die ausgeführt werden soll + + +Aktiv 0/1 + + +XSL-Stylesheet bzw. JR + + +XSL-Stylesheet bzw. JR + + +Ausgabedatei, wenn leer tmp.Datei + + + + + + + + + + + +superx +superx +qa_mask_execution +tid +1 +pk_qa_mask_execution1 + + + +
+ +Feldvorbelegung bei Berichtsausführung + + +ID + + + +Test-ID + + +Feld der Maske + + +Wert des Feldes + + +Aktiv 0/1 + + + + + +superx +superx +qa_mask_field_sel +tid +1 +pk_qa_mask_field_sel1 + + + +
+ +Erwartetes Ergebnis nach Berichtsausführung + + +ID + + + +Test-ID + + + +Zeilennummer + + +Spaltennummer + + +Untergrenze Ergebniswert + + +Obergrenze Ergebniswert + + +Aktiv 0/1 + + + + + + + + +superx +superx +qa_mask_execution_assert +tid +1 +pk_qa_mask_execution_assert1 + + + +
+ +Protokoll der Berichtsausführung + + +ID + + + + + + + + + + + +0=Erfolg + + + + + + + + + +superx +superx +qa_mask_execution_result +tid +1 +pk_qa_mask_execution_result + + + +
+ +Ergebnis nach Berichtsausführung + + +ID + + +Test-ID + + +Test-ID + + + + + + + + +superx +superx +qa_mask_execution_assert_result +tid +1 +pk_qa_mask_execution_assert_result + + + +
+ + + +Tabellenvergleich Name des Profils + + +ID + + +Interner Name + + + + + + + + + + + + + + + + + + +Aktiv 0/1 + + + + + + + + +superx +superx +qa_tablecomp_profile +tid +1 +pk_qa_tablecomp_profile + + + +
+ + +Tabellenvergleich Abgleiche Summen im Rahmen eines Profils + + +ID + + + + + +Interner Name + + + + + + + + +z.B. sum + + +Aktiv 0/1 + + + + + + + + +superx +superx +qa_tablecomp_aggregation +tid +1 +pk_qa_tablecomp_aggregation + + + +
+ + +Tabellenvergleich Abgleiche Felder im Rahmen eines Profils + + +ID + + + + + +Feldname + + + + + + + + + + + +superx +superx +qa_tablecomp_field +tid +1 +pk_qa_tablecomp_field + + + +
+ + +Tabellenvergleich Gruppierungsspalten im Rahmen eines Profils + + +ID + + + + + +Interner Name + + + + + +superx +superx +qa_tablecomp_groupby +tid +1 +pk_qa_tablecomp_groupby + + + +
+ +Tabellenvergleich Identitätsspalten im Rahmen eines Profils + + +ID + + + + + +Interner Name + + + + + +superx +superx +qa_tablecomp_idcol +tid +1 +pk_qa_tablecomp_idcol + + + +
+ + + + + + + + + + + + + + + +qa_project +tid +1 +pk_qa_project + + + + + + +
+ + + + + + + + + + + + + +qa_resultset +tid +1 +pk_qa_resultset + + + + + + +
+ + + + + + + + + + + + + +qa_resultset_field +tid +1 +pk_qa_resultset_field + + + + + + +
+ + + + + + + + + + + + + + + +qa_dbtest +tid +1 +pk_qa_dbtest + + + + + + +
+ + + + + + + + + + + + + + +qa_dbtest_assertion +tid +1 +pk_qa_dbtest_assertion + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +View PO-Version + + + + + + + + + + + + + +Abfragen zur Administration + + + + Masken-Ausführung planen + + $QA_PFAD/masken + + + + Masken-Ausführung + + $QA_PFAD/masken + + + + Masken-Ausführung + + $QA_PFAD/masken + + + + Masken-Ausführung + + $QA_PFAD/masken + + + + Testfälle hochladen + + $QA_PFAD/masken + + + + Datenbank-Tests Protokoll + + $QA_PFAD/masken + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+In diesem Formular können Sie Berichtsausführungen verwalten. + +tid + + + + + + + + + + + + + +
+In diesem Formular können Sie Profile verwalten. Im Details-Formular können Sie Tabellen und Felder zuordnen. + + + + + + + + + + +
+In diesem Formular können Sie Profile verwalten. Hier können Sie Tabellen und Felder zuordnen. + +tid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/src-modules/module/qa/etl/mask_execution/execute_mask.x b/src-modules/module/qa/etl/mask_execution/execute_mask.x new file mode 100755 index 0000000..790e8f2 --- /dev/null +++ b/src-modules/module/qa/etl/mask_execution/execute_mask.x @@ -0,0 +1,36 @@ +#!/bin/bash + +OUTFILE=mask_execution_log.xml + +echo "CMDLINE: $1 $2 $3 $4 $5" +cd $WEBAPP/WEB-INF + +if [ "$LANG" = "de_DE.utf8" ] +then + +ENCODING="UTF-8" + +else + +ENCODING="ISO-8859-1" + +fi + +echo "" >$OUTFILE +echo '' >>$OUTFILE +date +'%d.%m.%Y %H:%M:%S' >>$OUTFILE +echo '' >>$OUTFILE + +java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask $1 $2 $3 $4 "$5" >tmp.log 2>&1 + +RESULT_CODE=$? + +echo '' >>$OUTFILE +date +'%d.%m.%Y %H:%M:%S' >>$OUTFILE +echo '' >>$OUTFILE +echo '>$OUTFILE +cat tmp.log >>$OUTFILE +echo ']]>' >>$OUTFILE +echo ''$RESULT_CODE'' >>$OUTFILE +echo '' >>$OUTFILE + diff --git a/src-modules/module/qa/etl/mask_execution/execute_masks.sql b/src-modules/module/qa/etl/mask_execution/execute_masks.sql new file mode 100644 index 0000000..a80b17d --- /dev/null +++ b/src-modules/module/qa/etl/mask_execution/execute_masks.sql @@ -0,0 +1,129 @@ +--freemarker template + + + + + + + +<#assign shebang="!" /> +<#if SQLdialect='Postgres'> +<#assign shebang="\\!" /> + +drop table if exists tmp_result_upload; +drop table if exists tmp_result; + + +<#assign type_timestamp="datetime year to second" /> +<#if SQLdialect='Postgres'> +<#assign type_timestamp="timestamptz" /> + +<#foreach mask_execution in mask_executions> +select 'Start Ausführung: ${mask_execution.tid} ${mask_execution.name}' from xdummy; + +create table tmp_result_upload( +execution_start ${type_timestamp} , +execution_end ${type_timestamp} , +result_log TEXT, +result_code SMALLINT +); + +create table tmp_result( +mask_execution_assert_id integer, +mask_execution_result_id integer, +execution_start ${type_timestamp} , +execution_end ${type_timestamp} , +result_log TEXT, +result_code SMALLINT +); + + + +${shebang} ./execute_mask.x ${mask_execution.params1} "${mask_execution.params2}" + +${shebang} SX_CLIENT=jdbc; sx_auto_upload_table.x tmp_result_upload $WEBAPP/WEB-INF/mask_execution_log.xml false xml + +insert into tmp_result(execution_start , execution_end, result_log, result_code) +select execution_start , execution_end, result_log, result_code from tmp_result_upload; + +insert into qa_mask_execution_result( +mask_execution_id) +values (${mask_execution.tid}); + +update tmp_result set mask_execution_result_id=(select max(tid) from qa_mask_execution_result); + +<#if SQLdialect='Postgres'> +--Postgres Dialekt: +update qa_mask_execution_result set +execution_start =T. execution_start, +execution_end =T.execution_end , +result_log=T.result_log, +result_code=T.result_code +from tmp_result T +where T.mask_execution_result_id=qa_mask_execution_result.tid; +<#else> +--Informix Dialekt: +update qa_mask_execution_result set (execution_start, + execution_end, + result_code) + = ((select + T.execution_start, + T.execution_end, + T.result_code +from tmp_result T +where T.mask_execution_result_id=qa_mask_execution_result.tid +)) +where qa_mask_execution_result.tid =(select T.mask_execution_result_id +from tmp_result T) +; + +--BLOB Spalte muss separat geupdated werden: +update qa_mask_execution_result set result_log=(select + T.result_log +from tmp_result T +where T.mask_execution_result_id=qa_mask_execution_result.tid +) +where qa_mask_execution_result.tid = (select T.mask_execution_result_id +from tmp_result T) +; + + + +<#foreach mask_execution_assert in mask_execution_asserts> +<#if mask_execution_assert.mask_execution_id==mask_execution.tid> + +select 'Start Assertion: ${mask_execution_assert.tid}' from xdummy; + + +${shebang} sx_transform.x -IN:$WEBAPP/WEB-INF/tmp.xml -XSL:mask_assertion.xsl -OUT:tmp_mask_assertion_result.sql -method:text -param:mask_execution_id=${mask_execution_assert.mask_execution_id},mask_execution_assert_id=${mask_execution_assert.tid},rownr=${mask_execution_assert.rownr},colnr=${mask_execution_assert.colnr} +${shebang} DOSQL tmp_mask_assertion_result.sql + + + +drop table tmp_result_upload; +drop table tmp_result; + + +drop table tmp_execution; diff --git a/src-modules/module/qa/etl/mask_execution/get_field_params.sql b/src-modules/module/qa/etl/mask_execution/get_field_params.sql new file mode 100644 index 0000000..ce5de9a --- /dev/null +++ b/src-modules/module/qa/etl/mask_execution/get_field_params.sql @@ -0,0 +1,112 @@ +--freemarker template + +<#if SQLdialect='Postgres'> + +drop table if exists tmp_execution; + + + + +create table tmp_execution( tid INTEGER not null, +name varchar(255) not null, +userinfo_id INTEGER , +userinfo_str VARCHAR(255) , +maskeninfo_id INTEGER , +is_active smallint default 1 not null, +stylesheet_id INTEGER default 1 , +stylesheet_str VARCHAR(255) , +contenttype VARCHAR(255) , +output_filename VARCHAR(255) , +systeminfo_id INTEGER , +field_value varchar(255), +field_values varchar(255) +) +; + +insert into tmp_execution(tid, + name, + userinfo_id, + maskeninfo_id, + is_active, + stylesheet_id, + contenttype, + output_filename, + systeminfo_id, + field_values) + + + +SELECT E.tid, + E.name, + E.userinfo_id, + E.maskeninfo_id, + E.is_active, + E.stylesheet_id, + E.contenttype, + E.output_filename, + E.systeminfo_id, + '' +FROM qa_mask_execution E +where E.is_active=1 + ; + +create temp table tmp_inserted( +mask_execution_id integer, +qa_mask_field_sel_tid integer, +do_insert smallint); + +<#list 1..10 as i> + + +insert into tmp_inserted(mask_execution_id , +do_insert, +qa_mask_field_sel_tid) +select S.mask_execution_id,1,min(S.tid) +from felderinfo F, qa_mask_field_sel S +where F.tid=S.felderinfo_id +and S.is_active=1 +and '' || S.mask_execution_id || '_' || S.tid not in ( +select '' || T.mask_execution_id || '_' || T.qa_mask_field_sel_tid +from tmp_inserted T) +group by 1,2 +; + + +update tmp_execution set field_value=(select trim(F.name) || '=' || trim(S.field_value) +from felderinfo F, qa_mask_field_sel S, tmp_inserted T +where T.mask_execution_id=S.mask_execution_id +and T.mask_execution_id=tmp_execution.tid +and F.tid=S.felderinfo_id +and S.is_active=1 +and S.tid=T.qa_mask_field_sel_tid +and T.do_insert=1 +) +; +update tmp_inserted set do_insert=0; +update tmp_execution set field_values=field_values || trim(string_not_null('&' || field_value)); + + + + +drop table tmp_inserted; + +update tmp_execution set stylesheet_str='tabelle_xml.xsl' +--derzeit noch fest verdrahtet xml +--(select trim(S.filename) +--from sx_stylesheets S +--where S.tid=tmp_execution.stylesheet_id) +; + +update tmp_execution set userinfo_str=(select trim(U.benutzer) +from userinfo U +where U.tid=tmp_execution.userinfo_id); + +--java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:16000 -out:test.pdf -user:admin "-params:Köpfe oder Fälle ?=1=1&Stichtag=1&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/pdf" -logger:$SUPERX_DIR/db/conf/logging.properties + +--select 'java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:' || maskeninfo_id +--|| ' -out:' || output_filename || ' -user:' || userinfo_str || ' "-params:1=1'|| field_values || '&&stylesheet=' || stylesheet_str || '&contenttype=' || contenttype || '" -logger:$SUPERX_DIR/db/conf/logging.properties' +--from tmp_execution; + +--drop table tmp_execution; + + diff --git a/src-modules/module/qa/etl/mask_execution/mask_assertion.xsl b/src-modules/module/qa/etl/mask_execution/mask_assertion.xsl new file mode 100644 index 0000000..8bea379 --- /dev/null +++ b/src-modules/module/qa/etl/mask_execution/mask_assertion.xsl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + +null::integer + + + + + + +--freemarker template + +insert into qa_mask_execution_assert_result( +mask_execution_assert_id, +mask_execution_result_id, +result_value) +select ,T.mask_execution_result_id, + +from tmp_result T; + + + + diff --git a/src-modules/module/qa/etl/mask_execution/mask_execution.kjb b/src-modules/module/qa/etl/mask_execution/mask_execution.kjb new file mode 100644 index 0000000..3a72934 --- /dev/null +++ b/src-modules/module/qa/etl/mask_execution/mask_execution.kjb @@ -0,0 +1,372 @@ + + + mask_execution + + + + 0 + / + - + 2019/09/17 22:10:21.757 + - + 2019/09/17 22:10:21.757 + + + params + + + + + + + + + + + + + + + ID_JOB + Y + ID_JOB + + + CHANNEL_ID + Y + CHANNEL_ID + + + JOBNAME + Y + JOBNAME + + + STATUS + Y + STATUS + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + STARTDATE + Y + STARTDATE + + + ENDDATE + Y + ENDDATE + + + LOGDATE + Y + LOGDATE + + + DEPDATE + Y + DEPDATE + + + REPLAYDATE + Y + REPLAYDATE + + + LOG_FIELD + Y + LOG_FIELD + + + EXECUTING_SERVER + N + EXECUTING_SERVER + + + EXECUTING_USER + N + EXECUTING_USER + + + START_JOB_ENTRY + N + START_JOB_ENTRY + + + CLIENT + N + CLIENT + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + JOBNAME + Y + TRANSNAME + + + JOBENTRYNAME + Y + STEPNAME + + + LINES_READ + Y + LINES_READ + + + LINES_WRITTEN + Y + LINES_WRITTEN + + + LINES_UPDATED + Y + LINES_UPDATED + + + LINES_INPUT + Y + LINES_INPUT + + + LINES_OUTPUT + Y + LINES_OUTPUT + + + LINES_REJECTED + Y + LINES_REJECTED + + + ERRORS + Y + ERRORS + + + RESULT + Y + RESULT + + + NR_RESULT_ROWS + Y + NR_RESULT_ROWS + + + NR_RESULT_FILES + Y + NR_RESULT_FILES + + + LOG_FIELD + N + LOG_FIELD + + + COPY_NR + N + COPY_NR + + + + + +
+ + + ID_BATCH + Y + ID_BATCH + + + CHANNEL_ID + Y + CHANNEL_ID + + + LOG_DATE + Y + LOG_DATE + + + LOGGING_OBJECT_TYPE + Y + LOGGING_OBJECT_TYPE + + + OBJECT_NAME + Y + OBJECT_NAME + + + OBJECT_COPY + Y + OBJECT_COPY + + + REPOSITORY_DIRECTORY + Y + REPOSITORY_DIRECTORY + + + FILENAME + Y + FILENAME + + + OBJECT_ID + Y + OBJECT_ID + + + OBJECT_REVISION + Y + OBJECT_REVISION + + + PARENT_CHANNEL_ID + Y + PARENT_CHANNEL_ID + + + ROOT_CHANNEL_ID + Y + ROOT_CHANNEL_ID + + + N + + + + START + + SPECIAL + Y + N + N + 0 + 0 + 60 + 12 + 0 + 1 + 1 + N + Y + 0 + 80 + 80 + + + execute + + SHELL + ${Internal.Job.Filename.Directory}/execute_mask.x + ${Internal.Job.Filename.Directory} + N + N + Y + ${Internal.Job.Filename.Directory}/execute_mask + N + log + N + N + N +