Browse Source

Mask-Execution redesign in Java

qa_0.6_Release
Daniel Quathamer 1 year ago
parent
commit
0cd06fa48b
  1. 8
      .ant-targets-build.xml
  2. 189
      .classpath
  3. 1
      .gitignore
  4. 24
      .project
  5. 76
      build.xml
  6. 3
      src-modules/module/qa/conf/includes.txt
  7. 26
      src-modules/module/qa/conf/qa.xml
  8. 207
      src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql
  9. 7
      src-modules/module/qa/datentabellen/qa_mask_execution_result_purge.sql
  10. 4
      src-modules/module/qa/etl/mask_execution/execute_masks.sql
  11. 8
      src-modules/module/qa/masken/37000_felderinfo.unl
  12. 2
      src-modules/module/qa/masken/37000_masken_felder_bez.unl
  13. 6
      src-modules/module/qa/masken/37000_maskeninfo.unl
  14. 4
      src-modules/module/qa/masken/37020_felderinfo.unl
  15. 34
      src-modules/module/qa/masken/37020_maskeninfo.unl
  16. 23
      src-modules/module/qa/masken/37040_maskeninfo.unl
  17. 11
      src-modules/module/qa/masken/37160_felderinfo.unl
  18. 1
      src-modules/module/qa/masken/37160_maske_system_bez.unl
  19. 8
      src-modules/module/qa/masken/37160_masken_felder_bez.unl
  20. 126
      src-modules/module/qa/masken/37160_maskeninfo.unl
  21. 1
      src-modules/module/qa/masken/37160_sachgeb_maske_bez.unl
  22. 9
      src-modules/module/qa/qa_update.x
  23. 181
      src-modules/module/qa/schluesseltabellen/dbtest_kern_userinfo_def.sql
  24. 183
      src-modules/module/qa/schluesseltabellen/maskentest_kern_userinfo_def.sql
  25. 0
      src-modules/module/qa/schluesseltabellen/qa_captions.unl
  26. 471
      src/de/superx/qa/bin/QaTestcaseExecutor.java
  27. 155
      src/de/superx/qa/util/GetOpts.java
  28. 42
      superx/WEB-INF/conf/edustore/db/bin/qa_execute_mask.x
  29. 19
      superx/WEB-INF/conf/edustore/db/bin/qa_mask_execution.x
  30. 2
      superx/WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x
  31. BIN
      superx/WEB-INF/lib/superx-qa.jar

8
.ant-targets-build.xml

@ -0,0 +1,8 @@
all
call_module_scripts_create_ant
cleanBuildPath
compileSuperx
dist
distQA
initTimestamp
module_copy_source

189
.classpath

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/aopalliance-1.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/asm-3.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/aspectjrt-1.6.8.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/aspectjweaver-1.6.8.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/avalon-framework-4.2.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/batik-all-1.10.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/bliki-core-3.0.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/cewolf-0.10.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/cglib-2.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/cglib-nodep-2.2.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/clover-3.3.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-beanutils-1.8.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-collections4-4.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-dbcp-1.2.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-digester-1.7.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-el-1.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-fileupload-1.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-io-1.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-javaflow-20060411.jar.alt"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-lang3-3.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-lang3-3.4-javadoc.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-logging-api.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-math-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-pool-1.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-validator-1.0.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-vfs-1.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/commons-vfs2-2.1-20150824.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/connect.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/dbforms2.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/dsn.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/eigenbase-properties-1.1.0.10924.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/eigenbase-resgen-1.3.0.11873.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/eigenbase-xom-1.3.0.11999.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-core-annotations-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-core-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-jaxws-ri-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-jersey-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-spring3-app-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/enunciate-spring-jaxws-rt-1.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/fop-2.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/freemarker-2.3.25.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/groovy-all-2.3.6.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/guava-16.0.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/h2-1.4.181.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/hosu.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/hsqldb1.7.2sx.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/httpunit.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/ifxjdbc-4.50.4.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/imap.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/inspector.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/iText-2.1.7.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jackson-core-asl-1.9.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jackson-jaxrs-1.9.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jackson-mapper-asl-1.9.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jackson-xc-1.9.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jakarta-regexp-1.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/janino-2.5.16.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-chart-customizers-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-chart-themes-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-custom-visualization-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-fonts-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-functions-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-javaflow-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jasperreports-metadata-6.20.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/java_cup.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/javacc-5.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/javacup-10k.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxb-api-2.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxb-impl-2.2.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxen-1.1.6.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxws-api-2.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxws-rt-2.1.7.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jaxws-spring-1.8.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jcommon-1.0.15.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jdom-1.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jdom-2.0.6.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-core-1.11.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-server-1.11.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-servlet-1.11.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jersey-spring-1.11.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jettison-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jfor-0.7.2rc1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jfreechart-1.0.12.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jh.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jlfgr-1.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/joda-time-2.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/js-1.7R3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/JSAP-2.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jsr311-api-1.1.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jstl-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jug-lgpl-2.0.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/jxl-2.6.10.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/kettle-core-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/kettle-engine-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/libbase-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/liberation-fonts-jasperreports_extension.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/liberation-fonts-ttf.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/libformula-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-1.2-api-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-api-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/log4j-core-2.16.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/logkit-1.0.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/mail-1.4.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/mailapi.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/maven-findbugs-plugin-0.8.4.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/maven-sourceforge-plugin-1.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/maven-taglib-plugin-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/maxq-0.95dev.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/metastore-6.0.0.0-353.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/mimepull-1.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/mockito-all-1.10.19.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/mondrian-3.6-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/nekohtml-0.9.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/net.tascalate.javaflow.api-2.2.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/olap4j-1.2.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/olap4j-xmla-1.2.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/org-netbeans-core.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/oro-2.0.8.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/pl_generator.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-examples-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-excelant-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-ooxml-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-ooxml-schemas-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/poi-scratchpad-3.17.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/pop3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/postgresql-42.2.19.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/resolver-20050927.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saiku-service-2.5-excelpatch.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saiku-web-2.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saxon-he-10.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saxon-he-test-10.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/saxon-xqj-10.5.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/sdf_generator.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/sis_util.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/slf4j-api-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/slf4j-log4j12-1.6.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/smtp.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-aop-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-asm-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-beans-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-context-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-context-support-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-core-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-expression-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-jdbc-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-ldap-core-1.3.0.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-acl-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-config-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-core-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-ldap-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-taglibs-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-security-web-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-test-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-tx-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-web-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/spring-webmvc-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/stax-api-1.0.1.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/stax-ex-1.2.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/streambuffer-0.9.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/superx5.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/validation-api-1.0.0.GA.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/wstx-asl-3.2.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xalan2-6-0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xbean-spring-2.7.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xercesImpl-2.7.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xml-apis-1.3.04.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xml-apis-ext-1.3.04.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xmlbeans-2.3.0.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib/xmlgraphics-commons-2.3.jar"/>
<classpathentry kind="lib" path="/kern/superx/WEB-INF/lib_ext/servlet-api.jar"/>
<classpathentry kind="output" path="superx/WEB-INF/classes"/>
</classpath>

1
.gitignore vendored

@ -0,0 +1 @@
/classes/

24
.project

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>qa</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>superx-src</name>
<type>2</type>
<location>/home/superx/git/kern/src</location>
</link>
</linkedResources>
</projectDescription>

76
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: So erzeugen Sie dann ein SuperX-Paket:
ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
QA-JAR erzeugen:
ant -DWEBAPP=$WEBAPP distQA
ant -DWEBAPP=$WEBAPP cleanBuildPath
--> -->
<dirname file="${ant.file}" property="moduleCreateBaseDir" /> <dirname file="${ant.file}" property="moduleCreateBaseDir" />
<property name="BASE_DIR" value="${moduleCreateBaseDir}/../.." /> <dirname file="${ant.file.superx}" property="superxBuildBaseDir" />
<property name="distDir" location="${superxBuildBaseDir}/superx/WEB-INF/lib" />
<property name="BASE_DIR" value="." />
<property name="SUPERX_DIR" value="${WEBAPP}"/>
<property name="BUILD_PATH" value="${BASE_DIR}/superx/WEB-INF/classes"/>
<property name="SRC_DIR" value="${BASE_DIR}/src" />
<property name="WEBAPP" value="${MODULE_PATH}/../../../webserver/tomcat/webapps/superx" /> <property name="WEBAPP" value="${MODULE_PATH}/../../../webserver/tomcat/webapps/superx" />
<property name="qa_version" value="0.2b" />
<path id="classpath"> <path id="classpath">
<!--WEB-INF/lib--> <!--WEB-INF/lib-->
<fileset dir="${WEBAPP}/WEB-INF"> <fileset dir="${WEBAPP}/WEB-INF">
<include name="lib/**/*.jar" /> <include name="lib/**/*.jar" />
<include name="lib_ext/*.jar" />
<include name="classes" /> <include name="classes" />
</fileset> </fileset>
</path> </path>
<condition property="isWindoze"> <condition property="isWindoze">
<os family="windows" /> <os family="windows" />
@ -26,15 +43,24 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
<condition property="isUnix"> <condition property="isUnix">
<os family="unix" /> <os family="unix" />
</condition> </condition>
<target name="initTimestamp">
<tstamp>
<format property="SX_TIMESTAMP" pattern="dd.MM.yyyy HH:mm" />
</tstamp>
</target>
<target name="all" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum"> <target name="all" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum">
<antcall target="module_copy_source" /> <antcall target="module_copy_source" />
<antcall target="call_module_scripts_create_ant" /> <antcall target="call_module_scripts_create_ant" />
<antcall target="module_copy_webapp_files" />
</target> </target>
<target name="module_copy_source" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum"> <target name="module_copy_source" description="Gruppe: Kopiere Modul Sourcen in den WEB-INF-Verzeichnisbaum">
<echo message="Start module_copy_sources für Modul ${MODULE} in Pfad ${MODULE_PATH}" /> <echo message="Start module_copy_sources für Modul ${MODULE} in Pfad ${MODULE_PATH}" />
<copy todir="${MODULE_PATH}" overwrite="true"> <copy todir="${MODULE_PATH}" overwrite="true">
<fileset dir="${BASE_DIR}/src-modules/module/${MODULE}" /> <fileset dir="${BASE_DIR}/src-modules/module/${MODULE}" />
</copy> </copy>
<copy todir="${WEBAPP}/edit/qa" overwrite="true">
<fileset dir="${BASE_DIR}/superx/edit/${MODULE}" />
</copy>
</target> </target>
<target name="call_module_scripts_create_ant" description="Call to module_scripts_create_ant"> <target name="call_module_scripts_create_ant" description="Call to module_scripts_create_ant">
<subant target="all"> <subant target="all">
@ -47,6 +73,13 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
<fileset dir="${MODULE_PATH}/../../conf" includes="module_scripts_create_ant.xml" /> <fileset dir="${MODULE_PATH}/../../conf" includes="module_scripts_create_ant.xml" />
</subant> </subant>
</target> </target>
<target name="module_copy_webapp_files" description="Kopiere webapp-Dateien in den WEBAPP-Verzeichnisbaum">
<echo message="Start module_copy_webapp_files für Modul ${MODULE} in Pfad ${MODULE_PATH}" />
<copy todir="${WEBAPP}" overwrite="true">
<fileset dir="${BASE_DIR}/superx" />
</copy>
</target>
<target name="dist" description="Create Download package"> <target name="dist" description="Create Download package">
<subant target="erzeuge_paket"> <subant target="erzeuge_paket">
<!--<property name="basedir" value="${MODULE_PATH}/../../conf/" />--> <!--<property name="basedir" value="${MODULE_PATH}/../../conf/" />-->
@ -62,4 +95,45 @@ ant -DMODULE_PATH=$QA_PFAD -DWEBAPP_DIR=$WEBAPP -DMODULE=qa dist
<fileset dir="${MODULE_PATH}/../../conf" includes="build.xml" /> <fileset dir="${MODULE_PATH}/../../conf" includes="build.xml" />
</subant> </subant>
</target> </target>
<target name="distQA" depends="compileSuperx" description="Erzeugt die superx-qa.jar. ">
<delete>
<fileset dir="${distDir}" includes="superx-qa*.jar" />
</delete>
<jar destfile="${distDir}/superx-qa.jar" basedir="${BUILD_PATH}" includes="de/superx/qa/** de/superx/sxrest/**" excludes="freemarker/**/* com/**/* javax/**/* **/*.java">
<manifest>
<!-- Who is building this jar? -->
<attribute name="Built-By" value="superx"/>
<!-- Information about the program itself -->
<attribute name="Implementation-Date" value="${SX_TIMESTAMP}"/>
<attribute name="Implementation-Title" value="SuperX"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
</jar>
</target>
<target name="compileSuperx" depends="cleanBuildPath" description="Compile all classes for superx.">
<filter token="sxtimestamp" value="${SX_TIMESTAMP}" />
<filter token="version" value="${qa_version}" />
<!-- MB 13.8.2009 auch mitkompilieren <echo message="de/memtext/db/Servlet* weggelassen"/>-->
<copy todir="${BUILD_PATH}" filtering="false">
<fileset dir="${SRC_DIR}">
<include name="**/*.java" />
<include name="**/*.properties" />
<include name="**/*.gif" />
<include name="**/*.xml" />
</fileset>
</copy>
<echo message="bp:${BUILD_PATH}"/>
<javac source="1.8" target="1.8"
srcdir="${BUILD_PATH}"
destdir="${BUILD_PATH}"
listfiles="yes" encoding="UTF-8" debug="no" verbose="no">
<classpath refid="classpath" />
</javac>
</target>
<target name="cleanBuildPath" depends="initTimestamp" description="Löscht alle *.class-Dateien in WEB-INF/classes">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${BUILD_PATH}" includes="**/*.class,**/*.java" excludes="*.properties" />
</delete>
</target>
</project> </project>

3
src-modules/module/qa/conf/includes.txt

@ -1,2 +1,5 @@
doku/qa_modul/qa.html doku/qa_modul/qa.html
WEB-INF/conf/edustore/db/bin/SQL_ENV_qa.sam 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

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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> --> <!--<!DOCTYPE module SYSTEM "../../../conf/superx-module.dtd"> -->
<module name="qa" version="0.6b" sachgebiet_id="260" <module name="qa" version="0.6" sachgebiet_id="260"
sachgebiet="Qualitätssicherung" systeminfo_id="260" sachgebiet="Qualitätssicherung" systeminfo_id="260"
system="Qualitätssicherung" thema="Qualitätssicherung" thema_parent="Abfragen"> system="Qualitätssicherung" thema="Qualitätssicherung" thema_parent="Abfragen">
<database name="superx" version="3.0" system="superx"> <database name="superx" version="3.0" system="superx">
@ -213,6 +213,12 @@ notnull="true">
<column name="result_log" type="TEXT" size="" default="" description="Logdatei Ausführung" notnull="false"> <column name="result_log" type="TEXT" size="" default="" description="Logdatei Ausführung" notnull="false">
<comment></comment> <comment></comment>
</column> </column>
<column name="result_stream" type="TEXT" size="255" default="" notnull="false" description="Ausgabe">
<comment>CSV oder XML</comment>
</column>
<column name="result_stream_contenttype" type="VARCHAR" size="255" default="" notnull="false" description="Ausgabeformat">
<comment>HTML, Text, CSV oder XML</comment>
</column>
<!-- <!--
<column name="result_value" type="VARCHAR" size="255" default="" description="Rückgabewert" notnull="false"> <column name="result_value" type="VARCHAR" size="255" default="" description="Rückgabewert" notnull="false">
<comment></comment> <comment></comment>
@ -223,12 +229,7 @@ notnull="true">
<column name="result_errdesc" type="TEXT" size="255" default="" notnull="false" description="Fehlermeldung"> <column name="result_errdesc" type="TEXT" size="255" default="" notnull="false" description="Fehlermeldung">
<comment>Stacktrace</comment> <comment>Stacktrace</comment>
</column> </column>
<column name="result_stream" type="TEXT" size="255" default="" notnull="false" description="Ausgabe">
<comment>CSV oder XML</comment>
</column>
<column name="result_stream_contenttype" type="VARCHAR" size="255" default="" notnull="false" description="Ausgabeformat">
<comment>HTML, Text, CSV oder XML</comment>
</column>
--> -->
</columns> </columns>
<primaryKeys> <primaryKeys>
@ -306,6 +307,13 @@ notnull="true">
<column name="mask_execution_result_id" type="INTEGER" size="100" default="" notnull="false" description="ID der Berichtsausführung-Assertion" isKey="false"> <column name="mask_execution_result_id" type="INTEGER" size="100" default="" notnull="false" description="ID der Berichtsausführung-Assertion" isKey="false">
<comment>Test-ID</comment> <comment>Test-ID</comment>
</column> </column>
<column name="assert_result_value_min" type="FLOAT" size="255" default="" notnull="false" description="Erwartes Ergebnis (min)">
<comment>Untergrenze erwarteter Ergebniswert</comment>
</column>
<column name="assert_result_value_max" type="FLOAT" size="255" default="" notnull="false" description="Erwartes Ergebnis (max)">
<comment>Obergrenze erwarteter Ergebniswert</comment>
</column>
<column name="result_value" type="VARCHAR" size="255" default="" description="Rückgabewert" notnull="false"> <column name="result_value" type="VARCHAR" size="255" default="" description="Rückgabewert" notnull="false">
<comment></comment> <comment></comment>
</column> </column>
@ -766,7 +774,7 @@ parent="Qualitätssicherung">Abfragen zur Administration</thema>
<path>$QA_PFAD/masken</path> <path>$QA_PFAD/masken</path>
</src> </src>
</maske> </maske>
<maske tid="37020" name="Masken-Ausführung Protokoll" thema="Qualitätssicherung"> <maske tid="37020" name="Testfall-Protokoll" thema="Qualitätssicherung">
<description>Masken-Ausführung</description> <description>Masken-Ausführung</description>
<src> <src>
<path>$QA_PFAD/masken</path> <path>$QA_PFAD/masken</path>
@ -973,6 +981,8 @@ format="%s">
database=""/> database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_mask_execution_assert_result_code_setzen.sql" <nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_mask_execution_assert_result_code_setzen.sql"
database=""/> database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_mask_execution_result_purge.sql"
database=""/>
<nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_dbtest_ausfuehren.sql" <nativeaction sql="" scriptfile="$QA_PFAD/datentabellen/qa_dbtest_ausfuehren.sql"
database=""/> database=""/>
<nativeaction sql="update systeminfo set datum=today() where tid in (260)" scriptfile="" database=""/> <nativeaction sql="update systeminfo set datum=today() where tid in (260)" scriptfile="" database=""/>

207
src-modules/module/qa/datentabellen/qa_mask_execution_assert_result_code_setzen.sql

@ -21,7 +21,8 @@
<@selectintotmp <@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.tid,
R.mask_execution_id, R.mask_execution_id,
R.execution_start, R.execution_start,
@ -35,16 +36,22 @@ E.name as execution_name,
E.uniquename, E.uniquename,
E.systeminfo_id, E.systeminfo_id,
''::char(255) as systeminfo_id_str, ''::char(255) as systeminfo_id_str,
''::varchar(255) as ticket_link,
E.maskeninfo_id, E.maskeninfo_id,
''::char(255) as maskeninfo_id_str, ''::char(255) as maskeninfo_id_str,
A.mask_execution_assert_id, A.mask_execution_assert_id,
null::integer as result_value_min, null::integer as dauer,
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_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)" 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 -- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen
where where
E.tid=R.mask_execution_id E.tid=R.mask_execution_id
@ -56,7 +63,8 @@ and A.result_code is null
<@selectintotmp <@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.tid,
R.mask_execution_id, R.mask_execution_id,
R.execution_start, R.execution_start,
@ -70,18 +78,22 @@ E.name as execution_name,
E.uniquename, E.uniquename,
E.systeminfo_id, E.systeminfo_id,
''::char(255) as systeminfo_id_str, ''::char(255) as systeminfo_id_str,
''::varchar(255) as ticket_link,
E.maskeninfo_id, E.maskeninfo_id,
''::char(255) as maskeninfo_id_str, ''::char(255) as maskeninfo_id_str,
A.mask_execution_assert_id, A.mask_execution_assert_id,
null::integer as result_value_min, null::decimal(20,6) as dauer,
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_caption,
null::varchar(255) as assert_value_range,
null::varchar(255)[] as fields, null::varchar(255)[] as fields,
('' || E.maskeninfo_id || '&')::text as nextmask, ('' || 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)" 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 -- nested in selectinto muss die where Bedingung u. ggfs. group by etc kommen
where where
E.tid=R.mask_execution_id E.tid=R.mask_execution_id
@ -93,41 +105,34 @@ target="tmp_qa_mask_execution">
/* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */ /* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */
/* and date(R.execution_start) >= date_val(<<Ab Datum>>) */ /* and date(R.execution_start) >= date_val(<<Ab Datum>>) */
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */ /* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */
/* and R.tid=<<Result-ID>> */ /* and 1=<<Testfall-Typ>> */
</@selectintotmp> </@selectintotmp>
<@informixnolog/>; <@informixnolog/>;
</#if> </#if>
<#if SQLdialect='Postgres'> <#if SQLdialect='Postgres'>
update tmp_qa_mask_execution set result_value_min=A.result_value_min, update tmp_testcase set assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
result_value_max=A.result_value_max,
assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
from qa_mask_execution_assert A 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> <#else>
--Informix Dialekt: --Informix Dialekt:
update tmp_qa_mask_execution set (result_value_min, update tmp_testcase set assert_caption=(select
result_value_max,
assert_caption)
= ((select
A.result_value_min,
A.result_value_max,
nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)
from qa_mask_execution_assert A 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
)) )
where tmp_qa_mask_execution.mask_execution_assert_id in (select A.tid where tmp_testcase.mask_execution_assert_id in (select A.tid
from qa_mask_execution_assert A) from qa_mask_execution_assert A)
; ;
</#if> </#if>
update tmp_qa_mask_execution set result_status=2, update tmp_testcase set result_status=2,
result_status_str='Fehler' result_status_str='Fehler'
where result_code!=0; where result_code!=0;
update tmp_qa_mask_execution set result_status=0, update tmp_testcase set result_status=0,
result_status_str='Erfolg' result_status_str='Erfolg'
where result_code=0 where result_code=0
and ( 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' result_status_str='Warnung'
where result_status is null; 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(<<Ab Datum>>) */
/* and R.tid=<<Result-ID>> */
)"
target="tmp_qa_dbtest">
where
T.tid=A.dbtest_id
/* and T.active=<<Nur aktive>> */
/* and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id=<<Projekt>>) */
/* and E.userinfo_id=<<Benutzer/in>> */
/* and T.systeminfo_id=<<Komponente>> */
/* and T.name ilike '%<<Testfall-Name (Stichwort)>>%' */
/* and T.tid=<<DB-Test>> */
/* and 2=<<Testfall-Typ>> */
</@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 ( <<Ausführungs-Status>>) ; */
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> <#if inEtl>
update qa_mask_execution_assert_result set result_code=T.result_status 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 where T.qa_mask_execution_assert_result_tid=qa_mask_execution_assert_result.tid
and qa_mask_execution_assert_result.result_code is null; and qa_mask_execution_assert_result.result_code is null;
drop table tmp_qa_mask_execution; drop table tmp_testcase;
<#else> <#else>
/* delete from tmp_qa_mask_execution where result_status not in (<<Ausführungs-Status>>) ; */ /* delete from tmp_testcase where result_status not in (<<Ausführungs-Status>>) ; */
update tmp_qa_mask_execution set systeminfo_id_str=(select name from systeminfo S update tmp_testcase set systeminfo_id_str=(select name from systeminfo S
where S.tid=tmp_qa_mask_execution.systeminfo_id); where S.tid=tmp_testcase.systeminfo_id);
update tmp_qa_mask_execution set maskeninfo_id_str=(select name from maskeninfo M update tmp_testcase set maskeninfo_id_str=(select name from maskeninfo M
where M.tid=tmp_qa_mask_execution.maskeninfo_id); where M.tid=tmp_testcase.maskeninfo_id);
<#if SQLdialect='Postgres'> <#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 from qa_mask_field_sel S, felderinfo F
where S.felderinfo_id=F.tid where S.felderinfo_id=F.tid
and S.is_active=1 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; where fields is not null;
</#if> </#if>
@ -180,22 +299,18 @@ execution_name,
uniquename, uniquename,
maskeninfo_id_str, maskeninfo_id_str,
nextmask, nextmask,
ticket_link as nextserverlink,
execution_start, execution_start,
<#if SQLdialect='Postgres'> dauer,
round(extract(second from (execution_end-execution_start))::decimal,0)::integer as dauer,
<#else>
execution_end-execution_start as dauer,
</#if>
assert_caption, assert_caption,
result_value_min, assert_value_range,
result_value_max,
result_value, result_value,
result_status_str, result_status_str,
('37040&Ergebnis=' || tid)::varchar(255) as nexttable nexttable
<#if UserIsAdmin> <#if UserIsAdmin>
,nextedit ,nextedit
</#if> </#if>
from tmp_qa_mask_execution from tmp_testcase
order by 1,2,3,4,5,6,7; order by 1,2,3,4,5,6,7;
</#if> </#if>

7
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;

4
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; 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} 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 -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 -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 ${shebang} DOSQL tmp_mask_assertion_result.sql
</#if> </#if>
</#foreach> </#foreach>

8
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^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^ 37000^Benutzer/in^150^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
37001^Testfall-Schlüssel^10^0^0^150^150^1^sql^50^0^0^^^^ 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^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^ 37002^Projekt^10^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ 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^<<SQL>> select tid,name from systeminfo order by 2;^^^ 37004^Komponente^1^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^^^
37005^Maske^40^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,tid || ' - ' || name from maskeninfo /*where tid in (select S.maskeninfo_id from maske_system_bez S where S.systeminfo_id=<<Komponente>>) */ order by name;^^^
37006^Testfall-Nr.^30^0^0^150^150^1^integer^50^0^0^^^^

2
src-modules/module/qa/masken/37000_masken_felder_bez.unl

@ -3,3 +3,5 @@
37000^37002^ 37000^37002^
37000^37003^ 37000^37003^
37000^37004^ 37000^37004^
37000^37005^
37000^37006^

6
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)\ on (U.tid=E.userinfo_id)\
where M.tid=E.maskeninfo_id\ where M.tid=E.maskeninfo_id\
/* and E.userinfo_id=<<Benutzer/in>> */\ /* and E.userinfo_id=<<Benutzer/in>> */\
/* and E.name ilike '%<<Name>>%' */\ /* and position(<<Name>> in E.name)>0 */\
/* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */\ /* and position(<<Testfall-Schlüssel>> in E.uniquename)>0 */\
/* and E.tid = <<Testfall-Nr.>> */\
/* and E.systeminfo_id=<<Komponente>> */\ /* and E.systeminfo_id=<<Komponente>> */\
/* and E.maskeninfo_id=<<Maske>> */\ /* and E.maskeninfo_id=<<Maske>> */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\ /* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\
@ -67,7 +68,6 @@ where R.mask_execution_id=tmp_ergebnis.tid);\
\ \
-- update tmp_ergebnis set nextedit=trim(nextedit) || trim('&rs=' || \ -- update tmp_ergebnis set nextedit=trim(nextedit) || trim('&rs=' || \
--sp_get_keylist_str(<<Gruppe>>::varchar(200),'groupinfo_id'::varchar(200),'user_group_bez'::varchar(200),'userinfo_id'::varchar(200),null,null); ) \ --sp_get_keylist_str(<<Gruppe>>::varchar(200),'groupinfo_id'::varchar(200),'user_group_bez'::varchar(200),'userinfo_id'::varchar(200),null,null); ) \
/* update tmp_ergebnis set nextedit=nextedit || '&name=<<Name>>'; */ \
\ \
insert into tmp_ergebnis (ord,\ insert into tmp_ergebnis (ord,\
--tid,userinfo_id, benutzer,\ --tid,userinfo_id, benutzer,\

4
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^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^ 37020^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
37021^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<<SQL>> select 0,'Erfolgreich' from xdummy union select 1,'Warnung' from xdummy union select 2,'Fehler' from xdummy order by 1^^^ 37021^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<<SQL>> 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^<<SQL>> select tid,name from maskeninfo /*where tid in (select S.maskeninfo_id from maske_system_bez S where S.systeminfo_id=<<Komponente>>) */ order by 2;^^^ 37022^Maske^20^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,name from maskeninfo /*where tid in (select S.maskeninfo_id from maske_system_bez S where S.systeminfo_id=<<Komponente>>) */ 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^<<SQL>> select tid,name from systeminfo order by 2;^^^ 37024^Komponente^10^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,name from systeminfo order by 2;^^^
37025^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<<SQL>>select 1,'Ja' from xdummy^ 37025^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<<SQL>>select 1,'Ja' from xdummy^
37026^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<<SQL>> select today()-3 from xdummy^ 37026^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<<SQL>> 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^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^ 37028^Projekt^15^0^0^150^80^1^integer^200^0^1^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ order by 2;^^^
37029^Testfall-Typ^1000^300^-1^170^150^1^integer^30^0^1^<<SQL>> select 1,'Maskenausführung' from xdummy union select 2,'Datenbank-Test' from xdummy^^ ^ 37029^Testfall-Typ^1000^300^-1^170^150^1^integer^30^0^1^<<SQL>> select 1,'Maskenausführung' from xdummy union select 2,'Datenbank-Test' from xdummy^^ ^

34
src-modules/module/qa/masken/37020_maskeninfo.unl

@ -36,15 +36,19 @@ E.name as execution_name,\
E.uniquename,\ E.uniquename,\
E.systeminfo_id,\ E.systeminfo_id,\
''::char(255) as systeminfo_id_str,\ ''::char(255) as systeminfo_id_str,\
''::varchar(255) as ticket_link,\
E.maskeninfo_id,\ E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\ ''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\ A.mask_execution_assert_id,\
null::integer as dauer,\ null::integer as dauer,\
null::integer as result_value_min,\ A.assert_result_value_min as result_value_min,\
null::integer as result_value_max,\ A.assert_result_value_max as result_value_max,\
null::varchar(255) as assert_caption,\ null::varchar(255) as assert_caption,\
null::varchar(255) as assert_value_range,\ 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)"\ 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">\ target="tmp_testcase">\
@ -79,8 +83,8 @@ E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\ ''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\ A.mask_execution_assert_id,\
null::decimal(20,6) as dauer,\ null::decimal(20,6) as dauer,\
null::integer as result_value_min,\ A.assert_result_value_min as result_value_min,\
null::integer as result_value_max,\ A.assert_result_value_max as result_value_max,\
null::varchar(255) as assert_caption,\ null::varchar(255) as assert_caption,\
null::varchar(255) as assert_value_range,\ null::varchar(255) as assert_value_range,\
null::varchar(255)[] as fields, \ null::varchar(255)[] as fields, \
@ -97,8 +101,8 @@ target="tmp_testcase">\
/* and E.maskeninfo_id=<<Maske>> */\ /* and E.maskeninfo_id=<<Maske>> */\
/* and E.userinfo_id=<<Benutzer/in>> */\ /* and E.userinfo_id=<<Benutzer/in>> */\
/* and E.systeminfo_id=<<Komponente>> */\ /* and E.systeminfo_id=<<Komponente>> */\
/* and E.name ilike '%<<Testfall-Name (Stichwort)>>%' */\ /* and position(<<Testfall-Name (Stichwort)>> in E.name)>0 */\
/* and E.uniquename ilike '%<<Testfall-Schlüssel>>%' */\ /* and E.uniquename = <<Testfall-Schlüssel>> */\
/* and date(R.execution_start) >= date_val(<<Ab Datum>>) */\ /* and date(R.execution_start) >= date_val(<<Ab Datum>>) */\
/* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\ /* and E.tid in (select P.mask_execution_id from qa_mask_execution2project P where P.project_id=<<Projekt>>) */\
/* and 1=<<Testfall-Typ>> */\ /* and 1=<<Testfall-Typ>> */\
@ -108,23 +112,16 @@ target="tmp_testcase">\
</#if>\ </#if>\
\ \
<#if SQLdialect='Postgres'>\ <#if SQLdialect='Postgres'>\
update tmp_testcase set result_value_min=A.result_value_min,\ update tmp_testcase set assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) \
result_value_max=A.result_value_max,\
assert_caption=coalesce(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr) \
from qa_mask_execution_assert A\ from qa_mask_execution_assert A\
where A.tid=tmp_testcase.mask_execution_assert_id;\ where A.tid=tmp_testcase.mask_execution_assert_id;\
<#else>\ <#else>\
--Informix Dialekt:\ --Informix Dialekt:\
update tmp_testcase set (result_value_min,\ update tmp_testcase set assert_caption=(select \
result_value_max,\
assert_caption) \
= ((select \
A.result_value_min,\
A.result_value_max,\
nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)\ nvl(A.caption,'Zeile ' || A.rownr || ' Spalte ' || A.colnr)\
from qa_mask_execution_assert A\ from qa_mask_execution_assert A\
where A.tid=tmp_testcase.mask_execution_assert_id\ where A.tid=tmp_testcase.mask_execution_assert_id\
))\ )\
where tmp_testcase.mask_execution_assert_id in (select A.tid\ where tmp_testcase.mask_execution_assert_id in (select A.tid\
from qa_mask_execution_assert A)\ 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=<<Projekt>>) */\ /* and T.tid in (select P.dbtest_id from qa_dbtest2project P where P.project_id=<<Projekt>>) */\
/* and E.userinfo_id=<<Benutzer/in>> */\ /* and E.userinfo_id=<<Benutzer/in>> */\
/* and T.systeminfo_id=<<Komponente>> */\ /* and T.systeminfo_id=<<Komponente>> */\
/* and T.name ilike '%<<Testfall-Name (Stichwort)>>%' */\ /* and position(<<Testfall-Name (Stichwort)>> in T.name)>0 */\
/* and T.uniquename = <<Testfall-Schlüssel>> */\
/* and T.tid=<<DB-Test>> */\ /* and T.tid=<<DB-Test>> */\
/* and 2=<<Testfall-Typ>> */\ /* and 2=<<Testfall-Typ>> */\
</@selectintotmp>\ </@selectintotmp>\

23
src-modules/module/qa/masken/37040_maskeninfo.unl

@ -19,8 +19,8 @@ E.systeminfo_id,\
E.maskeninfo_id,\ E.maskeninfo_id,\
''::char(255) as maskeninfo_id_str,\ ''::char(255) as maskeninfo_id_str,\
A.mask_execution_assert_id,\ A.mask_execution_assert_id,\
null::integer as result_value_min,\ A.assert_result_value_min as result_value_min,\
null::integer as result_value_max\ 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)"\ 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_qa_mask_execution">\
@ -32,25 +32,6 @@ target="tmp_qa_mask_execution">\
</@selectintotmp>\ </@selectintotmp>\
<@informixnolog/>;\ <@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,\ update tmp_qa_mask_execution set result_status=2,\
result_status_str='Fehler'\ result_status_str='Fehler'\

11
src-modules/module/qa/masken/37160_felderinfo.unl

@ -1,11 +0,0 @@
37160^Benutzer/in^60^0^0^150^200^1^integer^200^0^1^<<SQL>> select tid,nvl(name,benutzer) from userinfo order by 2;^^^
37161^Ausführungs-Status^0^0^0^150^80^10^integer^200^0^1^<<SQL>> 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^<<SQL>> select tid,name from qa_project where active=1 /* and systeminfo_id=<<Komponente>> */ 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^<<SQL>> select tid,name from systeminfo order by 2;^^^
37165^Nur aktive^30^0^0^150^80^1^integer^200^0^1^<<SQL>> select 1,'Ja' from xdummy union select 0,'nein' from xdummy order by 1 desc;^^<<SQL>>select 1,'Ja' from xdummy^
37166^Ab Datum^40^0^0^150^80^1^date^200^0^0^ ^^<<SQL>> select today()-3 from xdummy^
37167^Testfall^100^0^0^150^200^1^integer^200^0^1^<<SQL>> 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=<<Projekt>>) */ \
/* and T.systeminfo_id=<<Komponente>> */\
order by 2^ ^ ^

1
src-modules/module/qa/masken/37160_maske_system_bez.unl

@ -1 +0,0 @@
37160^260^

8
src-modules/module/qa/masken/37160_masken_felder_bez.unl

@ -1,8 +0,0 @@
37160^37160^
37160^37161^
37160^37162^
37160^37163^
37160^37164^
37160^37165^
37160^37166^
37160^37167^

126
src-modules/module/qa/masken/37160_maskeninfo.unl

@ -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(<<Ab Datum>>) */)"\
target="tmp_qa_testcase">\
where \
1=1\
/* and T.is_active=<<Nur aktive>> */\
/* and T.tid in (select P.testcase_id from qa_testcase2project P where P.project_id=<<Projekt>>) */\
/* and T.userinfo_id=<<Benutzer/in>> */\
/* and T.systeminfo_id=<<Komponente>> */\
/* and T.name ilike '%<<Testfall-Name (Stichwort)>>%' */\
/* and T.tid=<<Testfall>> */\
</@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 ( <<Ausführungs-Status>> ); */\
\
\
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^^

1
src-modules/module/qa/masken/37160_sachgeb_maske_bez.unl

@ -1 +0,0 @@
260^37160^

9
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" 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 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 #cat $QA_PFAD/L_qa_Test$MANDANTID.log >>$QA_ERRORDAT
#pruefmail.x $QA_PFAD/L_qa_Test$MANDANTID.log $ERRORMAIL #pruefmail.x $QA_PFAD/L_qa_Test$MANDANTID.log $ERRORMAIL
@ -71,7 +72,7 @@ else
if [ "$QA_LOGMAIL" != "" -a "$MAILPROG" != "" ] if [ "$QA_LOGMAIL" != "" -a "$MAILPROG" != "" ]
then then
echo "Masken-Ausführung Protokoll ausführen und versenden" 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
fi fi

181
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>

183
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>

0
src-modules/module/qa/schluesseltabellen/qa_captions.unl

471
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 <danielq@memtext.de>
*
* 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<String, String> 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;
}
}

155
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;
}
}

42
superx/WEB-INF/conf/edustore/db/bin/qa_execute_mask.x

@ -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}"

19
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"

2
src-modules/module/qa/etl/mask_execution/mask_execution_mail.x → superx/WEB-INF/conf/edustore/db/bin/qa_tc_execution_mail.x

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Verzeichnis in dem Die Dateien abgelegt werden sollen # 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 mkdir -p $FILE_DIR
# Dateiname # Dateiname

BIN
superx/WEB-INF/lib/superx-qa.jar

Binary file not shown.
Loading…
Cancel
Save