< prev index next >

test/java/lang/invoke/modules/ModuleAccessControlTest.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 CompilerUtils jdk.testlibrary.*
+ * @build CompilerUtils jdk.testlibrary.tasks.JavaTask
  * @run testng ModuleAccessControlTest
  * @summary Driver for testing module access checking by MethodHandles.Lookup
  */
 
 public class ModuleAccessControlTest {

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