Skip to content

Commit 3288c3c

Browse files
committed
Generate junit xml in OpenJcePlusTests
Signed-off-by: Lan Xia <[email protected]>
1 parent 7ef1c75 commit 3288c3c

File tree

3 files changed

+62
-5
lines changed

3 files changed

+62
-5
lines changed

functional/OpenJcePlusTests/build.xml

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
</jar>
8585
<copy todir="${DEST}">
8686
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
87+
<fileset dir="${LIB_DIR}/" includes="junit4.jar" />
88+
<fileset dir="${LIB_DIR}/" includes="hamcrest-core.jar" />
89+
<fileset dir="${LIB_DIR}/" includes="bcprov-jdk18on.jar" />
8790
</copy>
8891
</target>
8992

functional/OpenJcePlusTests/playlist.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
<platform>^((?!(ppc64_aix|ppc64le_linux|x86-64_linux|x86-64_windows)).)*$</platform>
2626
</disable>
2727
</disables>
28-
<command>$(JAVA_COMMAND) $(JVM_OPTIONS) \
29-
-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) \
30-
--add-exports=java.base/sun.security.util=ALL-UNNAMED \
31-
--add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED \
32-
ibm.jceplus.junit.TestAll; \
28+
<command>ant -f ${BUILD_ROOT}/functional/OpenJcePlusTests/test.xml -DTEST_JAVA=$(Q)$(JAVA_COMMAND)$(Q) launch_test; \
3329
$(TEST_STATUS)</command>
3430
<levels>
3531
<level>extended</level>

functional/OpenJcePlusTests/test.xml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
# Licensed under the Apache License, Version 2.0 {the "License"};
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
-->
16+
17+
<project name="Launcher script for OpenJcePlusTests" default="help" basedir=".">
18+
<target name="help">
19+
<echo>Ant script to run the tests for ibm.jceplus.junit.TestAll.
20+
</echo>
21+
</target>
22+
23+
<target name="launch_test">
24+
<echo message="Running ibm.jceplus.junit.TestAll in ${user.dir}" />
25+
<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" />
26+
<mkdir dir="junitreports" />
27+
<java jvm="${TEST_JAVA}"
28+
classname="org.apache.tools.ant.launch.Launcher"
29+
fork="true"
30+
failonerror="true"
31+
dir="${basedir}"
32+
timeout="3600000"
33+
taskname="test">
34+
<classpath>
35+
<pathelement location="${ant.home}/lib/ant-launcher.jar" />
36+
</classpath>
37+
<jvmarg value="-showversion" />
38+
<arg value="-buildfile" />
39+
<arg file="${ant.file}" />
40+
<arg value="test" />
41+
</java>
42+
</target>
43+
<target name="test">
44+
<junit fork="yes" printsummary="on" showoutput="yes" haltonfailure="yes">
45+
<jvmarg line="--add-exports=java.base/sun.security.util=ALL-UNNAMED" />
46+
<jvmarg line="--add-exports=openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED" />
47+
<classpath>
48+
<pathelement location="junit4.jar" />
49+
<pathelement location="hamcrest-core.jar" />
50+
<pathelement location="bcprov-jdk18on.jar" />
51+
<pathelement location="openjceplus-tests.jar" />
52+
</classpath>
53+
<formatter type="xml" />
54+
<test name="ibm.jceplus.junit.TestAll" todir="junitreports"/>
55+
</junit>
56+
<echo message="ALL TESTS COMPLETED" />
57+
</target>
58+
</project>

0 commit comments

Comments
 (0)