< prev index next >

test/java/util/ResourceBundle/modules/security/TestPermission.java

Print this page

        

@@ -24,21 +24,21 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
 
-import static jdk.testlibrary.ProcessTools.executeTestJava;
+import jdk.testlibrary.tasks.JavaTask;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
 /**
  * @test
  * @library /lib/testlibrary
  * @modules jdk.compiler
- * @build TestPermission CompilerUtils jdk.testlibrary.*
+ * @build TestPermission CompilerUtils jdk.testlibrary.tasks.JavaTask
  * @run testng TestPermission
  * @summary Driver for testing ResourceBundle::getBundle(String, Module)
  */
 
 public class TestPermission {

@@ -66,15 +66,11 @@
     /**
      * Run the modular test
      */
     @Test
     public void runTest() throws Exception {
-        int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
-                                        "--add-modules", "m1",
-                                        "-m", "test/jdk.test.Main")
-                            .outputTo(System.out)
-                            .errorTo(System.out)
-                            .getExitValue();
-
-        assertTrue(exitValue == 0);
+        new JavaTask().ignoreStandardModuleOptions()
+           .modulepath(MODS_DIR.toString())
+           .addModules("m1")
+           .moduleName("test").className("jdk.test.Main").run();
     }
 }
< prev index next >