< prev index next >

test/tools/launcher/modules/patch/basic/PatchTest.java

Print this page

        

*** 23,33 **** /** * @test * @library /lib/testlibrary * @modules jdk.compiler ! * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.* * @run testng PatchTest * @summary Basic test for --patch-module */ import java.io.File; --- 23,34 ---- /** * @test * @library /lib/testlibrary * @modules jdk.compiler ! * java.naming ! * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.tasks.* * @run testng PatchTest * @summary Basic test for --patch-module */ import java.io.File;
*** 35,45 **** import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Collectors; import java.util.stream.Stream; ! import static jdk.testlibrary.ProcessTools.*; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.Assert.*; --- 36,46 ---- import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Collectors; import java.util.stream.Stream; ! import jdk.testlibrary.tasks.JavaTask; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.Assert.*;
*** 134,159 **** throws Exception { // the argument to the test is the list of classes overridden or added String arg = Stream.of(CLASSES).collect(Collectors.joining(",")); ! int exitValue ! = executeTestJava("--patch-module", "java.base=" + basePatches, ! "--patch-module", "jdk.naming.dns=" + dnsPatches, ! "--patch-module", "jdk.compiler=" + compilerPatches, ! "--add-exports", "java.base/java.lang2=test", ! "--add-exports", "jdk.naming.dns/com.sun.jndi.dns=test", ! "--add-exports", "jdk.naming.dns/com.sun.jndi.dns2=test", ! "--add-exports", "jdk.compiler/com.sun.tools.javac2=test", ! "--add-modules", "jdk.naming.dns,jdk.compiler", ! "--module-path", MODS_DIR.toString(), ! "-m", "test/jdk.test.Main", arg) ! .outputTo(System.out) ! .errorTo(System.out) ! .getExitValue(); ! ! assertTrue(exitValue == 0); } /** * Run test with ---patch-module and exploded patches --- 135,159 ---- throws Exception { // the argument to the test is the list of classes overridden or added String arg = Stream.of(CLASSES).collect(Collectors.joining(",")); ! new JavaTask() ! .patchModule( ! "java.base=" + basePatches, ! "jdk.naming.dns=" + dnsPatches, ! "jdk.compiler=" + compilerPatches) ! .addExports( ! "java.base/java.lang2=test", ! "jdk.naming.dns/com.sun.jndi.dns=test", ! "jdk.naming.dns/com.sun.jndi.dns2=test", ! "jdk.compiler/com.sun.tools.javac2=test") ! .addModules("jdk.naming.dns,jdk.compiler") ! .modulePath(MODS_DIR) ! .module("test", "jdk.test.Main") ! .classArgs(arg) ! .run(); } /** * Run test with ---patch-module and exploded patches
< prev index next >