Skip to content

Commit 0362cb3

Browse files
authored
Merge pull request #19918 from LongyuZhang/thread1
Extract Thread Test to JDK 22 and under
2 parents 48f557e + 01f287c commit 0362cb3

File tree

5 files changed

+143
-15
lines changed

5 files changed

+143
-15
lines changed

test/functional/Java8andUp/build.xml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,32 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
286286
<compilerarg line='${commonArgs}' />
287287
</javac>
288288
</then>
289+
<elseif>
290+
<matches string="${JDK_VERSION}" pattern="^(19|2[0-2])$$" />
291+
<then>
292+
<!-- Java 19 - 22 (SecurityManager removed) -->
293+
<javac srcdir="${srcpath}" excludes="${commonExcludes}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
294+
<compilerarg line='${commonArgs}' />
295+
<!-- exclude tests that depend on SecurityManager -->
296+
<exclude name="org/openj9/test/java/security/Test_AccessController.java" />
297+
<exclude name="org/openj9/test/java/security/Test_AccessControlContext.java" />
298+
<exclude name="org/openj9/test/java/lang/Test_Class_SM.java" />
299+
<exclude name="org/openj9/test/java/lang/Test_System_SM.java" />
300+
<exclude name="org/openj9/test/java/lang/Test_Thread_SM.java" />
301+
<exclude name="org/openj9/test/java/lang/Test_ThreadGroup_SM.java" />
302+
<exclude name="org/openj9/test/java/lang/invoke/Test_MethodHandleInfo_SM.java" />
303+
<exclude name="org/openj9/test/java/lang/Test_ClassLoader_SM.java" />
304+
<exclude name="org/openj9/test/java/lang/Test_J9VMInternals_SM.java" />
305+
<exclude name="org/openj9/test/java/lang/Test_J9VMInternalsImpl_SM.java" />
306+
<exclude name="org/openj9/test/vm/Test_VM.java" />
307+
</javac>
308+
</then>
309+
</elseif>
289310
<else>
290-
<!-- Java 19+ (SecurityManager removed) -->
311+
<!-- Java 23+ (SecurityManage and Thread functions removed) -->
291312
<javac srcdir="${srcpath}" excludes="${commonExcludes}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
292313
<compilerarg line='${commonArgs}' />
293-
<!-- exclude tests that depend on SecurityManager -->
314+
<!-- exclude tests that depend on SecurityManager or Thread functions -->
294315
<exclude name="org/openj9/test/java/security/Test_AccessController.java" />
295316
<exclude name="org/openj9/test/java/security/Test_AccessControlContext.java" />
296317
<exclude name="org/openj9/test/java/lang/Test_Class_SM.java" />
@@ -301,6 +322,8 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
301322
<exclude name="org/openj9/test/java/lang/Test_ClassLoader_SM.java" />
302323
<exclude name="org/openj9/test/java/lang/Test_J9VMInternals_SM.java" />
303324
<exclude name="org/openj9/test/java/lang/Test_J9VMInternalsImpl_SM.java" />
325+
<exclude name="org/openj9/test/java/lang/Test_Thread.java" />
326+
<exclude name="org/openj9/test/java/lang/Test_ThreadGroup.java" />
304327
<exclude name="org/openj9/test/vm/Test_VM.java" />
305328
</javac>
306329
</else>

test/functional/Java8andUp/playlist.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,55 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
11361136
<impl>ibm</impl>
11371137
</impls>
11381138
</test>
1139+
<test>
1140+
<testCaseName>JCL_Test_Thread</testCaseName>
1141+
<variations>
1142+
<variation>NoOptions</variation>
1143+
<variation>-XX:RecreateClassfileOnload</variation>
1144+
<variation>-XX:+CompactStrings</variation>
1145+
</variations>
1146+
<command>$(ADD_JVM_LIB_DIR_TO_LIBPATH) \
1147+
$(JAVA_COMMAND) $(JAVA_SECURITY_MANAGER) $(JVM_OPTIONS) -verbose:stacktrace -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
1148+
-Drowset.provider.classname=org.openj9.resources.classloader.CustomSyncProvider \
1149+
--add-modules openj9.sharedclasses $(ADD_MODULE_JAVA_SE_EE) \
1150+
--add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED \
1151+
--add-exports java.base/com.ibm.oti.util=ALL-UNNAMED \
1152+
--add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED \
1153+
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED $(ADD_EXPORTS_JDK_INTERNAL_REFLECT) \
1154+
--add-exports java.base/com.ibm.jit.crypto=ALL-UNNAMED \
1155+
--add-exports java.base/com.ibm.oti.reflect=ALL-UNNAMED \
1156+
--add-exports java.base/sun.net.www.protocol.jrt=ALL-UNNAMED \
1157+
--add-opens=java.base/java.lang=ALL-UNNAMED \
1158+
--add-opens=java.base/java.security=ALL-UNNAMED \
1159+
$(ADD_EXPORTS_JDK_INTERNAL_ACCESS) \
1160+
-cp $(Q)$(RESOURCES_DIR)$(P)$(TESTNG)$(P)$(TEST_RESROOT)$(D)GeneralTest.jar$(P)$(TEST_RESROOT)$(D)TestResources.jar$(P)$(LIB_DIR)$(D)asm-all.jar$(JAXB_API_JAR)$(Q) \
1161+
org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_thread.xml$(Q) \
1162+
-testnames \
1163+
JCL_TEST_Java-Lang_Tread \
1164+
-groups $(TEST_GROUP) \
1165+
-excludegroups $(DEFAULT_EXCLUDE); \
1166+
$(TEST_STATUS)</command>
1167+
<platformRequirements>^vm.hrt</platformRequirements>
1168+
<levels>
1169+
<level>sanity</level>
1170+
</levels>
1171+
<groups>
1172+
<group>functional</group>
1173+
</groups>
1174+
<versions>
1175+
<version>[11, 22]</version>
1176+
</versions>
1177+
<features>
1178+
<feature>AOT:nonapplicable</feature>
1179+
</features>
1180+
<types>
1181+
<type>native</type>
1182+
</types>
1183+
<impls>
1184+
<impl>openj9</impl>
1185+
<impl>ibm</impl>
1186+
</impls>
1187+
</test>
11391188
<test>
11401189
<testCaseName>JCL_Test_Native</testCaseName>
11411190
<variations>

test/functional/Java8andUp/testng.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@
197197
<class name="org.openj9.test.java.lang.Test_StringBuffer"/>
198198
<class name="org.openj9.test.java.lang.Test_StringBuilder"/>
199199
<class name="org.openj9.test.java.lang.Test_System"/>
200-
<class name="org.openj9.test.java.lang.Test_Thread"/>
201200
<class name="org.openj9.test.java.lang.Test_Thread_Extra"/>
202-
<class name="org.openj9.test.java.lang.Test_ThreadGroup"/>
203201
<class name="org.openj9.test.java.lang.Test_Throwable"/>
204202
<class name="org.openj9.test.java.lang.Test_VMAccess"/>
205203
</classes>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright IBM Corp. and others 2024
5+
6+
This program and the accompanying materials are made available under
7+
the terms of the Eclipse Public License 2.0 which accompanies this
8+
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
9+
or the Apache License, Version 2.0 which accompanies this distribution and
10+
is available at https://www.apache.org/licenses/LICENSE-2.0.
11+
12+
This Source Code may also be made available under the following
13+
Secondary Licenses when the conditions for such availability set
14+
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
15+
General Public License, version 2 with the GNU Classpath
16+
Exception [1] and GNU General Public License, version 2 with the
17+
OpenJDK Assembly Exception [2].
18+
19+
[1] https://www.gnu.org/software/classpath/license.html
20+
[2] https://openjdk.org/legal/assembly-exception.html
21+
22+
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
23+
-->
24+
25+
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
26+
<suite name="GeneralTest suite" parallel="none" verbose="2">
27+
<listeners>
28+
<listener class-name="org.openj9.test.util.IncludeExcludeTestAnnotationTransformer"/>
29+
</listeners>
30+
<test name="JCL_TEST_Java-Lang_Tread">
31+
<classes>
32+
<class name="org.openj9.test.java.lang.Test_Thread"/>
33+
<class name="org.openj9.test.java.lang.Test_ThreadGroup"/>
34+
</classes>
35+
</test>
36+
</suite>
37+
<!-- Suite -->

test/functional/cmdLineTests/jvmtitests/build.xml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,38 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
9090
<property name="excludeFile" value="" />
9191
</else>
9292
</if>
93-
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
94-
<src path="${src}" />
95-
<src path="${extraSrc}" />
96-
<exclude name="${excludeFile}" />
97-
<exclude name="${excludeJDK21UpGetStackTraceExtendedTest}" />
98-
<exclude name="${excludeJDK21UpGetThreadListStackTracesExtendedTest}" />
99-
<compilerarg line="${addExports}" />
100-
<classpath>
101-
<pathelement location="${asm.jar}" />
102-
</classpath>
103-
</javac>
93+
<if>
94+
<matches string="${JDK_VERSION}" pattern="^(8|9|1[0-9]|2[0-2])$$" />
95+
<then>
96+
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
97+
<src path="${src}" />
98+
<src path="${extraSrc}" />
99+
<exclude name="${excludeFile}" />
100+
<exclude name="${excludeJDK21UpGetStackTraceExtendedTest}" />
101+
<exclude name="${excludeJDK21UpGetThreadListStackTracesExtendedTest}" />
102+
<compilerarg line="${addExports}" />
103+
<classpath>
104+
<pathelement location="${asm.jar}" />
105+
</classpath>
106+
</javac>
107+
</then>
108+
<else>
109+
<!-- Java 23+ (SecurityManage and several Thread functions removed) -->
110+
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
111+
<src path="${src}" />
112+
<src path="${extraSrc}" />
113+
<exclude name="${excludeFile}" />
114+
<exclude name="${excludeJDK21UpGetStackTraceExtendedTest}" />
115+
<exclude name="${excludeJDK21UpGetThreadListStackTracesExtendedTest}" />
116+
<exclude name="${excludeJDK21UpGetThreadListStackTracesExtendedTest}" />
117+
<compilerarg line="${addExports}" />
118+
<exclude name="com/ibm/jvmti/tests/getThreadState/gts001.java" />
119+
<classpath>
120+
<pathelement location="${asm.jar}" />
121+
</classpath>
122+
</javac>
123+
</else>
124+
</if>
104125
</else>
105126
</if>
106127

0 commit comments

Comments
 (0)