70 "--patch-module=java.naming=" + moduleJar,
71 "PatchMain", "javax.naming.spi.NamingManager");
72 output.shouldHaveExitValue(1)
73 .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module");
74
75 // Case 2: --patch-module specified for run time but not for dump time
76 System.out.println("Case 2: --patch-module specified for run time but not for dump time");
77 output =
78 TestCommon.dump(null,
79 TestCommon.list("javax/naming/spi/NamingManager"),
80 "PatchMain", "javax.naming.spi.NamingManager");
81 TestCommon.checkDump(output, "Loading classes to share");
82
83 // javax.naming.spi.NamingManager is patched at runtime
84 TestCommon.run(
85 "-XX:+UnlockDiagnosticVMOptions",
86 "--patch-module=java.naming=" + moduleJar,
87 "--patch-module=java.naming2=" + moduleJar,
88 "-Xlog:class+path=info",
89 "PatchMain", "javax.naming.spi.NamingManager")
90 .assertSilentlyDisabledCDS(out -> {
91 out.shouldHaveExitValue(0)
92 .shouldContain("I pass!");
93 });
94 }
95 }
|
70 "--patch-module=java.naming=" + moduleJar,
71 "PatchMain", "javax.naming.spi.NamingManager");
72 output.shouldHaveExitValue(1)
73 .shouldContain("Cannot use the following option when dumping the shared archive: --patch-module");
74
75 // Case 2: --patch-module specified for run time but not for dump time
76 System.out.println("Case 2: --patch-module specified for run time but not for dump time");
77 output =
78 TestCommon.dump(null,
79 TestCommon.list("javax/naming/spi/NamingManager"),
80 "PatchMain", "javax.naming.spi.NamingManager");
81 TestCommon.checkDump(output, "Loading classes to share");
82
83 // javax.naming.spi.NamingManager is patched at runtime
84 TestCommon.run(
85 "-XX:+UnlockDiagnosticVMOptions",
86 "--patch-module=java.naming=" + moduleJar,
87 "--patch-module=java.naming2=" + moduleJar,
88 "-Xlog:class+path=info",
89 "PatchMain", "javax.naming.spi.NamingManager")
90 .assertSilentlyDisabledCDS(0, "I pass!");
91 }
92 }
|