< prev index next >

test/runtime/modules/PatchModule/PatchModuleJavaBase.java

Print this page

        

*** 22,41 **** */ /* * @test * @bug 8130399 ! * @summary Make sure -Xpatch works for java.base. * @modules java.base/jdk.internal.misc * @library /testlibrary ! * @compile XpatchMain.java ! * @run main XpatchJavaBase */ import jdk.test.lib.*; ! public class XpatchJavaBase { public static void main(String[] args) throws Exception { String source = "package java.lang; " + "public class NewClass { " + " static { " + --- 22,41 ---- */ /* * @test * @bug 8130399 ! * @summary Make sure --patch-module works for java.base. * @modules java.base/jdk.internal.misc * @library /testlibrary ! * @compile PatchModuleMain.java ! * @run main PatchModuleJavaBase */ import jdk.test.lib.*; ! public class PatchModuleJavaBase { public static void main(String[] args) throws Exception { String source = "package java.lang; " + "public class NewClass { " + " static { " +
*** 45,56 **** ClassFileInstaller.writeClassToDisk("java/lang/NewClass", InMemoryJavaCompiler.compile("java.lang.NewClass", source, "-Xmodule:java.base"), "mods/java.base"); ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base", ! "XpatchMain", "java.lang.NewClass"); new OutputAnalyzer(pb.start()) .shouldContain("I pass!") .shouldHaveExitValue(0); } --- 45,56 ---- ClassFileInstaller.writeClassToDisk("java/lang/NewClass", InMemoryJavaCompiler.compile("java.lang.NewClass", source, "-Xmodule:java.base"), "mods/java.base"); ! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", ! "PatchModuleMain", "java.lang.NewClass"); new OutputAnalyzer(pb.start()) .shouldContain("I pass!") .shouldHaveExitValue(0); }
< prev index next >