Skip to content

Commit

Permalink
Add OpenJcePlusTests (adoptium#5024)
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Xia <[email protected]>
  • Loading branch information
llxia authored Feb 2, 2024
1 parent 35285cc commit dca6d77
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ autoGen.mk
TestConfig
TKG
functional
!functional/MBCS_Tests
!functional/OpenJcePlusTests
!functional/security
!functional/security/AQAvit
!functional/security/Crypto
!functional/SyntheticGCWorkload
!functional/MBCS_Tests

Utils
systemtest_prereqs/*
Expand Down
117 changes: 117 additions & 0 deletions functional/OpenJcePlusTests/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?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="OpenJcePlus tests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
OpenJCEPlus Tests
</description>

<!-- set global properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/OpenJcePlusTests" />

<!--Properties for this particular build-->
<property name="src" location="./OpenJCEPlus/src/" />
<property name="build" location="./bin" />
<property name="LIB" value="junit4,hamcrest_core,bcprov_jdk18on"/>
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>

<target name="openJcePlusTests.check">
<condition property="openJcePlusTests.exists">
<available file="OpenJCEPlus" type="dir"/>
</condition>
</target>

<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<property name="GIT_REPO" value="[email protected]:" />
</then>
<else>
<property name="GIT_REPO" value="https://github.com/" />
</else>
</if>
<target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="${GIT_REPO}IBM/OpenJCEPlus.git" />
</exec>
<delete dir="./OpenJCEPlus/src/main" />
</target>

<target name="init">
<mkdir dir="${DEST}" />
<mkdir dir="${build}" />
</target>

<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' />

<target name="compile" depends="init,getDependentLibs,getOpenJcePlusTests" description="Using java ${JDK_VERSION} to compile the source ">
<echo>Ant version is ${ant.version}</echo>
<echo>============COMPILER SETTINGS============</echo>
<echo>===fork: yes</echo>
<echo>===executable: ${compiler.javac}</echo>
<echo>===debug: on</echo>
<echo>===destdir: ${DEST}</echo>
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
<compilerarg line='-Xlint:all ${addExports}' />
<src path="${src}" />
<classpath>
<pathelement location="${LIB_DIR}/junit4.jar" />
<pathelement location="${LIB_DIR}/hamcrest-core.jar" />
<pathelement location="${LIB_DIR}/bcprov-jdk18on.jar" />
</classpath>
</javac>
</target>

<target name="dist" depends="compile" description="generate the distribution">
<jar jarfile="${DEST}/openjceplus-tests.jar" filesonly="true">
<fileset dir="${build}" />
<fileset dir="${src}/../../" includes="*.properties,*.xml" />
</jar>
<copy todir="${DEST}">
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
</copy>
</target>

<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>

<target name="build" >
<if>
<or>
<contains string="${TEST_FLAG}" substring="OpenJcePlusTests"/>
<and>
<equals arg1="${JDK_VENDOR}" arg2="ibm" />
<equals arg1="${JDK_IMPL}" arg2="openj9" />
<equals arg1="${JDK_VERSION}" arg2="17" />
<or>
<contains string="${SPEC}" substring="aix_ppc-64"/>
<contains string="${SPEC}" substring="linux_ppc-64_le"/>
<contains string="${SPEC}" substring="linux_x86-64"/>
<contains string="${SPEC}" substring="win_x86-64"/>
</or>
</and>
</or>
<then>
<antcall target="clean" inheritall="true" />
</then>
</if>

</target>
</project>
47 changes: 47 additions & 0 deletions functional/OpenJcePlusTests/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
# 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.
-->
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../TKG/playlist.xsd">
<test>
<testCaseName>openJcePlusTests</testCaseName>
<disables>
<disable>
<comment>only applicable for Semeru atm</comment>
<vendor>eclipse</vendor>
</disable>
<disable>
<comment>Only applicable on aix, pliunx, xlinux and wins64 atm</comment>
<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; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
</levels>
<groups>
<group>functional</group>
</groups>
<versions>
<version>17</version>
</versions>
<impls>
<impl>openj9</impl>
</impls>
</test>
</playlist>

0 comments on commit dca6d77

Please sign in to comment.