test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule

test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java

Print this page




  70         // Build the jar file that will be used for the module "java.naming".
  71         JarBuilder.build("javanaming", "javax/naming/spi/NamingManager");
  72         moduleJar = TestCommon.getTestJar("javanaming.jar");
  73 
  74         ClassFileInstaller.writeClassToDisk("javax/naming/spi/DirectoryManager",
  75              InMemoryJavaCompiler.compile("javax.naming.spi.DirectoryManager", source2, "--patch-module=java.naming"),
  76              System.getProperty("test.classes"));
  77 
  78         // Build the jar file that will be used for the module "java.naming".
  79         JarBuilder.build("javanaming2", "javax/naming/spi/DirectoryManager");
  80         moduleJar2 = TestCommon.getTestJar("javanaming2.jar");
  81 
  82         System.out.println("Test dumping with --patch-module");
  83         OutputAnalyzer output =
  84             TestCommon.dump(null,
  85                 TestCommon.list("javax/naming/spi/NamingManager"),
  86                 "--patch-module=java.naming=" + moduleJar2 + File.pathSeparator + moduleJar,
  87                 "-Xlog:class+load",
  88                 "-Xlog:class+path=info",
  89                 "PatchMain", "javax.naming.spi.NamingManager");
  90         TestCommon.checkDump(output, "Loading classes to share");

  91 
  92         TestCommon.run(
  93             "-XX:+UnlockDiagnosticVMOptions",
  94             "--patch-module=java.naming=" + moduleJar2 + File.pathSeparator + moduleJar,
  95             "-Xlog:class+load",
  96             "-Xlog:class+path=info",
  97             "PatchMain", "javax.naming.spi.NamingManager")
  98           .assertNormalExit("I pass");
  99     }
 100 }


  70         // Build the jar file that will be used for the module "java.naming".
  71         JarBuilder.build("javanaming", "javax/naming/spi/NamingManager");
  72         moduleJar = TestCommon.getTestJar("javanaming.jar");
  73 
  74         ClassFileInstaller.writeClassToDisk("javax/naming/spi/DirectoryManager",
  75              InMemoryJavaCompiler.compile("javax.naming.spi.DirectoryManager", source2, "--patch-module=java.naming"),
  76              System.getProperty("test.classes"));
  77 
  78         // Build the jar file that will be used for the module "java.naming".
  79         JarBuilder.build("javanaming2", "javax/naming/spi/DirectoryManager");
  80         moduleJar2 = TestCommon.getTestJar("javanaming2.jar");
  81 
  82         System.out.println("Test dumping with --patch-module");
  83         OutputAnalyzer output =
  84             TestCommon.dump(null,
  85                 TestCommon.list("javax/naming/spi/NamingManager"),
  86                 "--patch-module=java.naming=" + moduleJar2 + File.pathSeparator + moduleJar,
  87                 "-Xlog:class+load",
  88                 "-Xlog:class+path=info",
  89                 "PatchMain", "javax.naming.spi.NamingManager");
  90         output.shouldHaveExitValue(1)
  91               .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module");
  92 
  93         TestCommon.run(
  94             "-XX:+UnlockDiagnosticVMOptions",
  95             "--patch-module=java.naming=" + moduleJar2 + File.pathSeparator + moduleJar,
  96             "-Xlog:class+load",
  97             "-Xlog:class+path=info",
  98             "PatchMain", "javax.naming.spi.NamingManager")
  99             .assertSilentlyDisabledCDS(0, "I pass!");
 100     }
 101 }
test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File