Modul Qualitätssicherung
http://www.superx-projekt.de/doku/qa_modul/index.htm
130 lines
3.5 KiB
130 lines
3.5 KiB
37140^Datenbank-Test ausführen^--Freemarker Template\ |
|
<#include "SQL_lingua_franca"/>\ |
|
<#include "SuperX_general"/>\ |
|
<sqlvars>\ |
|
\ |
|
<sqlvar name="qa_dbtests" type='hashsequence'>\ |
|
select \ |
|
F.uniquename as resultset_field_uniquename,\ |
|
F.name as resultset_field_name,\ |
|
R.fromclause,\ |
|
F.fieldclause,\ |
|
T.tid,\ |
|
T.uniquename,\ |
|
T.name,\ |
|
T.whereclause\ |
|
FROM qa_dbtest T, qa_resultset R, qa_resultset_field F\ |
|
where \ |
|
T.resultset_field_id=F.tid\ |
|
and R.tid=F.resultset_id\ |
|
and T.tid=<<DB-Test>>\ |
|
;\ |
|
\ |
|
</sqlvar>\ |
|
<sqlvar name="qa_dbtest_assertions" type='hashsequence'>\ |
|
select \ |
|
A.dbtest_id,\ |
|
A.tid,\ |
|
A.rownr ,\ |
|
A.def_col_caption,\ |
|
A.def_col_name,\ |
|
A.def_col_value\ |
|
FROM qa_dbtest_assertion A\ |
|
where A.dbtest_id=<<DB-Test>>\ |
|
;\ |
|
\ |
|
</sqlvar>\ |
|
</sqlvars>\ |
|
\ |
|
create temp table tmp_qa_dbtest_result_id\ |
|
(qa_dbtest_result_id integer);\ |
|
\ |
|
\ |
|
<#foreach dbtest in qa_dbtests>\ |
|
\ |
|
\ |
|
select now() as beginn\ |
|
into temp tmp_anfang;\ |
|
\ |
|
select ${dbtest.fieldclause}\ |
|
into temp tmp_rs\ |
|
from ${dbtest.fromclause}\ |
|
where ${dbtest.whereclause}\ |
|
;\ |
|
\ |
|
\ |
|
\ |
|
<#foreach dbtest_assertion in qa_dbtest_assertions>\ |
|
<#if dbtest_assertion.dbtest_id==dbtest.tid>\ |
|
\ |
|
insert into qa_dbtest_result(\ |
|
dbtest_id,\ |
|
dbtest_assertion_id,\ |
|
execution_start , \ |
|
execution_end , \ |
|
result_code , \ |
|
result_value )\ |
|
select \ |
|
<<DB-Test>>,\ |
|
${dbtest_assertion.tid},\ |
|
A.beginn,\ |
|
now(),\ |
|
case when T.${dbtest_assertion.def_col_name}='${dbtest_assertion.def_col_value}' 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\ |
|
on (1=${dbtest_assertion.rownr})\ |
|
;\ |
|
insert into tmp_qa_dbtest_result_id(qa_dbtest_result_id)\ |
|
<#if SQLdialect='Postgres'>\ |
|
select currval('qa_dbtest_result_tid_seq') from xdummy\ |
|
<#else>\ |
|
select max(tid) from qa_dbtest_result\ |
|
</#if>\ |
|
;\ |
|
\ |
|
</#if>\ |
|
</#foreach>\ |
|
drop table tmp_rs;\ |
|
drop table tmp_anfang;\ |
|
</#foreach>\ |
|
\ |
|
\ |
|
\ |
|
select R.dbtest_id,\ |
|
T.name,\ |
|
R.execution_start,\ |
|
R.execution_end,\ |
|
case when R.result_code=0 then 'Erfolg' else 'Warnung' end as result_str,\ |
|
R.result_value,\ |
|
'37100&DB-Test=' || T.tid as nexttable\ |
|
FROM qa_dbtest T, qa_dbtest_result R\ |
|
where T.tid=R.dbtest_id\ |
|
and T.tid=<<DB-Test>>\ |
|
and R.tid in (select qa_dbtest_result_id from tmp_qa_dbtest_result_id)\ |
|
order by 4 desc;^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="DB-Test ID" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
Column CID=0 heading_text="DB-Test Name" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=50 text_size=100\ |
|
Column CID=1 heading_text="DB-Test Start" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=150 text_size=200\ |
|
Column CID=1 heading_text="DB-Test Ende" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=150 text_size=200\ |
|
Column CID=1 heading_text="DB-Test Ergebnis" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=5 text_size=200\ |
|
Column CID=1 heading_text="DB-Test Ergebnis \\n Wert" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=5 text_size=200\ |
|
Column CID=1 heading_text="DB-Test \\nProtokoll" center_heading\ |
|
row_selectable col_selectable heading_platform readonly\ |
|
width=9 text_size=200\ |
|
@@@^^^Einen Datenbank-Test ausführen^drop table tmp_qa_dbtest_result_id;^^1^440^360^0^1^^
|
|
|