diff --git a/test/functional/Java8andUp/build.xml b/test/functional/Java8andUp/build.xml
index b7eec15d29d..00b08e282a8 100644
--- a/test/functional/Java8andUp/build.xml
+++ b/test/functional/Java8andUp/build.xml
@@ -33,6 +33,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
+
@@ -264,33 +265,46 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
===addExports: ${addExports}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/functional/Java8andUp/playlist.xml b/test/functional/Java8andUp/playlist.xml
index 59b45a42c7e..5ee28d14367 100644
--- a/test/functional/Java8andUp/playlist.xml
+++ b/test/functional/Java8andUp/playlist.xml
@@ -1065,6 +1065,52 @@
ibm
+
+ JCL_Test_SM
+
+ NoOptions
+ -XX:RecreateClassfileOnload
+ -XX:+CompactStrings
+
+ $(JAVA_COMMAND) $(JAVA_SECURITY_MANAGER) $(JVM_OPTIONS) -verbose:stacktrace -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
+ -Drowset.provider.classname=org.openj9.resources.classloader.CustomSyncProvider \
+ --add-modules openj9.sharedclasses $(ADD_MODULE_JAVA_SE_EE) \
+ --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED \
+ --add-exports java.base/com.ibm.oti.util=ALL-UNNAMED \
+ --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED \
+ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED $(ADD_EXPORTS_JDK_INTERNAL_REFLECT) \
+ --add-exports java.base/com.ibm.jit.crypto=ALL-UNNAMED \
+ --add-exports java.base/com.ibm.oti.reflect=ALL-UNNAMED \
+ --add-exports java.base/sun.net.www.protocol.jrt=ALL-UNNAMED \
+ --add-opens=java.base/java.lang=ALL-UNNAMED \
+ --add-opens=java.base/java.security=ALL-UNNAMED \
+ $(ADD_EXPORTS_JDK_INTERNAL_ACCESS) \
+ -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) \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames \
+ JCL_TEST_Java-Lang_SM,\
+ JCL_TEST_Java-Lang-Invoke_SM,\
+ JCL_TEST_Java-Lang_ClassLoader_SM,\
+ JCL_TEST_IBM-VM_SM \
+ -groups $(TEST_GROUP) \
+ -excludegroups $(DEFAULT_EXCLUDE); \
+ $(TEST_STATUS)
+
+ sanity
+
+
+ functional
+
+
+ 11
+ 17
+ 18
+
+
+ openj9
+ ibm
+
+
JCL_Test_Native
@@ -1169,6 +1215,51 @@
ibm
+
+ JCL_Test_SM_none_SCC
+
+ -Xshareclasses:none
+ -Xshareclasses:none -XX:RecreateClassfileOnload
+
+ $(JAVA_COMMAND) $(JAVA_SECURITY_MANAGER) $(JVM_OPTIONS) -verbose:stacktrace -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
+ -Drowset.provider.classname=org.openj9.resources.classloader.CustomSyncProvider \
+ --add-modules openj9.sharedclasses $(ADD_MODULE_JAVA_SE_EE) \
+ --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED \
+ --add-exports java.base/com.ibm.oti.util=ALL-UNNAMED \
+ --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED \
+ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED $(ADD_EXPORTS_JDK_INTERNAL_REFLECT) \
+ --add-exports java.base/com.ibm.jit.crypto=ALL-UNNAMED \
+ --add-exports java.base/com.ibm.oti.reflect=ALL-UNNAMED \
+ --add-exports java.base/sun.net.www.protocol.jrt=ALL-UNNAMED \
+ --add-opens=java.base/java.lang=ALL-UNNAMED \
+ --add-opens=java.base/java.security=ALL-UNNAMED \
+ $(ADD_EXPORTS_JDK_INTERNAL_ACCESS) \
+ -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) \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames \
+ JCL_TEST_Java-Lang_SM,\
+ JCL_TEST_Java-Lang-Invoke_SM,\
+ JCL_TEST_Java-Lang_ClassLoader_SM,\
+ JCL_TEST_IBM-VM_SM \
+ -groups $(TEST_GROUP) \
+ -excludegroups $(DEFAULT_EXCLUDE); \
+ $(TEST_STATUS)
+
+ sanity
+
+
+ functional
+
+
+ 11
+ 17
+ 18
+
+
+ openj9
+ ibm
+
+
JCL_Test_none_SCC_Native
@@ -1264,7 +1355,7 @@
$(JAVA_COMMAND) $(JVM_OPTIONS) -verbose:stacktrace -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
-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$(Q) \
-Drowset.provider.classname=org.openj9.resources.classloader.CustomSyncProvider \
- org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng.xml$(Q) \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
-testnames \
JCL_TEST_Test-TypeAnnotation,\
JCL_TEST_Test-Annotation,\
@@ -1272,11 +1363,14 @@
JCL_TEST_Test-Annotation-ClassLoader,\
JCL_TEST_Test-Annotation-Package,\
JCL_TEST_Java-Lang_ClassLoader,\
+ JCL_TEST_Java-Lang_ClassLoader_SM,\
JCL_TEST_Test-Defects,\
JCL_TEST_Test-UnsafeFence,\
JCL_TEST_IBM-VM,\
JCL_TEST_Java-Lang,\
+ JCL_TEST_Java-Lang_SM,\
JCL_TEST_Java-Lang-Invoke,\
+ JCL_TEST_Java-Lang-Invoke_SM,\
JCL_TEST_Java-Lang-Ref,\
JCL_TEST_Java-Lang-Reflect,\
JCL_TEST_Java-Math,\
@@ -1383,7 +1477,6 @@
-groups $(TEST_GROUP) \
-excludegroups $(DEFAULT_EXCLUDE); \
$(TEST_STATUS)
- ^vm.hrt
sanity
@@ -1391,7 +1484,41 @@
functional
- 9+
+ 11
+ 17
+ 18
+
+
+ openj9
+ ibm
+
+
+
+ J9VMInternals_Test_SM
+
+ NoOptions
+
+ $(MKDIR) -p $(REPORTDIR); \
+ cd $(REPORTDIR); \
+ $(JAVA_COMMAND) $(JAVA_SECURITY_MANAGER) $(JVM_OPTIONS) -verbose:stacktrace \
+ -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
+ -Xbootclasspath/a:$(TEST_RESROOT)$(D)TestResources.jar \
+ -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$(Q) \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames JCL_TEST_Java-Internals_SM \
+ -groups $(TEST_GROUP) \
+ -excludegroups $(DEFAULT_EXCLUDE); \
+ $(TEST_STATUS)
+
+ sanity
+
+
+ functional
+
+
+ 11
+ 17
+ 18
openj9
@@ -1410,8 +1537,10 @@
-Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)java.policy$(Q) \
-Xbootclasspath/a:$(TEST_RESROOT)$(D)TestResources.jar \
-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$(Q) \
- org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng.xml$(Q) \
- -testnames JCL_TEST_Java-Internals \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames \
+ JCL_TEST_Java-Internals,\
+ JCL_TEST_Java-Internals_SM \
-groups $(TEST_GROUP) \
-excludegroups $(DEFAULT_EXCLUDE); \
$(TEST_STATUS)
@@ -1443,8 +1572,10 @@
-Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)testacc.policy$(Q) \
-Xbootclasspath/a:$(TEST_RESROOT)$(D)TestResources.jar \
-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$(Q) \
- org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng.xml$(Q) \
- -testnames JCL_TEST_Java-Security \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames \
+ JCL_TEST_Java-Security,\
+ JCL_TEST_Java-Security_SM \
-groups $(TEST_GROUP) \
-excludegroups $(DEFAULT_EXCLUDE); \
$(TEST_STATUS)
@@ -1504,6 +1635,40 @@
ibm
+
+ JCL_TEST_Java-Security_SM
+
+ NoOptions
+
+ $(JAVA_COMMAND) $(JAVA_SECURITY_MANAGER) $(JVM_OPTIONS) -verbose:stacktrace \
+ --add-modules openj9.sharedclasses $(ADD_MODULE_JAVA_SE_EE) \
+ --add-exports java.base/com.ibm.oti.util=ALL-UNNAMED \
+ --add-opens=java.base/java.lang=ALL-UNNAMED \
+ --add-opens=java.base/java.security=ALL-UNNAMED \
+ -Djava.security.policy=$(Q)$(TEST_RESROOT)$(D)testacc.policy$(Q) \
+ -Xbootclasspath/a:$(TEST_RESROOT)$(D)TestResources.jar \
+ -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$(Q) \
+ org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng_sm.xml$(Q) \
+ -testnames JCL_TEST_Java-Security_SM \
+ -groups $(TEST_GROUP) \
+ -excludegroups $(DEFAULT_EXCLUDE); \
+ $(TEST_STATUS)
+
+ sanity
+
+
+ functional
+
+
+ 11
+ 17
+ 18
+
+
+ openj9
+ ibm
+
+
JCL_Test_JITHelpers_SE80
$(JAVA_COMMAND) $(JVM_OPTIONS) \
diff --git a/test/functional/Java8andUp/src/org/openj9/test/annotationPackage/Test_PackageAnnotation.java b/test/functional/Java8andUp/src/org/openj9/test/annotationPackage/Test_PackageAnnotation.java
index c5f0e4ea3f6..c7bd609a89a 100644
--- a/test/functional/Java8andUp/src/org/openj9/test/annotationPackage/Test_PackageAnnotation.java
+++ b/test/functional/Java8andUp/src/org/openj9/test/annotationPackage/Test_PackageAnnotation.java
@@ -7,7 +7,7 @@
import org.testng.AssertJUnit;
/*******************************************************************************
- * Copyright (c) 2010, 2018 IBM Corp. and others
+ * Copyright (c) 2010, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -29,8 +29,6 @@
*******************************************************************************/
import java.net.URL;
import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import javax.xml.bind.annotation.XmlSchema;
@Test(groups = { "level.sanity" })
@@ -123,16 +121,12 @@ private static String toString(Class> clazz) {
}
private static ClassLoader getClassLoader(final Class> clazz) {
- return AccessController.doPrivileged(new PrivilegedAction() {
- public ClassLoader run() {
- ClassLoader cl = null;
- try {
- cl = clazz.getClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
+ ClassLoader cl = null;
+ try {
+ cl = clazz.getClassLoader();
+ } catch (SecurityException ex) {
+ }
+ return cl;
}
}
diff --git a/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader.java b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader.java
index 6eb03e4f1c3..af1bad1ac49 100644
--- a/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader.java
+++ b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2019 IBM Corp. and others
+ * Copyright (c) 1998, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -416,113 +416,4 @@ void loadClassInParallelHelper(MyClassLoader mcl) {
}
}
- /**
- * [PR Jazz103 76960]
- *
- * @tests java.lang.ClassLoader#getParent() Test the case when in
- * getParent() the callerClassLoader is same as child of this
- * classloader. getParent() should throw SecurityException in such
- * case.
- */
- @Test
- public void test_getParent1() {
- ClassLoader cl = this.getClass().getClassLoader();
- ClassLoader parentCl = cl.getParent();
-
- SecurityManager manager = new SecurityManager();
- System.setSecurityManager(manager);
- try {
- parentCl.getParent();
- Assert.fail("expected the above call to getParent() to throw SecurityException");
- } catch (SecurityException e) {
- /* expected exception */
- } finally {
- System.setSecurityManager(null);
- }
- }
-
- /**
- * [PR Jazz103 76960]
- *
- * @tests java.lang.ClassLoader#getParent() Test the case when in
- * getParent() the callerClassLoader is same as this classloader.
- * getParent() should throw SecurityException in such case.
- */
- @Test
- public void test_getParent2() {
- ClassLoader cl = this.getClass().getClassLoader();
- SecurityManager manager = new SecurityManager();
-
- System.setSecurityManager(manager);
- try {
- cl.getParent();
- Assert.fail("expected the above call to getParent() to throw SecurityException");
- } catch (SecurityException e) {
- /* expected exception */
- } finally {
- System.setSecurityManager(null);
- }
- }
-
- /**
- * @tests java.lang.ClassLoader#getParent() Test the case when in
- * getParent() the callerClassLoader is same as parent of this
- * classloader. This should cause the condition (callerClassLoader !=
- * requested) in ClassLoader.needsClassLoaderPermissionCheck() to
- * fail, thus preventing any security checks in getParent().
- */
- @Test
- public void test_getParent3() {
- class ChildClassLoader extends ClassLoader {
- public ChildClassLoader(ClassLoader parent) {
- super(parent);
- }
- }
-
- ClassLoader cl = this.getClass().getClassLoader();
- ChildClassLoader childCL = new ChildClassLoader(cl);
-
- SecurityManager manager = new SecurityManager();
- System.setSecurityManager(manager);
- try {
- childCL.getParent();
- } catch (SecurityException e) {
- Assert.fail("unexpected exception: " + e);
- } finally {
- System.setSecurityManager(null);
- }
- }
-
- /**
- * @tests java.lang.ClassLoader#getParent() Test the case when in
- * getParent() the callerClassLoader is same as grand parent of this
- * classloader (that is an ancestor of the parent of this
- * classloader) This should cause the condition
- * !callerClassLoader.isAncestorOf(requested) in
- * ClassLoader.needsClassLoaderPermissionCheck() to fail, thus
- * preventing any security checks in getParent().
- */
- @Test
- public void test_getParent4() {
- class ChildClassLoader extends ClassLoader {
- public ChildClassLoader(ClassLoader parent) {
- super(parent);
- }
- }
-
- ClassLoader cl = this.getClass().getClassLoader();
- ChildClassLoader child = new ChildClassLoader(cl);
- ChildClassLoader grandChild = new ChildClassLoader(child);
-
- SecurityManager manager = new SecurityManager();
- System.setSecurityManager(manager);
- try {
- grandChild.getParent();
- } catch (SecurityException e) {
- Assert.fail("unexpected exception: " + e);
- } finally {
- System.setSecurityManager(null);
- }
- }
-
}
diff --git a/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader_SM.java b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader_SM.java
new file mode 100644
index 00000000000..80f111204fe
--- /dev/null
+++ b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_ClassLoader_SM.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2022, 2022 IBM Corp. and others
+ *
+ * This program and the accompanying materials are made available under
+ * the terms of the Eclipse Public License 2.0 which accompanies this
+ * distribution and is available at https://www.eclipse.org/legal/epl-2.0/
+ * or the Apache License, Version 2.0 which accompanies this distribution and
+ * is available at https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * This Source Code may also be made available under the following
+ * Secondary Licenses when the conditions for such availability set
+ * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
+ * General Public License, version 2 with the GNU Classpath
+ * Exception [1] and GNU General Public License, version 2 with the
+ * OpenJDK Assembly Exception [2].
+ *
+ * [1] https://www.gnu.org/software/classpath/license.html
+ * [2] http://openjdk.java.net/legal/assembly-exception.html
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
+ *******************************************************************************/
+package org.openj9.test.java.lang;
+
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+
+@Test(groups = { "level.sanity" })
+public class Test_ClassLoader_SM {
+
+ /**
+ * [PR Jazz103 76960]
+ *
+ * @tests java.lang.ClassLoader#getParent() Test the case when in
+ * getParent() the callerClassLoader is same as child of this
+ * classloader. getParent() should throw SecurityException in such
+ * case.
+ */
+ @Test
+ public void test_getParent1() {
+ ClassLoader cl = this.getClass().getClassLoader();
+ ClassLoader parentCl = cl.getParent();
+
+ SecurityManager manager = new SecurityManager();
+ System.setSecurityManager(manager);
+ try {
+ parentCl.getParent();
+ Assert.fail("expected the above call to getParent() to throw SecurityException");
+ } catch (SecurityException e) {
+ /* expected exception */
+ } finally {
+ System.setSecurityManager(null);
+ }
+ }
+
+ /**
+ * [PR Jazz103 76960]
+ *
+ * @tests java.lang.ClassLoader#getParent() Test the case when in
+ * getParent() the callerClassLoader is same as this classloader.
+ * getParent() should throw SecurityException in such case.
+ */
+ @Test
+ public void test_getParent2() {
+ ClassLoader cl = this.getClass().getClassLoader();
+ SecurityManager manager = new SecurityManager();
+
+ System.setSecurityManager(manager);
+ try {
+ cl.getParent();
+ Assert.fail("expected the above call to getParent() to throw SecurityException");
+ } catch (SecurityException e) {
+ /* expected exception */
+ } finally {
+ System.setSecurityManager(null);
+ }
+ }
+
+ /**
+ * @tests java.lang.ClassLoader#getParent() Test the case when in
+ * getParent() the callerClassLoader is same as parent of this
+ * classloader. This should cause the condition (callerClassLoader !=
+ * requested) in ClassLoader.needsClassLoaderPermissionCheck() to
+ * fail, thus preventing any security checks in getParent().
+ */
+ @Test
+ public void test_getParent3() {
+ class ChildClassLoader extends ClassLoader {
+ public ChildClassLoader(ClassLoader parent) {
+ super(parent);
+ }
+ }
+
+ ClassLoader cl = this.getClass().getClassLoader();
+ ChildClassLoader childCL = new ChildClassLoader(cl);
+
+ SecurityManager manager = new SecurityManager();
+ System.setSecurityManager(manager);
+ try {
+ childCL.getParent();
+ } catch (SecurityException e) {
+ Assert.fail("unexpected exception: " + e);
+ } finally {
+ System.setSecurityManager(null);
+ }
+ }
+
+ /**
+ * @tests java.lang.ClassLoader#getParent() Test the case when in
+ * getParent() the callerClassLoader is same as grand parent of this
+ * classloader (that is an ancestor of the parent of this
+ * classloader) This should cause the condition
+ * !callerClassLoader.isAncestorOf(requested) in
+ * ClassLoader.needsClassLoaderPermissionCheck() to fail, thus
+ * preventing any security checks in getParent().
+ */
+ @Test
+ public void test_getParent4() {
+ class ChildClassLoader extends ClassLoader {
+ public ChildClassLoader(ClassLoader parent) {
+ super(parent);
+ }
+ }
+
+ ClassLoader cl = this.getClass().getClassLoader();
+ ChildClassLoader child = new ChildClassLoader(cl);
+ ChildClassLoader grandChild = new ChildClassLoader(child);
+
+ SecurityManager manager = new SecurityManager();
+ System.setSecurityManager(manager);
+ try {
+ grandChild.getParent();
+ } catch (SecurityException e) {
+ Assert.fail("unexpected exception: " + e);
+ } finally {
+ System.setSecurityManager(null);
+ }
+ }
+
+}
diff --git a/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_Class_SM.java b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_Class_SM.java
new file mode 100644
index 00000000000..89e23795aa9
--- /dev/null
+++ b/test/functional/Java8andUp/src/org/openj9/test/java/lang/Test_Class_SM.java
@@ -0,0 +1,338 @@
+package org.openj9.test.java.lang;
+
+/*******************************************************************************
+ * Copyright (c) 2022, 2022 IBM Corp. and others
+ *
+ * This program and the accompanying materials are made available under
+ * the terms of the Eclipse Public License 2.0 which accompanies this
+ * distribution and is available at https://www.eclipse.org/legal/epl-2.0/
+ * or the Apache License, Version 2.0 which accompanies this distribution and
+ * is available at https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * This Source Code may also be made available under the following
+ * Secondary Licenses when the conditions for such availability set
+ * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
+ * General Public License, version 2 with the GNU Classpath
+ * Exception [1] and GNU General Public License, version 2 with the
+ * OpenJDK Assembly Exception [2].
+ *
+ * [1] https://www.gnu.org/software/classpath/license.html
+ * [2] http://openjdk.java.net/legal/assembly-exception.html
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
+ *******************************************************************************/
+
+import org.testng.annotations.Test;
+import org.testng.log4testng.Logger;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.ClassLoader;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.*;
+
+import org.openj9.test.support.resource.Support_Resources;
+
+/**
+ *
+ * @requiredClass org.openj9.test.support.resource.Support_Resources
+ * @requiredResource org/openj9/resources/openj9tr_compressD.txt
+ * @requiredResource org/openj9/resources/openj9tr_general.jar
+ * @requiredResource org/openj9/resources/openj9tr_Foo.c
+ */
+@Test(groups = { "level.sanity" })
+public class Test_Class_SM {
+ private static final Logger logger = Logger.getLogger(Test_Class_SM.class);
+
+ @Test
+ public void test_getMethods_subtest2() {
+ PrivilegedAction