< prev index next >
test/runtime/modules/PatchModule/PatchModuleTestJar.java
Print this page
*** 21,42 ****
* questions.
*/
/*
* @test
! * @summary Make sure -Xpatch works when a jar file is specified for a module
* @library /testlibrary
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* @build BasicJarBuilder
! * @compile XpatchMain.java
! * @run main XpatchTestJar
*/
import jdk.test.lib.*;
! public class XpatchTestJar {
private static String moduleJar;
public static void main(String[] args) throws Exception {
// Create a class file in the module java.naming. This class file
--- 21,42 ----
* questions.
*/
/*
* @test
! * @summary Make sure --patch-module works when a jar file is specified for a module
* @library /testlibrary
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* @build BasicJarBuilder
! * @compile PatchModuleMain.java
! * @run main PatchModuleTestJar
*/
import jdk.test.lib.*;
! public class PatchModuleTestJar {
private static String moduleJar;
public static void main(String[] args) throws Exception {
// Create a class file in the module java.naming. This class file
*** 70,82 ****
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
System.getProperty("test.classes"));
! // Supply -Xpatch with the name of the jar file for the module java.naming.
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.naming=" + moduleJar,
! "XpatchMain", "javax.naming.spi.NamingManager");
new OutputAnalyzer(pb.start())
.shouldContain("I pass!")
.shouldHaveExitValue(0);
}
--- 70,82 ----
ClassFileInstaller.writeClassToDisk("javax/naming/spi/NamingManager",
InMemoryJavaCompiler.compile("javax.naming.spi.NamingManager", source, "-Xmodule:java.naming"),
System.getProperty("test.classes"));
! // Supply --patch-module with the name of the jar file for the module java.naming.
! ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.naming=" + moduleJar,
! "PatchModuleMain", "javax.naming.spi.NamingManager");
new OutputAnalyzer(pb.start())
.shouldContain("I pass!")
.shouldHaveExitValue(0);
}
< prev index next >