< prev index next >

test/tools/launcher/modules/addmods/AddModsTest.java

Print this page

        

@@ -29,10 +29,11 @@
  * @build AddModsTest CompilerUtils jdk.testlibrary.*
  * @run testng AddModsTest
  * @summary Basic test for java --add-modules
  */
 
+import java.io.File;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
 import static jdk.testlibrary.ProcessTools.*;
 

@@ -222,10 +223,31 @@
         assertTrue(exitValue == 0);
     }
 
 
     /**
+     * Tests {@code --add-modules} be specified more than once.
+     */
+    public void testWithMultipleAddModules() throws Exception {
+
+        String modulepath = MODS1_DIR.toString() + File.pathSeparator +
+                                MODS2_DIR.toString();
+        int exitValue
+            = executeTestJava("--module-path", modulepath,
+            "--add-modules", LOGGER_MODULE,
+            "--add-modules", TEST_MODULE,
+            "-m", TEST_MID,
+            "logger.Logger")
+            .outputTo(System.out)
+            .errorTo(System.out)
+            .getExitValue();
+
+        assertTrue(exitValue == 0);
+    }
+
+
+    /**
      * Attempt to run with a bad module name specified to --add-modules
      */
     public void testRunWithBadAddMods() throws Exception {
 
         // java --module-path mods --add-modules DoesNotExist -m test ...
< prev index next >