< 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 {

@@ -65,16 +65,13 @@
 
     /**
      * 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);
+    public void runTest() {
+        new JavaTask().ignoreStandardModuleOptions()
+           .modulePath(MODS_DIR)
+           .addModules("m1")
+           .module("test", "jdk.test.Main")
+           .run();
     }
 }
< prev index next >