Skip to content

Commit

Permalink
Generate junit xml in OpenJcePlusTests
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Xia <[email protected]>
  • Loading branch information
llxia committed Feb 5, 2024
1 parent 7ef1c75 commit e8eeeec
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
5 changes: 4 additions & 1 deletion functional/OpenJcePlusTests/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
</jar>
<copy todir="${DEST}">
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
<fileset dir="${LIB_DIR}/" includes="junit4.jar" />
<fileset dir="${LIB_DIR}/" includes="hamcrest-core.jar" />
<fileset dir="${LIB_DIR}/" includes="bcprov-jdk18on.jar" />
</copy>
</target>

Expand Down Expand Up @@ -114,4 +117,4 @@
</if>

</target>
</project>
</project>
6 changes: 1 addition & 5 deletions functional/OpenJcePlusTests/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
<platform>^((?!(ppc64_aix|ppc64le_linux|x86-64_linux|x86-64_windows)).)*$</platform>
</disable>
</disables>
<command>$(JAVA_COMMAND) $(JVM_OPTIONS) \
-cp $(Q)$(LIB_DIR)$(D)junit4.jar$(P)$(LIB_DIR)$(D)hamcrest-core.jar$(P)$(LIB_DIR)$(D)bcprov-jdk18on.jar$(P)$(TEST_RESROOT)$(D)openjceplus-tests.jar$(Q) \
--add-exports=java.base/sun.security.util=ALL-UNNAMED \
--add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED \
ibm.jceplus.junit.TestAll; \
<command>ant -f ${BUILD_ROOT}/functional/OpenJcePlusTests/test.xml -DTEST_JAVA=$(Q)$(JAVA_COMMAND)$(Q) launch_test; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
Expand Down
57 changes: 57 additions & 0 deletions functional/OpenJcePlusTests/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>

<!--
# Licensed under the Apache License, Version 2.0 {the "License"};
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->

<project name="Launcher script for OpenJcePlusTests" default="help" basedir=".">
<target name="help">
<echo>Ant script to run the tests for ibm.jceplus.junit.TestAll.
</echo>
</target>

<target name="launch_test">
<echo message="Running ibm.jceplus.junit.TestAll in ${user.dir}" />
<echo message="Command: ${TEST_JAVA} -cp junit4.jar:hamcrest-core.jar:bcprov-jdk18on.jar:openjceplus-tests.jar --add-exports=java.base/sun.security.util=ALL-UNNAMED --add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED ibm.jceplus.junit.TestAll" />
<mkdir dir="junitreports" />
<java jvm="${TEST_JAVA}"
classname="org.apache.tools.ant.launch.Launcher"
fork="true"
failonerror="true"
dir="${basedir}"
taskname="test">
<classpath>
<pathelement location="${ant.home}/lib/ant-launcher.jar" />
</classpath>
<jvmarg value="-showversion" />
<arg value="-buildfile" />
<arg file="${ant.file}" />
<arg value="test" />
</java>
</target>
<target name="test">
<junit fork="yes" printsummary="on" showoutput="yes" haltonfailure="yes">
<jvmarg line="--add-exports=java.base/sun.security.util=ALL-UNNAMED" />
<jvmarg line="--add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED" />
<classpath>
<pathelement location="junit4.jar" />
<pathelement location="hamcrest-core.jar" />
<pathelement location="bcprov-jdk18on.jar" />
<pathelement location="openjceplus-tests.jar" />
</classpath>
<formatter type="xml" />
<test name="ibm.jceplus.junit.TestAll" todir="junitreports"/>
</junit>
<echo message="ALL TESTS COMPLETED" />
</target>
</project>

0 comments on commit e8eeeec

Please sign in to comment.