< prev index next >

test/runtime/modules/Visibility/PatchModuleVisibility.java

Print this page

        

@@ -21,26 +21,26 @@
  * questions.
  */
 
 /*
  * @test
- * @summary Ensure that a newly introduced java.base package placed within the -Xpatch directory
- *          is considered part of the boot loader's visibility boundary
+ * @summary Ensure that a newly introduced java.base package placed within the --patch-module
+ *          directory is considered part of the boot loader's visibility boundary
  * @requires !(os.family == "windows")
  * @library /testlibrary
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main/othervm XpatchVisibility
+ * @run main/othervm PatchModuleVisibility
  */
 
 import java.io.File;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 
 import jdk.test.lib.*;
 
-public class XpatchVisibility {
+public class PatchModuleVisibility {
 
     public static void main(String[] args) throws Throwable {
 
       String Vis2_B_src =
               "package p2;" +

@@ -53,23 +53,23 @@
       String Vis2_A_src =
               "import p2.*;" +
               "public class Vis2_A {" +
               "    public static void main(String args[]) throws Exception {" +
                       // Try loading a class within a newly introduced java.base
-                      // package.  Make sure the class can be found via -Xpatch.
+                      // package.  Make sure the class can be found via --patch-module.
               "        try {" +
               "            p2.Vis2_B b = new p2.Vis2_B();" +
               "            if (b.getClass().getClassLoader() != null) {" +
-              "                throw new RuntimeException(\"XpatchVisibility FAILED - class B " +
+              "                throw new RuntimeException(\"PatchModuleVisibility FAILED - class B " +
                                                            "should be loaded by boot class loader\\n\");" +
               "            }" +
               "            b.m();" +
               "        } catch (Throwable e) {" +
-              "            throw new RuntimeException(\"XpatchVisibility FAILED - test " +
+              "            throw new RuntimeException(\"PatchModuleVisibility FAILED - test " +
                                                        "should not throw an error or exception\\n\");" +
               "        }" +
-              "        System.out.println(\"XpatchVisibility PASSED\\n\");" +
+              "        System.out.println(\"PatchModuleVisibility PASSED\\n\");" +
               "    }" +
               "}";
 
       ClassFileInstaller.writeClassToDisk("p2/Vis2_B",
           InMemoryJavaCompiler.compile("p2.Vis2_B", Vis2_B_src), System.getProperty("test.classes"));

@@ -81,11 +81,11 @@
       // Make sure the classes are actually being loaded from mods2
       Files.delete(Paths.get(System.getProperty("test.classes") +  File.separator +
                                                            "p2" + File.separator + "Vis2_B.class"));
 
       new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(
-              "-Xpatch:java.base=mods2/java.base",
-              "-XaddExports:java.base/p2=ALL-UNNAMED",
+              "--patch-module=java.base=mods2/java.base",
+              "--add-exports=java.base/p2=ALL-UNNAMED",
               "Vis2_A")
           .start()).shouldHaveExitValue(0);
     }
 }
< prev index next >