< prev index next >

test/java/util/logging/modules/GetResourceBundleTest.java

Print this page

        

@@ -22,10 +22,12 @@
  */
 
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.Collections;
+import java.util.Arrays;
 
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

@@ -80,30 +82,20 @@
         Files.copy(PKG_SRC_DIR.resolve(p3), PKG_DEST_DIR.resolve(p3), REPLACE_EXISTING);
     }
 
     @Test
     public void runWithoutSecurityManager() throws Exception {
-        int exitValue = executeTestJava(
-                "-cp", PKG_DEST_DIR.toString(),
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
-                "p3.test.ResourceBundleTest")
-                .outputTo(System.out)
-                .errorTo(System.err)
+        int exitValue = executeModularTest(null, "p3.test.ResourceBundleTest", null,
+            Arrays.asList(PKG_DEST_DIR), Arrays.asList(MOD_DEST_DIR), Arrays.asList(modules))
                 .getExitValue();
         assertTrue(exitValue == 0);
     }
 
     @Test
     public void runWithSecurityManager() throws Exception {
-        int exitValue = executeTestJava(
-                "-Djava.security.manager",
-                "-cp", PKG_DEST_DIR.toString(),
-                "-mp", MOD_DEST_DIR.toString(),
-                "-addmods", String.join(",", modules),
-                "p3.test.ResourceBundleTest")
-                .outputTo(System.out)
-                .errorTo(System.err)
+        int exitValue = executeModularTest(null, "p3.test.ResourceBundleTest",
+            Arrays.asList("-Djava.security.manager"),
+            Arrays.asList(PKG_DEST_DIR), Arrays.asList(MOD_DEST_DIR), Arrays.asList(modules))
                 .getExitValue();
         assertTrue(exitValue == 0);
     }
 }
< prev index next >