< prev index next >

test/tools/launcher/modules/addexports/AddExportsTest.java

Print this page

        

@@ -30,10 +30,11 @@
  * @summary Basic tests for java -XaddExports
  */
 
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.Arrays;
 
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;

@@ -146,15 +147,13 @@
         //  java -XaddExports:java.base/jdk.internal.misc=test \
         //       -mp mods -m $TESTMODULE/$MAIN_CLASS
 
         String mid = TEST1_MODULE + "/" + TEST1_MAIN_CLASS;
         int exitValue =
-            executeTestJava("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE,
-                            "-mp", MODS_DIR.toString(),
-                            "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
+            executeModularTest(mid, null,
+                Arrays.asList("-XaddExports:java.base/jdk.internal.misc=" + TEST1_MODULE),
+                null, Arrays.asList(MODS_DIR), null)
                 .getExitValue();
 
         assertTrue(exitValue == 0);
     }
 

@@ -165,17 +164,14 @@
     public void testWithUpgradedModule() throws Exception {
 
         // java -XaddExports:java.transaction/javax.transaction.internal=m2
         //      -upgrademodulepath upgrademods -mp mods -m ...
         String mid = TEST2_MODULE + "/" + TEST2_MAIN_CLASS;
-        int exitValue = executeTestJava(
-                "-XaddExports:java.transaction/javax.transaction.internal=m2",
-                "-upgrademodulepath", UPGRADE_MODS_DIRS.toString(),
-                "-mp", MODS_DIR.toString(),
-                "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
+        int exitValue = executeModularTest(mid, null,
+            Arrays.asList("-XaddExports:java.transaction/javax.transaction.internal=m2",
+                          "-upgrademodulepath", UPGRADE_MODS_DIRS.toString()),
+            null, Arrays.asList(MODS_DIR), null)
                 .getExitValue();
 
         assertTrue(exitValue == 0);
     }
 

@@ -186,17 +182,14 @@
      */
     public void testWithAddMods() throws Exception {
 
         // java -XaddExports:m4/jdk.test4=m3 -mp mods -m ...
         String mid = TEST3_MODULE + "/" + TEST3_MAIN_CLASS;
-        int exitValue = executeTestJava(
-                "-XaddExports:m4/jdk.test4=m3",
-                "-mp", MODS_DIR.toString(),
-                "-addmods", TEST4_MODULE,
-                "-m", mid)
-                .outputTo(System.out)
-                .errorTo(System.out)
+        int exitValue = executeModularTest(mid, null,
+            Arrays.asList("-XaddExports:m4/jdk.test4=m3"),
+            null, Arrays.asList(MODS_DIR),
+            Arrays.asList(TEST4_MODULE))
                 .getExitValue();
 
         assertTrue(exitValue == 0);
     }
 
< prev index next >