< prev index next >

test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java

Print this page

        

@@ -31,12 +31,13 @@
  */
 
 import java.io.File;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.Arrays;
 
-import static jdk.testlibrary.ProcessTools.executeTestJava;
+import static jdk.testlibrary.ProcessTools.executeModularTest;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 

@@ -89,16 +90,13 @@
     public void testWithUpgradedModule() throws Exception {
 
         String mid = "test/jdk.test.Main";
 
         int exitValue
-            = executeTestJava(
-                "-upgrademodulepath", UPGRADEDMODS_DIR.toString(),
-                "-mp", MODS_DIR.toString(),
-                "-m", mid)
-            .outputTo(System.out)
-            .errorTo(System.out)
+            = executeModularTest(mid, null,
+                Arrays.asList( "-upgrademodulepath", UPGRADEDMODS_DIR.toString()),
+                null, Arrays.asList(MODS_DIR), null)
             .getExitValue();
 
         assertTrue(exitValue == 0);
 
     }

@@ -113,16 +111,13 @@
         String upgrademodulepath
             = "DoesNotExit" + File.pathSeparator + UPGRADEDMODS_DIR.toString();
         String mid = "test/jdk.test.Main";
 
         int exitValue
-            = executeTestJava(
-                "-upgrademodulepath", upgrademodulepath,
-                "-mp", MODS_DIR.toString(),
-                "-m", mid)
-            .outputTo(System.out)
-            .errorTo(System.out)
+            = executeModularTest(mid, null,
+                Arrays.asList("-upgrademodulepath", upgrademodulepath),
+                null, Arrays.asList(MODS_DIR), null)
             .getExitValue();
 
         assertTrue(exitValue == 0);
 
     }
< prev index next >