--- old/test/tools/launcher/modules/patch/basic/PatchTest.java 2016-10-14 15:06:54.000000000 -0700 +++ new/test/tools/launcher/modules/patch/basic/PatchTest.java 2016-10-14 15:06:54.000000000 -0700 @@ -25,7 +25,8 @@ * @test * @library /lib/testlibrary * @modules jdk.compiler - * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.* + * java.naming + * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.tasks.* * @run testng PatchTest * @summary Basic test for --patch-module */ @@ -37,7 +38,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static jdk.testlibrary.ProcessTools.*; +import jdk.testlibrary.tasks.JavaTask; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -136,22 +137,21 @@ // 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); + 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(); }