diff --git a/.ant-targets-build.xml b/.ant-targets-build.xml
new file mode 100644
index 0000000..dcac0ee
--- /dev/null
+++ b/.ant-targets-build.xml
@@ -0,0 +1,8 @@
+all
+call_module_scripts_create_ant
+cleanBuildPath
+compileSuperx
+dist
+distQA
+initTimestamp
+module_copy_source
diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..9b72810
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..840e7d3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/classes/
diff --git a/.project b/.project
new file mode 100644
index 0000000..6ace319
--- /dev/null
+++ b/.project
@@ -0,0 +1,24 @@
+
+
+ qa
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
+
+ superx-src
+ 2
+ /home/superx/git/kern/src
+
+
+
diff --git a/build.xml b/build.xml
index e9fa700..274c51f 100644
--- a/build.xml
+++ b/build.xml
@@ -7,17 +7,34 @@ ant -DMODULE_PATH=$QA_PFAD -DBASE_DIR=. -DWEBAPP=$WEBAPP -DMODULE=qa all
So erzeugen Sie dann ein SuperX-Paket:
ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
+QA-JAR erzeugen:
+
+ant -DWEBAPP=$WEBAPP distQA
+ant -DWEBAPP=$WEBAPP cleanBuildPath
-->
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -26,15 +43,24 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
+
+
+
+
+
-
+
+
+
+
+
@@ -47,6 +73,13 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
+
+
+
+
+
+
+
@@ -62,4 +95,45 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src-modules/module/qa/conf/includes.txt b/src-modules/module/qa/conf/includes.txt
index 31e372b..68ef154 100644
--- a/src-modules/module/qa/conf/includes.txt
+++ b/src-modules/module/qa/conf/includes.txt
@@ -1,2 +1,5 @@
doku/qa_modul/qa.html
WEB-INF/conf/edustore/db/bin/SQL_ENV_qa.sam
+WEB-INF/conf/edustore/db/bin/qa_mask_execution.x
+WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x
+WEB-INF/lib/superx-qa.jar
diff --git a/src-modules/module/qa/conf/qa.xml b/src-modules/module/qa/conf/qa.xml
index 39f53b5..b832487 100644
--- a/src-modules/module/qa/conf/qa.xml
+++ b/src-modules/module/qa/conf/qa.xml
@@ -1,6 +1,6 @@
-
@@ -213,6 +213,12 @@ notnull="true">
+
+CSV oder XML
+
+
+HTML, Text, CSV oder XML
+
@@ -306,6 +307,13 @@ notnull="true">
Test-ID
+
+Untergrenze erwarteter Ergebniswert
+
+
+Obergrenze erwarteter Ergebniswert
+
+
@@ -766,7 +774,7 @@ parent="Qualitätssicherung">Abfragen zur Administration
$QA_PFAD/masken
-
+
Masken-Ausführung
$QA_PFAD/masken
@@ -973,6 +981,8 @@ format="%s">
database=""/>
+
diff --git a/src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql b/src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql
index f0b2394..97b910c 100644
--- a/src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql
+++ b/src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql
@@ -21,7 +21,8 @@
<@selectintotmp
-select="A.tid as qa_mask_execution_assert_result_tid,
+select="1::integer as testcase_type,
+A.tid as qa_mask_execution_assert_result_tid,
R.tid,
R.mask_execution_id,
R.execution_start,
@@ -35,16 +36,22 @@ E.name as execution_name,
E.uniquename,
E.systeminfo_id,
''::char(255) as systeminfo_id_str,
+''::varchar(255) as ticket_link,
E.maskeninfo_id,
''::char(255) as maskeninfo_id_str,
A.mask_execution_assert_id,
-null::integer as result_value_min,
-null::integer as result_value_max,
+null::integer as dauer,
+A.assert_result_value_min as result_value_min,
+A.assert_result_value_max as result_value_max,
null::varchar(255) as assert_caption,
-null::varchar(255)[] as fields
+null::varchar(255) as assert_value_range,
+null::varchar(255)[] as fields,
+null::varchar(255) as nextedit,
+null::varchar(255) as nextmask,
+null::varchar(255) as nexttable
"
source="qa_mask_execution E, qa_mask_execution_result R inner join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"
-target="tmp_qa_mask_execution">
+target="tmp_testcase">
-- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen
where
E.tid=R.mask_execution_id
@@ -56,7 +63,8 @@ and A.result_code is null
<@selectintotmp
-select="A.tid as qa_mask_execution_assert_result_tid,
+select="1::integer as testcase_type,
+A.tid as qa_mask_execution_assert_result_tid,
R.tid,
R.mask_execution_id,
R.execution_start,
@@ -70,18 +78,22 @@ E.name as execution_name,
E.uniquename,
E.systeminfo_id,
''::char(255) as systeminfo_id_str,
+''::varchar(255) as ticket_link,
E.maskeninfo_id,
''::char(255) as maskeninfo_id_str,
A.mask_execution_assert_id,
-null::integer as result_value_min,
-null::integer as result_value_max,
+null::decimal(20,6) as dauer,
+A.assert_result_value_min as result_value_min,
+A.assert_result_value_max as result_value_max,
null::varchar(255) as assert_caption,
+null::varchar(255) as assert_value_range,
null::varchar(255)[] as fields,
('' || E.maskeninfo_id || '&')::text as nextmask,
- ('../edit/qa/qa_mask_execution_edit.jsp|tid=' || E.tid)::varchar(255) as nextedit
+ ('../edit/qa/qa_mask_execution_edit.jsp|tid=' || E.tid)::varchar(255) as nextedit,
+ ('37040&Ergebnis=' || R.tid)::varchar(255) as nexttable
"
source="qa_mask_execution E, qa_mask_execution_result R left outer join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"
-target="tmp_qa_mask_execution">
+target="tmp_testcase">
-- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen
where
E.tid=R.mask_execution_id
@@ -93,41 +105,34 @@ target="tmp_qa_mask_execution">
/* and E.uniquename ilike '%<>%' */
/* and date(R.execution_start) >= date_val(<>) */
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<>) */
- /* and R.tid=<> */
+ /* and 1=<> */
@selectintotmp>
<@informixnolog/>;
#if>
<#if SQLdialect='Postgres'>
-update tmp_qa_mask_execution set result_value_min=A.result_value_min,
-result_value_max=A.result_value_max,
-assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
+update tmp_testcase set assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
from qa_mask_execution_assert A
-where A.tid=tmp_qa_mask_execution.mask_execution_assert_id;
+where A.tid=tmp_testcase.mask_execution_assert_id;
<#else>
--Informix Dialekt:
-update tmp_qa_mask_execution set (result_value_min,
- result_value_max,
- assert_caption)
- = ((select
- A.result_value_min,
- A.result_value_max,
+update tmp_testcase set assert_caption=(select
nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
from qa_mask_execution_assert A
-where A.tid=tmp_qa_mask_execution.mask_execution_assert_id
-))
-where tmp_qa_mask_execution.mask_execution_assert_id in (select A.tid
+where A.tid=tmp_testcase.mask_execution_assert_id
+)
+where tmp_testcase.mask_execution_assert_id in (select A.tid
from qa_mask_execution_assert A)
;
#if>
-update tmp_qa_mask_execution set result_status=2,
+update tmp_testcase set result_status=2,
result_status_str='Fehler'
where result_code!=0;
-update tmp_qa_mask_execution set result_status=0,
+update tmp_testcase set result_status=0,
result_status_str='Erfolg'
where result_code=0
and (
@@ -137,40 +142,154 @@ and
)
;
-update tmp_qa_mask_execution set result_status=1,
+update tmp_testcase set result_status=1,
result_status_str='Warnung'
where result_status is null;
+update tmp_testcase set assert_value_range=result_value_min || '-' || result_value_max;
+
+update tmp_testcase set dauer=
+<#if SQLdialect='Postgres'>
+round(extract(second from (execution_end-execution_start))::decimal,0)::decimal
+<#else>
+execution_end-execution_start
+#if>
+;
+update tmp_testcase set ticket_link=P.issue_link || TP.issue_id
+from qa_mask_execution2project TP, qa_project P
+where TP.mask_execution_id=tmp_testcase.mask_execution_id
+and P.tid=TP.project_id
+;
+--nun DB-Tests:
+<@selectintotmp
+select="
+T.tid,
+T.name,
+T.uniquename,
+R.execution_start,
+R.execution_end,
+R.result_code,
+null::integer as result_status,
+''::char(255) as result_status_str,
+R.result_value,
+T.systeminfo_id,
+''::char(255) as systeminfo_id_str,
+A.tid as qa_dbtest_assertion_id,
+A.def_col_caption,
+A.def_col_name,
+A.def_col_value,
+''::varchar(255) as ticket_link,
+ ('../edit/qa/qa_dbtest_edit.jsp|tid=' || T.tid)::varchar(255) as nextedit
+"
+source="qa_dbtest T, qa_dbtest_assertion A inner join qa_dbtest_result R
+on (R.dbtest_assertion_id=A.tid /* and date(R.execution_start) >= date_val(<>) */
+/* and R.tid=<> */
+)"
+target="tmp_qa_dbtest">
+ where
+ T.tid=A.dbtest_id
+ /* and T.active=<> */
+ /* and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id=<>) */
+ /* and E.userinfo_id=<> */
+ /* and T.systeminfo_id=<> */
+ /* and T.name ilike '%<>%' */
+ /* and T.tid=<> */
+ /* and 2=<> */
+ @selectintotmp>
+ <@informixnolog/>;
+
+update tmp_qa_dbtest set ticket_link=P.issue_link || TP.issue_id
+from qa_dbtest2project TP, qa_project P
+where TP.dbtest_id=tmp_qa_dbtest.tid
+and P.tid=TP.project_id
+;
+update tmp_qa_dbtest set --result_status=1,
+result_status_str='Warnung'
+ where result_code=1;
+update tmp_qa_dbtest set result_status=2,
+ result_status_str='Fehler'
+ where result_code is null;
+--
+update tmp_qa_dbtest set
+ result_status_str='Erfolg'
+ where result_code=0
+ ;
+
+/* delete from tmp_qa_dbtest where result_code not in ( <>) ; */
+
+
+
+insert into tmp_testcase(testcase_type,
+systeminfo_id,
+execution_name,
+uniquename,
+--maskeninfo_id_str,
+--nextserverlink,
+ticket_link,
+--nextmask,
+execution_start,
+dauer,
+assert_caption,
+assert_value_range,
+result_value,
+result_status_str,
+nexttable,
+nextedit
+)
+select 2::integer as testcase_type, --DB-Test
+systeminfo_id,
+name,
+uniquename,
+case when ticket_link !='' then 'Ticket|' || ticket_link else '' end as ticket_link,
+execution_start,
+<#if SQLdialect='Postgres'>
+round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,
+<#else>
+execution_end-execution_start as dauer,
+#if>
+nvl(def_col_caption,def_col_name) as assert_caption,
+def_col_value as assert_value_range,
+result_value,
+result_status_str,
+'' as nexttable,
+nextedit
+from tmp_qa_dbtest
+;
+
+drop table tmp_qa_dbtest;
+
+
+
<#if inEtl>
update qa_mask_execution_assert_result set result_code=T.result_status
-from tmp_qa_mask_execution T
+from tmp_testcase T
where T.qa_mask_execution_assert_result_tid=qa_mask_execution_assert_result.tid
and qa_mask_execution_assert_result.result_code is null;
-drop table tmp_qa_mask_execution;
+drop table tmp_testcase;
<#else>
-/* delete from tmp_qa_mask_execution where result_status not in (<>) ; */
+/* delete from tmp_testcase where result_status not in (<>) ; */
-update tmp_qa_mask_execution set systeminfo_id_str=(select name from systeminfo S
-where S.tid=tmp_qa_mask_execution.systeminfo_id);
+update tmp_testcase set systeminfo_id_str=(select name from systeminfo S
+where S.tid=tmp_testcase.systeminfo_id);
-update tmp_qa_mask_execution set maskeninfo_id_str=(select name from maskeninfo M
-where M.tid=tmp_qa_mask_execution.maskeninfo_id);
+update tmp_testcase set maskeninfo_id_str=(select name from maskeninfo M
+where M.tid=tmp_testcase.maskeninfo_id);
<#if SQLdialect='Postgres'>
-update tmp_qa_mask_execution set fields=(select array_agg(trim(F.name) || '=' || trim(S.field_value))
+update tmp_testcase set fields=(select array_agg(trim(F.name) || '=' || trim(S.field_value))
from qa_mask_field_sel S, felderinfo F
where S.felderinfo_id=F.tid
and S.is_active=1
-and S.mask_execution_id=tmp_qa_mask_execution.execution_id
+and S.mask_execution_id=tmp_testcase.execution_id
);
-update tmp_qa_mask_execution set nextmask=nextmask || array_to_string(fields,'&','')
+update tmp_testcase set nextmask=nextmask || array_to_string(fields,'&','')
where fields is not null;
#if>
@@ -180,22 +299,18 @@ execution_name,
uniquename,
maskeninfo_id_str,
nextmask,
+ticket_link as nextserverlink,
execution_start,
-<#if SQLdialect='Postgres'>
-round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,
-<#else>
-execution_end-execution_start as dauer,
-#if>
+dauer,
assert_caption,
-result_value_min,
-result_value_max,
+assert_value_range,
result_value,
result_status_str,
-('37040&Ergebnis=' || tid)::varchar(255) as nexttable
+nexttable
<#if UserIsAdmin>
,nextedit
#if>
-from tmp_qa_mask_execution
+from tmp_testcase
order by 1,2,3,4,5,6,7;
#if>
diff --git a/src-modules/module/qa/datentabellen/qa_mask_execution_result_purge.sql b/src-modules/module/qa/datentabellen/qa_mask_execution_result_purge.sql
new file mode 100644
index 0000000..ce1960c
--- /dev/null
+++ b/src-modules/module/qa/datentabellen/qa_mask_execution_result_purge.sql
@@ -0,0 +1,7 @@
+
+
+
+--Speicherplatz sparen bei Erfolg:
+update qa_mask_execution_result set result_stream=null,
+result_stream_contenttype=null
+where result_code=0;
diff --git a/src-modules/module/qa/etl/mask_execution/execute_masks.sql b/src-modules/module/qa/etl/mask_execution/execute_masks.sql
index 3e43016..919dc80 100644
--- a/src-modules/module/qa/etl/mask_execution/execute_masks.sql
+++ b/src-modules/module/qa/etl/mask_execution/execute_masks.sql
@@ -116,8 +116,8 @@ from tmp_result T)
select 'Start Assertion: ${mask_execution_assert.tid}' from xdummy;
-${shebang} echo "Start 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} 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} echo "Start sx_transform.x -IN:$WEBAPP/WEB-INF/tmp.xml -XSL:mask_assertion.xsl -OUT:tmp_mask_assertion_result.sql -method:text -params: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} sx_transform.x -IN:$WEBAPP/WEB-INF/tmp.xml -XSL:mask_assertion.xsl -OUT:tmp_mask_assertion_result.sql -method:text -params: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
#if>
#foreach>
diff --git a/src-modules/module/qa/masken/37000_felderinfo.unl b/src-modules/module/qa/masken/37000_felderinfo.unl
index 06befbc..1c210ea 100644
--- a/src-modules/module/qa/masken/37000_felderinfo.unl
+++ b/src-modules/module/qa/masken/37000_felderinfo.unl
@@ -1,5 +1,7 @@
-37000^Benutzer/in^50^0^0^150^200^1^integer^200^0^1^<> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
-37001^Testfall-Schlüssel^10^0^0^150^150^1^sql^50^0^0^^^^
+37000^Benutzer/in^150^0^0^150^200^1^integer^200^0^1^<> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
+37001^Testfall-Schlüssel^20^0^0^150^150^1^char^50^0^0^^^^
37002^Projekt^10^0^0^150^80^1^integer^200^0^1^<> select tid,name from qa_project where active=1 /* and systeminfo_id=<> */ order by 2;^^^
-37003^Name^20^0^0^150^150^1^sql^50^0^0^^^^
+37003^Name^60^0^0^150^150^1^char^50^0^0^^^^
37004^Komponente^1^0^0^150^200^1^integer^200^0^1^<> select tid,name from systeminfo order by 2;^^^
+37005^Maske^40^0^0^150^80^1^integer^200^0^1^<> select tid,tid || ' - ' || name from maskeninfo /*where tid in (select S.maskeninfo_id from maske_system_bez S where S.systeminfo_id=<>) */ order by name;^^^
+37006^Testfall-Nr.^30^0^0^150^150^1^integer^50^0^0^^^^
diff --git a/src-modules/module/qa/masken/37000_masken_felder_bez.unl b/src-modules/module/qa/masken/37000_masken_felder_bez.unl
index 669c7d9..a1394e3 100644
--- a/src-modules/module/qa/masken/37000_masken_felder_bez.unl
+++ b/src-modules/module/qa/masken/37000_masken_felder_bez.unl
@@ -3,3 +3,5 @@
37000^37002^
37000^37003^
37000^37004^
+37000^37005^
+37000^37006^
diff --git a/src-modules/module/qa/masken/37000_maskeninfo.unl b/src-modules/module/qa/masken/37000_maskeninfo.unl
index cd43f11..bb6f846 100644
--- a/src-modules/module/qa/masken/37000_maskeninfo.unl
+++ b/src-modules/module/qa/masken/37000_maskeninfo.unl
@@ -48,8 +48,9 @@ FROM maskeninfo M, qa_mask_execution E left outer join userinfo U\
on (U.tid=E.userinfo_id)\
where M.tid=E.maskeninfo_id\
/* and E.userinfo_id=<> */\
-/* and E.name ilike '%<>%' */\
-/* and E.uniquename ilike '%<>%' */\
+/* and position(<> in E.name)>0 */\
+/* and position(<> in E.uniquename)>0 */\
+/* and E.tid = <> */\
/* and E.systeminfo_id=<> */\
/* and E.maskeninfo_id=<> */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<>) */\
@@ -67,7 +68,6 @@ where R.mask_execution_id=tmp_ergebnis.tid);\
\
-- update tmp_ergebnis set nextedit=trim(nextedit) || trim('&rs=' || \
--sp_get_keylist_str(<>::varchar(200),'groupinfo_id'::varchar(200),'user_group_bez'::varchar(200),'userinfo_id'::varchar(200),null,null); ) \
-/* update tmp_ergebnis set nextedit=nextedit || '&name=<>'; */ \
\
insert into tmp_ergebnis (ord,\
--tid,userinfo_id, benutzer,\
diff --git a/src-modules/module/qa/masken/37020_felderinfo.unl b/src-modules/module/qa/masken/37020_felderinfo.unl
index a1e44b6..13ead80 100644
--- a/src-modules/module/qa/masken/37020_felderinfo.unl
+++ b/src-modules/module/qa/masken/37020_felderinfo.unl
@@ -1,10 +1,10 @@
37020^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
37021^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy union select 2,'Fehler' from xdummy order by 1^^^
37022^Maske^20^0^0^150^80^1^integer^200^0^1^<> select tid,name from maskeninfo /*where tid in (select S.maskeninfo_id from maske_system_bez S where S.systeminfo_id=<>) */ order by 2;^^^
-37023^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^^^
+37023^Testfall-Name (Stichwort)^50^0^0^150^150^1^char^50^0^0^^^^
37024^Komponente^10^0^0^150^200^1^integer^200^0^1^<> select tid,name from systeminfo order by 2;^^^
37025^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<>select 1,'Ja' from xdummy^
37026^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<> select today()-3 from xdummy^
-37027^Testfall-Schlüssel^55^0^0^150^150^1^sql^50^0^0^^^^
+37027^Testfall-Schlüssel^55^0^0^150^150^1^char^50^0^0^^^^
37028^Projekt^15^0^0^150^80^1^integer^200^0^1^<> select tid,name from qa_project where active=1 /* and systeminfo_id=<> */ order by 2;^^^
37029^Testfall-Typ^1000^300^-1^170^150^1^integer^30^0^1^<> select 1,'Maskenausführung' from xdummy union select 2,'Datenbank-Test' from xdummy^^ ^
diff --git a/src-modules/module/qa/masken/37020_maskeninfo.unl b/src-modules/module/qa/masken/37020_maskeninfo.unl
index 490f932..8515dd4 100644
--- a/src-modules/module/qa/masken/37020_maskeninfo.unl
+++ b/src-modules/module/qa/masken/37020_maskeninfo.unl
@@ -36,15 +36,19 @@ E.name as execution_name,\
E.uniquename,\
E.systeminfo_id,\
''::char(255) as systeminfo_id_str,\
+''::varchar(255) as ticket_link,\
E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\
null::integer as dauer,\
-null::integer as result_value_min,\
-null::integer as result_value_max,\
+A.assert_result_value_min as result_value_min,\
+A.assert_result_value_max as result_value_max,\
null::varchar(255) as assert_caption,\
null::varchar(255) as assert_value_range,\
-null::varchar(255)[] as fields\
+null::varchar(255)[] as fields,\
+null::varchar(255) as nextedit,\
+null::varchar(255) as nextmask,\
+null::varchar(255) as nexttable\
"\
source="qa_mask_execution E, qa_mask_execution_result R inner join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"\
target="tmp_testcase">\
@@ -79,8 +83,8 @@ E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\
null::decimal(20,6) as dauer,\
-null::integer as result_value_min,\
-null::integer as result_value_max,\
+A.assert_result_value_min as result_value_min,\
+A.assert_result_value_max as result_value_max,\
null::varchar(255) as assert_caption,\
null::varchar(255) as assert_value_range,\
null::varchar(255)[] as fields, \
@@ -97,8 +101,8 @@ target="tmp_testcase">\
/* and E.maskeninfo_id=<> */\
/* and E.userinfo_id=<> */\
/* and E.systeminfo_id=<> */\
- /* and E.name ilike '%<>%' */\
- /* and E.uniquename ilike '%<>%' */\
+ /* and position(<> in E.name)>0 */\
+ /* and E.uniquename = <> */\
/* and date(R.execution_start) >= date_val(<>) */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<>) */\
/* and 1=<> */\
@@ -108,23 +112,16 @@ target="tmp_testcase">\
#if>\
\
<#if SQLdialect='Postgres'>\
-update tmp_testcase set result_value_min=A.result_value_min,\
-result_value_max=A.result_value_max,\
-assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) \
+update tmp_testcase set assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) \
from qa_mask_execution_assert A\
where A.tid=tmp_testcase.mask_execution_assert_id;\
<#else>\
--Informix Dialekt:\
-update tmp_testcase set (result_value_min,\
- result_value_max,\
- assert_caption) \
- = ((select \
- A.result_value_min,\
- A.result_value_max,\
+update tmp_testcase set assert_caption=(select \
nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)\
from qa_mask_execution_assert A\
where A.tid=tmp_testcase.mask_execution_assert_id\
-))\
+)\
where tmp_testcase.mask_execution_assert_id in (select A.tid\
from qa_mask_execution_assert A)\
;\
@@ -195,7 +192,8 @@ target="tmp_qa_dbtest">\
/* and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id=<>) */\
/* and E.userinfo_id=<> */\
/* and T.systeminfo_id=<> */\
- /* and T.name ilike '%<>%' */\
+ /* and position(<> in T.name)>0 */\
+ /* and T.uniquename = <> */\
/* and T.tid=<> */\
/* and 2=<> */\
@selectintotmp>\
diff --git a/src-modules/module/qa/masken/37040_maskeninfo.unl b/src-modules/module/qa/masken/37040_maskeninfo.unl
index 35495d9..8dedf35 100644
--- a/src-modules/module/qa/masken/37040_maskeninfo.unl
+++ b/src-modules/module/qa/masken/37040_maskeninfo.unl
@@ -19,8 +19,8 @@ E.systeminfo_id,\
E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\
-null::integer as result_value_min,\
-null::integer as result_value_max\
+A.assert_result_value_min as result_value_min,\
+A.assert_result_value_max as result_value_max\
"\
source="qa_mask_execution E, qa_mask_execution_result R left outer join qa_mask_execution_assert_result A on (A.mask_execution_result_id=R.tid)"\
target="tmp_qa_mask_execution">\
@@ -32,25 +32,6 @@ target="tmp_qa_mask_execution">\
@selectintotmp>\
<@informixnolog/>;\
\
-<#if SQLdialect='Postgres'>\
-update tmp_qa_mask_execution set result_value_min=A.result_value_min,\
-result_value_max=A.result_value_max\
-from qa_mask_execution_assert A\
-where A.tid=tmp_qa_mask_execution.mask_execution_assert_id;\
-<#else>\
---Informix Dialekt:\
-update tmp_qa_mask_execution set (result_value_min,\
- result_value_max) \
- = ((select \
- A.result_value_min,\
- A.result_value_max\
-from qa_mask_execution_assert A\
-where A.tid=tmp_qa_mask_execution.mask_execution_assert_id\
-))\
-where tmp_qa_mask_execution.mask_execution_assert_id in (select A.tid\
-from qa_mask_execution_assert A)\
-;\
-#if>\
\
update tmp_qa_mask_execution set result_status=2,\
result_status_str='Fehler'\
diff --git a/src-modules/module/qa/masken/37160_felderinfo.unl b/src-modules/module/qa/masken/37160_felderinfo.unl
deleted file mode 100644
index 55d699d..0000000
--- a/src-modules/module/qa/masken/37160_felderinfo.unl
+++ /dev/null
@@ -1,11 +0,0 @@
-37160^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
-37161^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy union select 2,'Fehler' from xdummy order by 1^^^
-37162^Projekt^20^0^0^150^80^1^integer^200^0^1^<> select tid,name from qa_project where active=1 /* and systeminfo_id=<> */ order by 2;^^^
-37163^Testfall-Name (Stichwort)^50^0^0^150^150^1^sql^50^0^0^^^^
-37164^Komponente^10^0^0^150^200^1^integer^200^0^1^<> select tid,name from systeminfo order by 2;^^^
-37165^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<>select 1,'Ja' from xdummy^
-37166^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<> select today()-3 from xdummy^
-37167^Testfall^100^0^0^150^200^1^integer^200^0^1^<> select T.tid,T.name from qa_testcase T where is_active=1 \
-/* and T.tid in (select P.testcase_id from qa_testcase2project P where P.project_id=<>) */ \
-/* and T.systeminfo_id=<> */\
-order by 2^ ^ ^
diff --git a/src-modules/module/qa/masken/37160_maske_system_bez.unl b/src-modules/module/qa/masken/37160_maske_system_bez.unl
deleted file mode 100644
index b71f856..0000000
--- a/src-modules/module/qa/masken/37160_maske_system_bez.unl
+++ /dev/null
@@ -1 +0,0 @@
-37160^260^
diff --git a/src-modules/module/qa/masken/37160_masken_felder_bez.unl b/src-modules/module/qa/masken/37160_masken_felder_bez.unl
deleted file mode 100644
index d7be957..0000000
--- a/src-modules/module/qa/masken/37160_masken_felder_bez.unl
+++ /dev/null
@@ -1,8 +0,0 @@
-37160^37160^
-37160^37161^
-37160^37162^
-37160^37163^
-37160^37164^
-37160^37165^
-37160^37166^
-37160^37167^
diff --git a/src-modules/module/qa/masken/37160_maskeninfo.unl b/src-modules/module/qa/masken/37160_maskeninfo.unl
deleted file mode 100644
index 345b01f..0000000
--- a/src-modules/module/qa/masken/37160_maskeninfo.unl
+++ /dev/null
@@ -1,126 +0,0 @@
-37160^Testfall-Protokoll^--Autor: D. Quathamer\
---Datum: 2.8.2019\
---Freemarker Template\
-<#include "SQL_lingua_franca"/>\
-<#include "SuperX_general"/>\
-\
-\
-<#assign resultValueNative="result_value::float" />\
-<#if SQLdialect='Postgres'>\
-<#assign resultValueNative="round(decval(replace(result_value,'.',',')),0) " />\
-#if>\
-\
-\
-<@selectintotmp \
-select="\
-T.tid,\
-T.name,\
-T.uniquename,\
-R.assertion_def_col_caption,\
-R.execution_start,\
-R.execution_end,\
-R.result_code,\
-R.result_value,\
-null::integer as result_status,\
-''::char(255) as result_status_str,\
-R.result_log,\
-T.systeminfo_id,\
-''::char(255) as systeminfo_id_str,\
-''::varchar(255) as ticket_link,\
-''::varchar(255) as nexttable,\
-R.mask_execution_result_id,\
-R.dbtest_result_id\
-"\
-source="qa_testcase T inner join qa_testcase_result R on (R.testcase_id=T.tid /* and date(R.execution_start) >= date_val(<>) */)"\
-target="tmp_qa_testcase">\
- where \
- 1=1\
- /* and T.is_active=<> */\
- /* and T.tid in (select P.testcase_id from qa_testcase2project P where P.project_id=<>) */\
- /* and T.userinfo_id=<> */\
- /* and T.systeminfo_id=<> */\
- /* and T.name ilike '%<>%' */\
- /* and T.tid=<> */\
- @selectintotmp>\
- <@informixnolog/>;\
-\
-update tmp_qa_testcase set ticket_link=P.issue_link || TP.issue_id\
-from qa_testcase2project TP, qa_project P\
-where TP.testcase_id=tmp_qa_testcase.tid\
-and P.tid=TP.project_id\
-;\
-\
-update tmp_qa_testcase set nexttable='37020&Result-ID=' || mask_execution_result_id\
-where mask_execution_result_id is not null;\
-update tmp_qa_testcase set nexttable='37100&Result-ID=' || dbtest_result_id\
-where dbtest_result_id is not null;\
-\
-\
-update tmp_qa_testcase set --result_status=1,\
-result_status_str='Warnung'\
- where result_code=1;\
-update tmp_qa_testcase set result_status=2,\
- result_status_str='Fehler'\
- where result_code is null;\
--- \
-update tmp_qa_testcase set \
- result_status_str='Erfolg'\
- where result_code=0\
- ;\
-\
-/* delete from tmp_qa_testcase where result_code not in ( <> ); */\
-\
-\
-update tmp_qa_testcase set systeminfo_id_str=(select name from systeminfo S\
-where S.tid=tmp_qa_testcase.systeminfo_id);\
-\
-select systeminfo_id_str,\
-name,\
-uniquename,\
-case when ticket_link !='' then 'Ticket|' || ticket_link else '' end as nextserverlink,\
-assertion_def_col_caption,\
-execution_start,\
-<#if SQLdialect='Postgres'>\
-round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,\
-<#else>\
-execution_end-execution_start as dauer,\
-#if>\
-result_value,\
-result_status_str,\
-nexttable\
-from tmp_qa_testcase\
-order by 1,2,3,4,5,6,7;^XIL List\
- drop_and_delete movable_columns sizable_columns horizontal_scrolling\
- white_space_color=COLOR_WHITE fixed_columns=2\
- min_heading_height=35\
-Column CID=0 heading_text="Komponente" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=20 text_size=100\
-Column CID=1 heading_text="Testfall" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=50 text_size=200\
-Column CID=1 heading_text="Testfall\\nSchlüssel" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=10 text_size=200\
-Column CID=1 heading_text="Ticket" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=10 text_size=200\
-Column CID=1 heading_text="Erwartung" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=20 text_size=200\
-Column CID=1 heading_text="Ausführungszeit\\nStart" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=10 text_size=200\
-Column CID=1 heading_text="Dauer\\n(Sek.)" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=10 text_size=200\
-Column CID=1 heading_text="Gefundener Wert" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=10 text_size=200\
-Column CID=1 heading_text="Ausführungsstatus" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=15 text_size=200\
-Column CID=1 heading_text="Details" center_heading\
- row_selectable col_selectable heading_platform readonly\
- width=15 text_size=200\
-@@@^^^Übersicht über das Laufzeitverhalten von Masken- und Datenbanktestfällen^drop table tmp_qa_testcase;^^1^440^360^0^1^^
diff --git a/src-modules/module/qa/masken/37160_sachgeb_maske_bez.unl b/src-modules/module/qa/masken/37160_sachgeb_maske_bez.unl
deleted file mode 100644
index 26da9bb..0000000
--- a/src-modules/module/qa/masken/37160_sachgeb_maske_bez.unl
+++ /dev/null
@@ -1 +0,0 @@
-260^37160^
diff --git a/src-modules/module/qa/qa_update.x b/src-modules/module/qa/qa_update.x
index 9c73f93..5968d9c 100755
--- a/src-modules/module/qa/qa_update.x
+++ b/src-modules/module/qa/qa_update.x
@@ -39,11 +39,12 @@ echo "qa-Update startet" >$QA_ERRORDAT
-runAndCheck.x $QA_PFAD/etl/mask_execution "qa_mask_execution.x" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "QA update$MANDANTID Masken"
+cd $WEBAPP/WEB-INF
+qa_mask_execution.x > $QA_PFAD/L_QA_update_Masken$MANDANTID.log 2>&1
runAndCheck.x $QA_PFAD "module_etl.x qa $QA_PFAD $QA_LOAD_PFAD" EXIT_ON_ERROR SEND_ERRORMAIL SEND_LOGMAIL "QA update$MANDANTID"
-cat etl/mask_execution/L_QA_update$MANDANTID.log >>$QA_PFAD/L_QA_update$MANDANTID.log
+cat $QA_PFAD/L_QA_update_Masken$MANDANTID.log >>$QA_PFAD/L_QA_update$MANDANTID.log
echo "---------------------------Beginn Prüfroutine-----------------------------------" >>$QA_ERRORDAT
-cat $QA_PFAD/L_QA_update$MANDANTID.log >>$QA_ERRORDAT
+#cat $QA_PFAD/L_QA_update$MANDANTID.log >>$QA_ERRORDAT
#cat $QA_PFAD/L_qa_Test$MANDANTID.log >>$QA_ERRORDAT
#pruefmail.x $QA_PFAD/L_qa_Test$MANDANTID.log $ERRORMAIL
@@ -71,7 +72,7 @@ else
if [ "$QA_LOGMAIL" != "" -a "$MAILPROG" != "" ]
then
echo "Masken-Ausführung Protokoll ausführen und versenden"
- $QA_PFAD/etl/mask_execution/mask_execution_mail.x >>$QA_ERRORDAT 2>&1
+ $SUPERX_DIR/db/bin/qa_tc_execution_mail.x >>$QA_ERRORDAT 2>&1
fi
fi
diff --git a/src-modules/module/qa/schluesseltabellen/dbtest_kern_userinfo_def.sql b/src-modules/module/qa/schluesseltabellen/dbtest_kern_userinfo_def.sql
new file mode 100644
index 0000000..47b47b1
--- /dev/null
+++ b/src-modules/module/qa/schluesseltabellen/dbtest_kern_userinfo_def.sql
@@ -0,0 +1,181 @@
+
+--freemarker template
+
+<#assign systeminfo_id=9 />
+<#assign sachgebiete_id=0 />
+
+
+<#assign projects= [
+{"uniquename":"kern_user",
+"name":"Kernmodul Benutzerverwaltung",
+"issue_link":"https://git.campussource.de/git/SuperX/qa/issues/"
+}
+ ] />
+
+<#assign resultsets = [
+{"uniquename":"userinfo",
+"name":"Benutzeraccounts",
+"fieldclause":"U.*",
+"fromclause":"userinfo U",
+"groupbyclause":"",
+"orderbyclause":""
+}
+ ] />
+
+<#assign dbtests = [
+ {
+ "project":"kern_user",
+ "uniquename":"kern_adminuser_exists",
+ "name":"Benutzeraccount mit Administrationsrechten existiert",
+ "resultset":"userinfo",
+ "whereclause":"benutzer=''admin''",
+ "description":"",
+ "issue_id":"1"
+ }
+
+ ] />
+
+ <#assign dbtest_assertions = [
+
+ {
+ "dbtest":"kern_adminuser_exists",
+ "rownr":"1",
+ "assertion_col": "benutzer",
+ "assertion_value": "adim",
+ "assertion_caption":"Admin-Account"
+ }
+ ] />
+
+
+--ab hier ist der Code immer gleich:
+<#foreach resultset in resultsets>
+insert into qa_resultset(
+ uniquename,
+ name,
+ systeminfo_id,
+ fromclause,
+ fieldclause,
+ groupbyclause,
+ orderbyclause)
+select
+'${resultset.uniquename}',
+'${resultset.name}',
+${systeminfo_id},
+'${resultset.fromclause}',
+'${resultset.fieldclause}',
+'${resultset.groupbyclause}',
+'${resultset.orderbyclause}'
+from xdummy
+where 0=(select count(*) from qa_resultset R
+where R.uniquename='${resultset.uniquename}'
+and R.systeminfo_id=${systeminfo_id})
+;
+#foreach>
+
+
+<#foreach project in projects>
+
+insert into qa_project(
+uniquename,
+ name,
+ systeminfo_id,
+ sachgebiete_id,
+ active,
+ issue_link,
+ created_at,
+ created_from
+)
+select
+'${project.uniquename}',
+'${project.name}',
+${systeminfo_id},
+${sachgebiete_id},
+1 as active,
+'${project.issue_link}',
+today(),
+1
+from xdummy
+where 0=(select count(*) from qa_project P
+where P.uniquename='${project.uniquename}'
+and P.systeminfo_id=${systeminfo_id});
+
+<#foreach dbtest in dbtests>
+<#if dbtest.project=project.uniquename>
+insert into qa_dbtest(
+uniquename,
+name,
+systeminfo_id,
+resultset_id,
+whereclause,
+description,
+active)
+ select '${dbtest.uniquename}',
+'${dbtest.name}',
+${systeminfo_id},
+(select R.tid from qa_resultset R where R.uniquename='${dbtest.resultset}'
+and R.systeminfo_id=${systeminfo_id}
+) as resultset_id,
+'${dbtest.whereclause}',
+'${dbtest.description}',
+1 as active
+FROM qa_project
+where uniquename= '${project.uniquename}'
+and systeminfo_id=${systeminfo_id}
+and 0=(select count(*) from qa_dbtest T
+where T.uniquename='${dbtest.uniquename}'
+and T.systeminfo_id=${systeminfo_id})
+;
+
+insert into qa_dbtest2project( dbtest_id,
+project_id,
+issue_id)
+ select T.tid,
+ P.tid,
+'${dbtest.issue_id}'
+ FROM qa_dbtest T,qa_project P
+ where T.uniquename='${dbtest.uniquename}'
+ and T.systeminfo_id=${systeminfo_id}
+ and P.uniquename= '${project.uniquename}'
+ and P.systeminfo_id=${systeminfo_id}
+ and 0=(select count(*) from qa_dbtest2project TP,
+ qa_dbtest T,qa_project P
+where T.uniquename='${dbtest.uniquename}'
+and T.systeminfo_id=${systeminfo_id}
+ and P.uniquename= '${project.uniquename}'
+ and P.systeminfo_id=${systeminfo_id}
+ and TP.project_id=P.tid
+ and TP.dbtest_id=T.tid)
+ ;
+<#foreach assertion in dbtest_assertions>
+<#if assertion.dbtest=dbtest.uniquename>
+insert into qa_dbtest_assertion(
+dbtest_id,
+ rownr,
+ def_col_caption,
+ def_col_name,
+ def_col_value
+ )
+select tid,
+${assertion.rownr},
+'${assertion.assertion_caption}',
+'${assertion.assertion_col}',
+'${assertion.assertion_value}'
+from qa_dbtest T
+where T.uniquename='${dbtest.uniquename}'
+and T.systeminfo_id=${systeminfo_id}
+and 0=(select count(*) from qa_dbtest_assertion A
+where A.dbtest_id=T.tid
+and A.rownr=${assertion.rownr}
+and A.def_col_name='${assertion.assertion_col}'
+);
+
+
+#if> --von assertion
+#foreach>
+
+
+
+#if> --von dbtest
+#foreach>
+#foreach>
+
diff --git a/src-modules/module/qa/schluesseltabellen/maskentest_kern_userinfo_def.sql b/src-modules/module/qa/schluesseltabellen/maskentest_kern_userinfo_def.sql
new file mode 100644
index 0000000..d5f11e4
--- /dev/null
+++ b/src-modules/module/qa/schluesseltabellen/maskentest_kern_userinfo_def.sql
@@ -0,0 +1,183 @@
+
+--freemarker template
+
+<#assign systeminfo_id=9 />
+<#assign sachgebiete_id=0 />
+
+
+<#assign projects= [
+{"uniquename":"kern_user",
+"name":"Kernmodul Benutzerverwaltung",
+"issue_link":"https://git.campussource.de/git/SuperX/qa/issues/"
+}
+ ] />
+
+
+<#assign mask_executions = [
+ {
+ "project":"kern_user",
+ "uniquename":"kern_adminuser_exists_mask",
+ "name":"Benutzeraccounts mit Administrationsrechten existieren",
+ "userinfo_id":"1",
+ "maskeninfo_id":"71050",
+ "description":"",
+ "issue_id":"1"
+ }
+
+ ] />
+<#assign mask_execution_fields = [
+ {
+ "mask_execution_uniquename":"kern_adminuser_exists_mask",
+ "felderinfo_id":"71053",
+ "field_value":"Admin"
+ }
+
+ ] />
+ <#assign mask_execution_assertions = [
+
+ {
+ "mask_execution_uniquename":"kern_adminuser_exists_mask",
+ "rownr":"1",
+ "colnr": "2",
+ "result_value_min": "1",
+ "result_value_max": "1000",
+ "assertion_caption":"Anzahl Admin-Accounts"
+ }
+ ] />
+
+
+--ab hier ist der Code immer gleich:
+
+
+<#foreach project in projects>
+
+insert into qa_project(
+uniquename,
+ name,
+ systeminfo_id,
+ sachgebiete_id,
+ active,
+ issue_link,
+ created_at,
+ created_from
+)
+select
+'${project.uniquename}',
+'${project.name}',
+${systeminfo_id},
+${sachgebiete_id},
+1 as active,
+'${project.issue_link}',
+today(),
+1
+from xdummy
+where 0=(select count(*) from qa_project P
+where P.uniquename='${project.uniquename}'
+and P.systeminfo_id=${systeminfo_id});
+
+<#foreach mask_execution in mask_executions>
+<#if mask_execution.project=project.uniquename>
+insert into qa_mask_execution(
+uniquename,
+name,
+systeminfo_id,
+userinfo_id,
+maskeninfo_id,
+--description,
+is_active)
+ select '${mask_execution.uniquename}',
+'${mask_execution.name}',
+${systeminfo_id},
+${mask_execution.userinfo_id},
+${mask_execution.maskeninfo_id},
+1 as active
+FROM qa_project
+where uniquename= '${project.uniquename}'
+and systeminfo_id=${systeminfo_id}
+and 0=(select count(*) from qa_mask_execution T
+where T.uniquename='${mask_execution.uniquename}'
+and T.systeminfo_id=${systeminfo_id})
+;
+
+insert into qa_mask_execution2project( mask_execution_id,
+project_id,
+issue_id)
+ select T.tid,
+ P.tid,
+'${mask_execution.issue_id}'
+ FROM qa_mask_execution T,qa_project P
+ where T.uniquename='${mask_execution.uniquename}'
+ and T.systeminfo_id=${systeminfo_id}
+ and P.uniquename= '${project.uniquename}'
+ and P.systeminfo_id=${systeminfo_id}
+ and 0=(select count(*) from qa_mask_execution2project TP,
+ qa_mask_execution T,qa_project P
+where T.uniquename='${mask_execution.uniquename}'
+and T.systeminfo_id=${systeminfo_id}
+ and P.uniquename= '${project.uniquename}'
+ and P.systeminfo_id=${systeminfo_id}
+ and TP.project_id=P.tid
+ and TP.mask_execution_id=T.tid)
+ ;
+
+<#foreach field in mask_execution_fields>
+<#if field.mask_execution_uniquename=mask_execution.uniquename>
+insert into qa_mask_field_sel(
+mask_execution_id,
+ felderinfo_id,
+ field_value,
+ is_active
+ )
+select tid,
+${field.felderinfo_id},
+'${field.field_value}',
+1 as is_active
+from qa_mask_execution T
+where T.uniquename='${mask_execution.uniquename}'
+and T.systeminfo_id=${systeminfo_id}
+and 0=(select count(*) from qa_mask_field_sel A
+where A.mask_execution_id=T.tid
+and A.felderinfo_id=${field.felderinfo_id}
+);
+
+
+#if> --von field
+#foreach>
+
+
+<#foreach assertion in mask_execution_assertions>
+<#if assertion.mask_execution_uniquename=mask_execution.uniquename>
+insert into qa_mask_execution_assert(
+ mask_execution_id,
+ rownr,
+ colnr,
+ result_value_min,
+ result_value_max,
+ is_active,
+ caption
+ )
+select tid,
+${assertion.rownr},
+${assertion.colnr},
+${assertion.result_value_min},
+${assertion.result_value_max},
+1 as is_active,
+'${assertion.assertion_caption}'
+from qa_mask_execution T
+where T.uniquename='${mask_execution.uniquename}'
+and T.systeminfo_id=${systeminfo_id}
+and 0=(select count(*) from qa_mask_execution_assert A
+where A.mask_execution_id=T.tid
+and A.rownr=${assertion.rownr}
+and A.colnr=${assertion.colnr});
+
+
+#if> --von assertion
+#foreach>
+
+
+
+#if> --von mask_execution
+#foreach>
+#foreach>
+
diff --git a/src-modules/module/qa/schluesseltabellen/qa_captions.unl b/src-modules/module/qa/schluesseltabellen/qa_captions.unl
new file mode 100644
index 0000000..e69de29
diff --git a/src/de/superx/qa/bin/QaTestcaseExecutor.java b/src/de/superx/qa/bin/QaTestcaseExecutor.java
new file mode 100644
index 0000000..fd800d2
--- /dev/null
+++ b/src/de/superx/qa/bin/QaTestcaseExecutor.java
@@ -0,0 +1,471 @@
+/*
+ * de.superx.qa - a package for controlling QA routines
+ * Copyright (C) 2023 Daniel Quathamer
+ *
+ * This package is licensed under the CampusSource License;
+ * http://www.campussource.de/org/license/
+ */
+package de.superx.qa.bin;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Properties;
+
+import org.jaxen.JaxenException;
+import org.jaxen.XPath;
+import org.jaxen.jdom.JDOMXPath;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.Namespace;
+import org.jdom.input.SAXBuilder;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.mock.web.MockServletConfig;
+
+import de.memtext.baseobjects.coll.NamedIdObjectList;
+import de.superx.bin.SxConnection;
+import de.superx.common.FieldContainer;
+import de.superx.common.Maske;
+import de.superx.common.SuperX_el;
+import de.superx.common.SxResultRow;
+import de.superx.common.SxResultSet;
+import de.superx.common.SxSqlHelper;
+import de.superx.common.SxUser;
+import de.superx.etl.EtlUtils;
+import de.superx.qa.util.GetOpts;
+import de.superx.sec.InputCheckRegistry;
+import de.superx.servlet.SuperXManager;
+import de.superx.servlet.SxPools;
+import de.superx.servlet.UserInitializer;
+import de.superx.util.PathAndFileUtils;
+import de.superx.util.SqlStringUtils;
+import net.sf.saxon.sxpath.XPathExpression;
+
+public class QaTestcaseExecutor {
+ private static String tcUniquename;
+ private static String systeminfoId;
+ private static String fieldSelCmdLine;
+ private static int maskExecutionId;
+ private static String maskeninfoId;
+ private static String userName, userAdmin;
+ private static int userId;
+ private static long starttime ;
+ private static long endtime ;
+ private static String mandantenID="default";
+ private static FieldContainer myFieldContainer;
+ private static Hashtable maskFields ;
+ private static String resultXml;
+ private static String resultLog;
+ private static String pathToDbProperties;
+ private static Connection myConnection;
+
+ public QaTestcaseExecutor() {
+ this.maskFields = new Hashtable();
+ }
+
+ private void init() throws SQLException
+ {
+
+
+
+ try {
+ myConnection = this.getConnection(pathToDbProperties);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if(myConnection==null)
+ throw new SQLException("No connection possible ");
+
+
+ //System.out.println("fieldSel:"+fieldSel);
+
+ System.out.println("inited");
+
+ }
+
+ private static Connection getConnection(String pathToDbProperties) throws Exception {
+ String myDefaultPropFile=PathAndFileUtils.getWebinfDirectory()+PathAndFileUtils.PATHSEP+"db.properties";
+ if(pathToDbProperties==null)
+ pathToDbProperties=myDefaultPropFile;
+ Connection myConnection;
+ SxConnection mySxConnection = null;
+ mySxConnection = new SxConnection();
+ mySxConnection.setPropfile(pathToDbProperties);
+
+ myConnection = mySxConnection.getConnection();
+
+
+
+ return myConnection;
+ }
+
+ public static void main(String[] args) {
+ String usage="usage: java de.superx.qa.bin.QaTestcaseExecutor -dbproperties:$DB_PROPERTIES -tc:abc -systeminfo_id:9 -params:TID=16000 (optional) -outfile:Ausgabedatei (optional)" ;
+ GetOpts.setOpts(args);
+
+ String isdrin = GetOpts.isAllRequiredOptionsPresent("-logger,-dbproperties");
+ if (isdrin != null) {
+
+ System.err.println(usage);
+ System.exit(1);
+ }
+ int returnCode=0;
+ int nrOfTestcases=0;
+ int nrOfSuccessfulTestcases=0;
+ pathToDbProperties = GetOpts.getValue("-dbproperties");
+ String tcUniquename="" ;
+ if (GetOpts.isPresent("-tc"))
+ tcUniquename= GetOpts.getValue("-tc");
+ String systeminfoId="";
+ if (GetOpts.isPresent("-systeminfo_id"))
+ systeminfoId= GetOpts.getValue("-systeminfo_id");
+ String loggerArg=GetOpts.getValue("-logger");
+
+
+ QaTestcaseExecutor myExec=new QaTestcaseExecutor(); //TODO:Mandantid
+
+ try {
+ myExec.init();
+ int[] myTestcases=getTestcases(tcUniquename,systeminfoId);
+ nrOfTestcases=myTestcases.length;
+ if(nrOfTestcases>0)
+ {
+ for (int tcNr = 0;tcNr < nrOfTestcases; tcNr++)
+ {
+ returnCode=executeTestcase(myTestcases[tcNr]);
+ if(returnCode==0)
+ nrOfSuccessfulTestcases++;
+ }
+ }
+ myConnection.close();
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+
+ e.printStackTrace();
+ System.err.println(e.toString());
+ System.exit(1);
+ }
+ System.out.println("Executed testcases:"+ nrOfTestcases+"; successful: "+nrOfSuccessfulTestcases);
+
+
+ System.exit(returnCode);
+
+ }
+
+ private static int[] getTestcases(String tcUniquename,String systeminfoId) throws Exception
+ {
+ //TODO_ Umlaute erlauben:
+ //if(!SqlStringUtils.checkValidKeyEntry(tcUniquename) || !SqlStringUtils.checkValidKeyEntry(systeminfoId))
+ // throw new Exception("Invalid Testcase "+tcUniquename);
+
+ String sql = ""
+ + "SELECT \n"
+ + "E.tid as mask_execution_id\n"
+ + "FROM qa_mask_execution E left outer join userinfo U\n"
+ + " on (U.tid=E.userinfo_id)"
+ + "where E.is_active=1";
+ if(!tcUniquename.equals(""))
+ sql +=" and E.uniquename ='"+tcUniquename+"'";
+ if(!systeminfoId.equals(""))
+ sql +=" and E.systeminfo_id="+systeminfoId;
+ sql +=" order by 1;";
+ SuperX_el el = new SuperX_el();
+ SxSqlHelper sh=new SxSqlHelper();
+
+ sh.execute(sql, myConnection, el);
+ if (el.getError_String() != null
+ && !el.getError_String().trim().equals(""))
+ throw new SQLException("\nProblem bei Testfall Sammlung DETAILS:" + "\n\n Meldung:"
+ + el.getError_String() + "\n sql:" + sql);
+ SxResultSet result= el.getResultSet();
+ int nrOfTestcases=result.size();
+ int[] testCases=new int[nrOfTestcases];
+
+ int rownr=0;
+ for (Iterator it = result.iterator(); it.hasNext();) {
+ SxResultRow row = (SxResultRow) it.next();
+ maskExecutionId=(int) row.get(0);
+ testCases[rownr]=maskExecutionId;
+ rownr++;
+ }
+
+ return testCases;
+
+ }
+ private static int executeTestcase(int maskExecutionId) throws Exception
+ {
+
+ int returnCode;
+ starttime = new java.util.Date().getTime() ;
+ String fieldSel="";
+ String felderinfoId="";
+ String felderinfoName="";
+ String fieldValue="";
+ String sql = ""
+ + "SELECT \n"
+ + "E.maskeninfo_id,"
+ + "E.userinfo_id as userid,"
+ + "U.benutzer as username,"
+ + "S.mask_execution_id,\n"
+ + "S.felderinfo_id,\n"
+ + "trim(F.name) as felderinfo_name,"
+ + "string_not_null(S.field_value) as field_value, \n"
+ + "U.administration "
+ + "FROM felderinfo F,qa_mask_field_sel S, qa_mask_execution E left outer join userinfo U\n"
+ + " on (U.tid=E.userinfo_id)"
+ + "where F.tid=S.felderinfo_id "
+ + "and E.tid=S.mask_execution_id\n"
+ + "and E.tid="+maskExecutionId+";";
+ SuperX_el el = new SuperX_el();
+ SxSqlHelper sh=new SxSqlHelper();
+
+ sh.execute(sql, myConnection, el);
+ if (el.getError_String() != null
+ && !el.getError_String().trim().equals(""))
+ throw new SQLException("\nProblem bei Testfall DETAILS:" + "\n\n Meldung:"
+ + el.getError_String() + "\n sql:" + sql);
+ SxResultSet result= el.getResultSet();
+ int rownr=0;
+ for (Iterator it = result.iterator(); it.hasNext();) {
+ rownr++;
+ SxResultRow row = (SxResultRow) it.next();
+ maskeninfoId=row.get(0).toString().trim();
+ userId=(int) row.get(1);
+ userName=row.get(2).toString().trim();
+ maskExecutionId=(int) row.get(3);
+ felderinfoId=row.get(4).toString().trim();
+ felderinfoName=row.get(5).toString().trim();
+ fieldValue=row.get(6).toString().trim();
+ userAdmin=row.get(7).toString().trim();
+ maskFields.put(felderinfoName,fieldValue);
+ }
+ System.out.println("Testcase "+ maskExecutionId+" initialized");
+ returnCode=executeMask();
+ endtime = new java.util.Date().getTime() ;
+ int maskExecutionResultId=saveExecutionResult(returnCode,resultLog);
+ if(returnCode ==0)
+ {
+ returnCode=checkAssertions(maskExecutionResultId);
+
+ }
+ else
+ throw new Exception("Testcase error in masc execution "+maskExecutionId);
+ return returnCode;
+ }
+ private static int executeMask()
+ {
+ int returnCode=0;
+ MockHttpServletRequest mock ;
+ MockHttpServletResponse mockResponse = new MockHttpServletResponse();
+ MockServletConfig mockServletConfig = new MockServletConfig();
+ SxUser user=null;
+ mock = new MockHttpServletRequest();
+ Enumeration fieldEnum = maskFields.keys();
+ while (fieldEnum.hasMoreElements()) {
+ String paramName = (String) fieldEnum.nextElement();
+ String paramVal= maskFields.get(paramName).toString();
+ mock.addParameter(paramName, paramVal);
+
+ }
+ try {
+ SuperXManager.initKettleEnv();
+ SxPools.init();
+ SxPools.get(mandantenID).init();
+ SxPools.get(mandantenID).initLogging(true);
+ SxPools.resetAllPools();
+
+ user = UserInitializer.initUser(mandantenID, userName, userId, userAdmin);
+
+ } catch (Exception e) {
+ System.err.println("Fehler beim Aufbau der Connection: " + e.toString());
+ System.exit(1);
+ }
+ Locale desiredLocale = new Locale(de.superx.util.SqlStringUtils.getEncoding());
+ SuperXManager.maxRows = 1000000;
+ Maske maske = null;
+ InputCheckRegistry.registerDefaultChecks();
+ try {
+ maske = new Maske(mandantenID, user, new Integer(maskeninfoId), desiredLocale);
+ /*NamedIdObjectList fields = maske.readFelderFromDb(user);
+ myFieldContainer = maske.getIndividualFields();
+ myFieldContainer.addAll(fields);*/
+ maske.setFieldDefaults(user, mock, true);
+ resultXml=getResultXml(mock, mockResponse, maske, user, desiredLocale);
+ System.out.println("resultXml Länge " + resultXml.length() + " für Maske " + maskeninfoId + " erzeugt");
+ } catch (Exception e) {
+ e.printStackTrace();
+ resultLog="Fehler beim Ausführen der Maske " + maskeninfoId + ": " + e.toString();
+ returnCode=1;
+ }
+
+ return returnCode;
+ }
+ private static int checkAssertions(int maskExecutionResultId) throws Exception
+ {
+ int resultCode=0;
+ int assertionId,assertionRownr,assertionColnr;
+ Double minVal,maxVal,foundVal=null;
+ String sql = "select "
+ +"tid,"
+ +"rownr,"
+ +"colnr,"
+ +"result_value_min,"
+ +"result_value_max"
+ +" from qa_mask_execution_assert"
+ + " where is_active=1"
+ +" and mask_execution_id="+maskExecutionId+";";
+
+
+ /*try {
+ myConnection = getConnection(pathToDbProperties);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }*/
+ if(myConnection==null)
+ throw new SQLException("No connection possible ");
+ SuperX_el el = new SuperX_el();
+ SxSqlHelper sh=new SxSqlHelper();
+
+ sh.execute(sql, myConnection, el);
+ if (el.getError_String() != null
+ && !el.getError_String().trim().equals(""))
+ throw new SQLException("\nProblem bei Testfall Assertion DETAILS:" + "\n\n Meldung:"
+ + el.getError_String() + "\n sql:" + sql);
+ SxResultSet result= el.getResultSet();
+ int rownr=0;
+ for (Iterator it = result.iterator(); it.hasNext();) {
+ rownr++;
+ SxResultRow row = (SxResultRow) it.next();
+ assertionId=(Integer) row.get(0);
+ assertionRownr=(Integer) row.get(1);
+ assertionColnr=(Integer) row.get(2);
+ minVal=(Double) row.get(3);
+ maxVal=(Double) row.get(4);
+ try {
+ foundVal=getValFromXml(assertionRownr,assertionColnr);
+ } catch (Exception e) {
+ System.err.println("Testfall ID " +maskExecutionId+" mit Maskennr. "+maskeninfoId+ " Assertion-ID "+assertionId+ " kein Ergebnis ");
+ }
+ if(foundVal != null && foundVal >=minVal && foundVal<=maxVal)
+ {
+ System.out.println("Testfall ID " +maskExecutionId+" mit Maskennr. "+maskeninfoId+ " Assertion-ID "+assertionId+ " erfolgreich");
+ }
+ else
+ {
+ resultCode=1;
+ System.out.println("Testfall ID " +maskExecutionId+" mit Maskennr. "+maskeninfoId+ " Assertion-ID "+assertionId+ " beendet mit Warnung/Fehler");
+ }
+ saveAssertResult(assertionId,maskExecutionResultId,foundVal,resultCode,minVal,maxVal);
+ }
+
+ //System.out.println("fieldSel:"+fieldSel);
+ //myConnection.close();
+ return resultCode;
+ }
+ private static void saveAssertResult(int maskExecutionAssertId,int maskExecutionResultId,Double resultValue,int resultCode,double minVal,double maxVal) throws SQLException
+ {
+ String sql="insert into qa_mask_execution_assert_result(mask_execution_assert_id, mask_execution_result_id, result_code, assert_result_value_min, assert_result_value_max";
+ if(resultValue==null)
+ sql+=") values(?,?,?,?,?)";
+ else
+ sql +=",result_value) values(?,?,?,?,?,?);";
+ PreparedStatement st=myConnection.prepareStatement(sql);
+ st.setInt(1,maskExecutionAssertId);
+ st.setInt(2,maskExecutionResultId);
+ st.setInt(3,resultCode);
+ st.setDouble(4, minVal);
+ st.setDouble(5, maxVal);
+ if(resultValue!=null)
+ st.setDouble(6, resultValue);
+
+ boolean executed= st.execute();
+
+ }
+ private static int saveExecutionResult(int maskExecutionResult,String log ) throws SQLException
+ {
+ int ret=0;
+ java.sql.Timestamp startTimeDate = new java.sql.Timestamp(starttime);
+ java.sql.Timestamp endTimeDate = new java.sql.Timestamp(endtime);
+ String sql="insert into qa_mask_execution_result(mask_execution_id, execution_start, execution_end, result_code,result_log,result_stream,result_stream_contenttype)";
+ sql +="values(?,?,?,?,?,?,?);";
+ PreparedStatement st=myConnection.prepareStatement(sql);
+ st.setInt(1,maskExecutionId);
+ st.setTimestamp(2, startTimeDate);
+ st.setTimestamp(3, endTimeDate);
+ st.setInt(4,maskExecutionResult);
+ st.setString(5,log);
+ //im Fehler/Warnungsfall Ergebnis speichern:
+ st.setString(6,resultXml);
+ st.setString(7,"text/xml");
+
+ boolean executed= st.execute();
+ //get generated tid:
+ sql="select currval('qa_mask_execution_result_tid_seq')::integer;";
+ SuperX_el el = new SuperX_el();
+ SxSqlHelper sh=new SxSqlHelper();
+ sh.execute(sql, myConnection, el);
+ SxResultSet result= el.getResultSet();
+ int rownr=0;
+ for (Iterator it = result.iterator(); it.hasNext();) {
+ rownr++;
+ SxResultRow row = (SxResultRow) it.next();
+ ret=(Integer) row.get(0);
+ }
+
+ return ret;
+
+ } private static Double getValFromXml(int assertionRownr,int assertionColnr) throws Exception
+ {
+ Double foundval = null;
+ SAXBuilder builder = new SAXBuilder();
+ Document doc = builder.build(new StringReader(resultXml));
+ Namespace ns = doc.getRootElement().getNamespace();
+ String xpathStr = "/ergebnisse/ergebnis/ergebniselement/sqlerg/row[@no="+(assertionRownr-1)+"]/col[@id="+(assertionColnr-1)+"]/wert";
+ XPath expression = new JDOMXPath(xpathStr);
+ Element myNode = (Element) expression.selectSingleNode(doc);
+ if(myNode==null)
+ return null;
+ else
+ {
+ String myNodeVal=myNode.getTextNormalize();
+ return foundval.parseDouble(myNodeVal);
+ }
+
+ }
+ private static String getResultXml(MockHttpServletRequest mock_par, MockHttpServletResponse mockResponse_par,
+ Maske maske, SxUser user_par, Locale desiredLocale) {
+ String currentXml_local = null;
+ maske.setMaxOffset(10000000);
+ maske.setReuseResult(false);
+ maske.resetTableStylesheet();
+ maske.setSelectedTableStylesheetFileAndContenttype("tabelle_xml.xsl");
+ maske.setDesiredContenttype("text/xml");
+ try {
+ currentXml_local = maske.runQuery(user_par, mock_par, null).toString();
+ resultLog=("Ausgabe Maskenprotokoll\n" + SuperXManager.activityLog.toString());
+ System.out.println("Maskenergebnis wird lokalisiert");
+ currentXml_local = SxPools.get(mandantenID).localize(currentXml_local, desiredLocale);
+
+ } catch (Exception e) {
+ resultLog="Fehler beim Erstellen des XML für Maske " + e.toString();
+ System.err.println("Fehler beim Erstellen des XML für Maske " + e.toString());
+ }
+ return currentXml_local;
+
+ }
+}
+
+
+
diff --git a/src/de/superx/qa/util/GetOpts.java b/src/de/superx/qa/util/GetOpts.java
new file mode 100644
index 0000000..6aa7047
--- /dev/null
+++ b/src/de/superx/qa/util/GetOpts.java
@@ -0,0 +1,155 @@
+package de.superx.qa.util;
+
+
+import java.util.StringTokenizer;
+
+/**
+ * Original von de.memtext.util.GetOpts,
+ * für Abwärtskompatibilität mit Kern 4.9/BI 2022.12
+ *
+ */
+public class GetOpts {
+ private static String[] arguments = null;
+
+ //don't instantiate
+ private GetOpts() {
+
+ }
+
+ /**
+ * If you pass the arguments you want to analyse to this static helper class
+ * using setOpts, you can later use the short form of the methods e.g.
+ * isPresent(String option) without having to pass the arguments again.
+ *
+ * @param args
+ */
+ public static void setOpts(String args[]) {
+ arguments = args;
+ }
+
+ /**
+ * checks if the arguments passed before by setOpts contain the given option
+ *
+ * @param String
+ * option
+ * @return true if arguments contain the option, i.e. one String which
+ * starts with the option-String
+ */
+ public static boolean isPresent(String option) {
+ if (arguments == null)
+ throw new IllegalStateException(
+ "must either use setOpts before or call the long version of this method");
+ return isPresent(arguments, option);
+ }
+
+ /**
+ * checks if the arguments contain the given option
+ *
+ * @param args
+ * @param String
+ * option
+ * @return true if arguments contain the option, i.e. one String which
+ * starts with the option-String
+ */
+ public static boolean isPresent(String args[], String option) {
+ boolean result = false;
+ for (int i = 0; i < args.length; i++)
+ if (args[i] != null && args[i].startsWith(option))
+ result = true;
+ return result;
+ }
+
+ /**
+ * Gets a named option from the arguments passed before with setOps. E.g.
+ * getOpt("--log") would return the "--log:true" in the arguments
+ *
+ * @param option -
+ * name/start of the option
+ * @return String whole option
+ */
+ public static String getOpt(String option) {
+ if (arguments == null)
+ throw new IllegalStateException(
+ "must either use setOpts before or call the long version of this method");
+ return getOpt(option, arguments);
+ }
+
+ /**
+ * Gets a named option from the arguments. E.g. getOpt("--log") would return
+ * the "--log:true" in the arguments
+ *
+ * @param option -
+ * name/start of the option
+ * @return String whole option
+ */
+ public static String getOpt(String option, String args[]) {
+ if (args == null)
+ throw new IllegalStateException("args must not be null");
+ String result = null;
+ for (int i = 0; i < args.length; i++)
+ if (args[i].startsWith(option))
+ result = args[i];
+ if (result == null)
+ throw new RuntimeException("Option " + option + " not found!");
+ return result;
+ }
+
+ /**
+ * Gets the value of an option from the arguments passed before with setOpts
+ * if for example, you ask getValue("--log:") and the arguments passed
+ * before with setOpts contain a String "--log:true") "true" is returned
+ *
+ * @param String
+ * option
+ * @return String value of the option
+ */
+ public static String getValue(String option) {
+ if (arguments == null)
+ throw new IllegalStateException(
+ "must either use setOpts before or call the long version of this method");
+ return getValue(option, arguments);
+ }
+
+ /**
+ * Gets the value of an option, if for example, you ask getValue("--log:")
+ * and the arguments passed before with setOpts contain a String
+ * "--log:true") "true" is returned
+ *
+ * @param String
+ * option
+ * @return String value of the option
+ */
+ public static String getValue(String option, String args[]) {
+ String result = "";
+ String raw = getOpt(option, args);
+ int pos = option.length();
+ if (raw.charAt(pos) == ':')
+ pos++;
+ result = raw.substring(pos, raw.length());
+ return result;
+ }
+
+ /**
+ * Prüft, ob alle notwendigen Optionen angegeben sind, z.B. String
+ * "-loggingProperties:,-dbProperties" übergeben, die beiden müssen dabei
+ * sein
+ *
+ * @param options
+ * z.B. "-loggingProperties:,-dbProperties,..."
+ * @return null - alles OK, ansonsten String mit den fehlenden Optionen
+ */
+ public static String isAllRequiredOptionsPresent(String options) {
+ String result = null;
+ StringTokenizer st = new StringTokenizer(options, ",");
+ for (; st.hasMoreTokens();) {
+ String optionName = st.nextToken();
+ if (!isPresent(optionName)) {
+ if (result == null)
+ result = optionName;
+ else
+ result += "," + optionName;
+ }
+ }
+ return result;
+ }
+}
diff --git a/superx/WEB-INF/conf/edustore/db/bin/qa_execute_mask.x b/superx/WEB-INF/conf/edustore/db/bin/qa_execute_mask.x
deleted file mode 100755
index e5b5e87..0000000
--- a/superx/WEB-INF/conf/edustore/db/bin/qa_execute_mask.x
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-# Zuerst SQL_ENV laden
-. /home/superx/db/bin/SQL_ENV
-
-# Verzeichnis in dem Die Dateien abgelegt werden sollen
-export FILE_DIR="$QA_PFAD"
-# Dateiname
-export FILE_NAME="Masken-Ausführung_Protokoll"
-# Masken TID
-export MASKEN_TID=37020
-# Datum für das Feld "Ab Datum"
-export DATUM_EXEC=$(date "+%d.%m.%Y")
-# Masken Parameter; Ausführungs-Status=1,2 (1=Warnung;2=Fehler)
-export MASK_PARAM="Ausführungs-Status=1,2&Ab Datum=${DATUM_EXEC}"
-
-# ExecuteMask funktioniert nur im WEB-INF Ordner
-cd $WEBAPP/WEB-INF
-
-# PDF
-java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.pdf -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/pdf" -logger:$SUPERX_DIR/db/conf/logging.properties
-
-# XML
-#java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.xml -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -logger:$SUPERX_DIR/db/conf/logging.properties
-
-# CSV
-java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.bin.ExecuteMask -tid:$MASKEN_TID -out:$FILE_DIR/$FILE_NAME.csv -user:admin "-params:${MASK_PARAM}&stylesheet=tabelle_fo_pdf.xsl&contenttype=text/csv" -logger:$SUPERX_DIR/db/conf/logging.properties
-
-# Verzeichnis in dem die Dateien abgelegt wurden. Zum zählen und verschicken.
-cd $FILE_DIR
-sed -i 's/\^/ \| /g' $FILE_DIR/$FILE_NAME.csv
-
-#Zuerst Warnungen und Fehler zählen
-export W_ANZ=$(grep -c Warnung $FILE_DIR/$FILE_NAME.csv)
-export F_ANZ=$(grep -c Fehler $FILE_DIR/$FILE_NAME.csv)
-
-#Mail Versand
-# Vor der Pipe kommt der Text, der als Nachricht verschickt werden soll
-# -r ist die ausgehende Mailadresse
-# -s ist Subjekt|Betreff
-# -a Datei für den Anhang
-# und am Ende noch Empfänger der Mail.
-cat $FILE_DIR/$FILE_NAME.csv | mailx -r superx@localhost -s "Masken-Ausführung Protokoll | $W_ANZ Warnungen | $F_ANZ Fehler" -a $FILE_DIR/$FILE_NAME.pdf "${LOGMAIL}"
diff --git a/superx/WEB-INF/conf/edustore/db/bin/qa_mask_execution.x b/superx/WEB-INF/conf/edustore/db/bin/qa_mask_execution.x
new file mode 100755
index 0000000..03e29a5
--- /dev/null
+++ b/superx/WEB-INF/conf/edustore/db/bin/qa_mask_execution.x
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+TC_UNIQUENAME=$1
+SYSTEMINFO=$2
+
+ARG1=""
+ARG2=""
+
+if [ "$TC_UNIQUENAME" != "" ] ; then
+ ARG1="-tc:$TC_UNIQUENAME"
+fi
+if [ "$SYSTEMINFO" != "" ] ; then
+ ARG2="-systeminfo_id:$SYSTEMINFO"
+fi
+
+java -cp "$JDBC_CLASSPATH" $JAVA_OPTS de.superx.qa.bin.QaTestcaseExecutor -logger:$SUPERX_DIR/db/conf/logging.properties -dbproperties:$DB_PROPERTIES "$ARG1" "$ARG2"
+
+
+
diff --git a/src-modules/module/qa/etl/mask_execution/mask_execution_mail.x b/superx/WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x
similarity index 97%
rename from src-modules/module/qa/etl/mask_execution/mask_execution_mail.x
rename to superx/WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x
index 8c44452..6bdb0ac 100755
--- a/src-modules/module/qa/etl/mask_execution/mask_execution_mail.x
+++ b/superx/WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x
@@ -1,7 +1,7 @@
#!/bin/bash
# Verzeichnis in dem Die Dateien abgelegt werden sollen
-FILE_DIR="$QA_PFAD/etl/mask_execution/tmp"
+FILE_DIR="$QA_PFAD/tmp"
mkdir -p $FILE_DIR
# Dateiname
diff --git a/superx/WEB-INF/lib/superx-qa.jar b/superx/WEB-INF/lib/superx-qa.jar
new file mode 100644
index 0000000..7ec9f0e
Binary files /dev/null and b/superx/WEB-INF/lib/superx-qa.jar differ