Skip to content

Commit

Permalink
Add maven dependencies, TestMemStressAll and TestMultiThread *for Ope…
Browse files Browse the repository at this point in the history
…nJCEPlus (#5332)

This PR aims to solve the issue 5312 which caused by the dependency
,and also add the TestMemStressAll and TestMultiThread* related tests
for OpenJCEPlus.

Issue: #5312
  • Loading branch information
JinhangZhang authored May 23, 2024
1 parent f114ec9 commit e64cfd6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
16 changes: 14 additions & 2 deletions functional/OpenJcePlusTests/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!--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"/>
<property name="LIB" value="junit4,hamcrest_core,bcprov_jdk18on,junit_vintage_engine,junit_platform_suite,junit_jupiter_api,junit_jupiter_engine,junit_jupiter_params,junit_platform_suite_api"/>
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
<property environment="env" />

Expand Down Expand Up @@ -121,6 +121,12 @@
<pathelement location="${LIB_DIR}/junit4.jar" />
<pathelement location="${LIB_DIR}/hamcrest-core.jar" />
<pathelement location="${LIB_DIR}/bcprov-jdk18on.jar" />
<pathelement location="${LIB_DIR}/junit-vintage-engine.jar" />
<pathelement location="${LIB_DIR}/junit-platform-suite.jar" />
<pathelement location="${LIB_DIR}/junit-jupiter-api.jar" />
<pathelement location="${LIB_DIR}/junit-jupiter-engine.jar" />
<pathelement location="${LIB_DIR}/junit-jupiter-params.jar" />
<pathelement location="${LIB_DIR}/junit-platform-suite-api.jar" />
</classpath>
</javac>
</target>
Expand All @@ -131,10 +137,16 @@
<fileset dir="${src}/../../" includes="*.properties,*.xml" />
</jar>
<copy todir="${DEST}">
<fileset dir="${src}/../../" includes="*.xml,*.mk" />
<fileset dir="${src}/../../" includes="*.xml,*.mk,*.jar" />
<fileset dir="${LIB_DIR}/" includes="junit4.jar" />
<fileset dir="${LIB_DIR}/" includes="hamcrest-core.jar" />
<fileset dir="${LIB_DIR}/" includes="bcprov-jdk18on.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-vintage-engine.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-platform-suite.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-jupiter-api.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-jupiter-engine.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-jupiter-params.jar" />
<fileset dir="${LIB_DIR}/" includes="junit-platform-suite-api.jar" />
</copy>
</target>

Expand Down
52 changes: 49 additions & 3 deletions functional/OpenJcePlusTests/test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

<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>Ant script to run the tests for ibm.jceplus.junit.TestMemStressAll,
ibm.jceplus.junit.TestMultiThread,
ibm.jceplus.junit.TestMultithreadFIPS,
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" />
<echo message="Running ibm.jceplus.junit.TestMemStressAll, ibm.jceplus.junit.TestMultiThread, ibm.jceplus.junit.TestMultithreadFIP and ibm.jceplus.junit.TestAll in ${user.dir}" />
<mkdir dir="junitreports" />
<java jvm="${TEST_JAVA}"
classname="org.apache.tools.ant.launch.Launcher"
Expand All @@ -41,6 +43,49 @@
</java>
</target>
<target name="test">
<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.TestMemStressAll" />
<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.TestMemStressAll" todir="junitreports"/>
</junit>
<echo message="TestMemStressAll COMPLETED" />
<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.TestMultiThread" />
<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.TestMultithread" todir="junitreports"/>
</junit>
<echo message="TestMultithread COMPLETED" />
<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.TestMultiThreadFIPS" />
<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.TestMultithreadFIPS" todir="junitreports"/>
</junit>
<echo message="TestMultithreadFIPS COMPLETED" />
<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" />
<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" />
Expand All @@ -53,6 +98,7 @@
<formatter type="xml" />
<test name="ibm.jceplus.junit.TestAll" todir="junitreports"/>
</junit>
<echo message="TestAll COMPLETED" />
<echo message="ALL TESTS COMPLETED" />
</target>
</project>

0 comments on commit e64cfd6

Please sign in to comment.