Skip to content

Commit 575f6fa

Browse files
committed
Add OpenJcePlusTests
Signed-off-by: Lan Xia <[email protected]>
1 parent 557cd90 commit 575f6fa

File tree

3 files changed

+166
-1
lines changed

3 files changed

+166
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ autoGen.mk
1111
TestConfig
1212
TKG
1313
functional
14+
!functional/MBCS_Tests
15+
!functional/OpenJcePlusTests
1416
!functional/security
1517
!functional/security/AQAvit
1618
!functional/security/Crypto
1719
!functional/SyntheticGCWorkload
18-
!functional/MBCS_Tests
1920

2021
Utils
2122
systemtest_prereqs/*

functional/OpenJcePlusTests/build.xml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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="OpenJcePlus tests" default="build" basedir=".">
18+
<taskdef resource="net/sf/antcontrib/antlib.xml" />
19+
<description>
20+
OpenJCEPlus Tests
21+
</description>
22+
23+
<!-- set global properties for this build -->
24+
<property name="DEST" value="${BUILD_ROOT}/functional/OpenJcePlusTests" />
25+
26+
<!--Properties for this particular build-->
27+
<property name="src" location="./OpenJCEPlus/src/" />
28+
<property name="build" location="./bin" />
29+
<property name="LIB" value="junit4,hamcrest_core,bcprov_jdk18on"/>
30+
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
31+
32+
<target name="openJcePlusTests.check">
33+
<condition property="openJcePlusTests.exists">
34+
<available file="OpenJCEPlus" type="dir"/>
35+
</condition>
36+
</target>
37+
38+
<if>
39+
<contains string="${SPEC}" substring="zos"/>
40+
<then>
41+
<property name="GIT_REPO" value="[email protected]:" />
42+
</then>
43+
<else>
44+
<property name="GIT_REPO" value="https://github.com/" />
45+
</else>
46+
</if>
47+
<target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists">
48+
<exec executable="git" failonerror="true">
49+
<arg value="clone" />
50+
<arg value="${GIT_REPO}IBM/OpenJCEPlus.git" />
51+
</exec>
52+
<delete dir="./OpenJCEPlus/src/main" />
53+
</target>
54+
55+
<target name="init">
56+
<mkdir dir="${DEST}" />
57+
<mkdir dir="${build}" />
58+
</target>
59+
60+
<property name="addExports" value='--add-exports java.base/sun.security.internal.spec=openjceplus --add-exports java.base/sun.security.util=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.x509=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.pkcs=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.internal.interfaces=openjceplus --add-exports java.base/sun.util.logging=openjceplus --add-exports java.base/jdk.internal.logger=openjceplus --add-exports openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED --add-exports openjceplus/com.ibm.misc=ALL-UNNAMED' />
61+
62+
<target name="compile" depends="init,getDependentLibs,getOpenJcePlusTests" description="Using java ${JDK_VERSION} to compile the source ">
63+
<echo>Ant version is ${ant.version}</echo>
64+
<echo>============COMPILER SETTINGS============</echo>
65+
<echo>===fork: yes</echo>
66+
<echo>===executable: ${compiler.javac}</echo>
67+
<echo>===debug: on</echo>
68+
<echo>===destdir: ${DEST}</echo>
69+
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
70+
<compilerarg line='-Xlint:all ${addExports}' />
71+
<src path="${src}" />
72+
<classpath>
73+
<pathelement location="${LIB_DIR}/junit4.jar" />
74+
<pathelement location="${LIB_DIR}/hamcrest-core.jar" />
75+
<pathelement location="${LIB_DIR}/bcprov-jdk18on.jar" />
76+
</classpath>
77+
</javac>
78+
</target>
79+
80+
<target name="dist" depends="compile" description="generate the distribution">
81+
<jar jarfile="${DEST}/openjceplus-tests.jar" filesonly="true">
82+
<fileset dir="${build}" />
83+
<fileset dir="${src}/../../" includes="*.properties,*.xml" />
84+
</jar>
85+
<copy todir="${DEST}">
86+
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
87+
</copy>
88+
</target>
89+
90+
<target name="clean" depends="dist" description="clean up">
91+
<!-- Delete the ${build} directory trees -->
92+
<delete dir="${build}" />
93+
</target>
94+
95+
<target name="build" >
96+
<if>
97+
<or>
98+
<contains string="${TEST_FLAG}" substring="OpenJcePlusTests"/>
99+
<and>
100+
<equals arg1="${JDK_VENDOR}" arg2="ibm" />
101+
<equals arg1="${JDK_IMPL}" arg2="openj9" />
102+
<equals arg1="${JDK_VERSION}" arg2="17" />
103+
<or>
104+
<contains string="${SPEC}" substring="aix_ppc-64"/>
105+
<contains string="${SPEC}" substring="linux_ppc-64_le"/>
106+
<contains string="${SPEC}" substring="linux_x86-64"/>
107+
<contains string="${SPEC}" substring="win_x86-64"/>
108+
</or>
109+
</and>
110+
</or>
111+
<then>
112+
<antcall target="clean" inheritall="true" />
113+
</then>
114+
</if>
115+
116+
</target>
117+
</project>
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<!--
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
-->
15+
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../TKG/playlist.xsd">
16+
<test>
17+
<testCaseName>openJcePlusTests</testCaseName>
18+
<disables>
19+
<disable>
20+
<comment>only applicable for Semeru atm</comment>
21+
<vendor>eclipse</vendor>
22+
</disable>
23+
<disable>
24+
<comment>Only applicable on aix, pliunx, xlinux and wins64 atm</comment>
25+
<platform>^((?!(ppc64_aix|ppc64le_linux|x86-64_linux|x86-64_windows)).)*$</platform>
26+
</disable>
27+
</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; \
33+
$(TEST_STATUS)</command>
34+
<levels>
35+
<level>extended</level>
36+
</levels>
37+
<groups>
38+
<group>functional</group>
39+
</groups>
40+
<versions>
41+
<version>17</version>
42+
</versions>
43+
<impls>
44+
<impl>openj9</impl>
45+
</impls>
46+
</test>
47+
</playlist>

0 commit comments

Comments
 (0)