hotspot/test/runtime/modules/getModuleJNI/GetModule.java
changeset 42307 cefc81dc1d52
parent 38094 46977cd73d86
child 44520 0553e129e0ec
--- a/hotspot/test/runtime/modules/getModuleJNI/GetModule.java	Wed Nov 23 16:16:34 2016 +0000
+++ b/hotspot/test/runtime/modules/getModuleJNI/GetModule.java	Thu Dec 01 08:56:41 2016 +0000
@@ -35,10 +35,6 @@
     }
 
     static native Object callGetModule(java.lang.Class clazz);
-    static native void callAddModuleReads(java.lang.reflect.Module from_module,
-                                          java.lang.reflect.Module source_module);
-    static native boolean callCanReadModule(java.lang.reflect.Module asking_module,
-                                            java.lang.reflect.Module source_module);
 
     public static void main(String[] args) {
         Module module;
@@ -144,71 +140,6 @@
         } catch(NullPointerException e) {
             // Expected
         }
-
-
-        // Tests for JNI_AddModuleReads() //
-
-        Module javaScriptingModule = javax.script.Bindings.class.getModule();
-        if (javaScriptingModule == null) {
-            throw new RuntimeException("Failed to get java.scripting module");
-        }
-        Module javaLoggingModule = java.util.logging.Level.class.getModule();
-        if (javaLoggingModule == null) {
-            throw new RuntimeException("Failed to get java.logging module");
-        }
-
-        if (callCanReadModule(javaLoggingModule, javaScriptingModule)) {
-            throw new RuntimeException(
-                "Expected FALSE because javaLoggingModule cannot read javaScriptingModule");
-        }
-
-        callAddModuleReads(javaLoggingModule, javaScriptingModule);
-        callAddModuleReads(javaScriptingModule, GetModule.class.getModule()); // unnamed module
-
-        try {
-            callAddModuleReads(null, javaLoggingModule);
-            throw new RuntimeException(
-                "Expected NullPointerException for bad from_module not thrown");
-        } catch(NullPointerException e) {
-            // expected
-        }
-
-        try {
-          callAddModuleReads(javaLoggingModule, null);
-          throw new RuntimeException(
-                "Expected NullPointerException for bad source_module not thrown");
-        } catch(NullPointerException e) {
-            // expected
-        }
-
-
-        // Tests for JNI_CanReadModule() //
-
-        if (!callCanReadModule(javaLoggingModule, javaScriptingModule)) {
-            throw new RuntimeException(
-                "Expected TRUE because javaLoggingModule can read javaScriptingModule");
-        }
-
-        if (callCanReadModule(javaBaseModule, javaScriptingModule)) {
-            throw new RuntimeException(
-                "Expected FALSE because javaBaseModule cannnot read javaScriptingModule");
-        }
-
-        try {
-            callCanReadModule(javaLoggingModule, null);
-            throw new RuntimeException(
-                "Expected NullPointerException for bad sourceModule not thrown");
-        } catch(NullPointerException e) {
-            // expected
-        }
-
-        try {
-            callCanReadModule(null, javaScriptingModule);
-            throw new RuntimeException(
-                "Expected NullPointerException for bad asking_module not thrown");
-        } catch(NullPointerException e) {
-            // expected
-        }
     }
 
     static class MyClassLoader extends ClassLoader { }