< prev index next >

test/jdk/tools/launcher/ExecutionEnvironment.java

Print this page
rev 51718 : 8210669: Some launcher tests assume a pre-JDK 9 run-time image layout
rev 51719 : 8210670: Accept double-dash VM-name options at launch time

@@ -35,11 +35,12 @@
  * This tests for various things as follows:
  * Ensures that:
  *   1. uneccessary execs do not occur
  *   2. the environment is pristine,  users environment variable wrt.
  *      LD_LIBRARY_PATH if set are not modified in any way.
- *   3. the correct vm is chosen with -server and -client options
+ *   3. the correct vm is chosen with -server/--server and -client/--client
+ *      options
  *   4. the VM on Solaris correctly interprets the LD_LIBRARY_PATH32
  *      and LD_LIBRARY_PATH64 variables if set by the user, ie.
  *      i. on 32 bit systems:
  *         a. if LD_LIBRARY_PATH32 is set it will override LD_LIBRARY_PATH
  *         b. LD_LIBRARY_PATH64 is ignored if set

@@ -256,13 +257,15 @@
             throw new RuntimeException(msg);
         }
     }
 
     private void tryVmOption(String opt, String expected) {
-        TestResult tr = doExec(javaCmd, opt, "-version");
+        for (String o : new String[] { opt, "-" + opt }) {
+            TestResult tr = doExec(javaCmd, o, "-version");
         if (!tr.matches(expected)) {
-            flagError(tr, "the expected vm " + opt + " did not launch");
+                flagError(tr, "the expected vm " + o + " did not launch");
+            }
         }
     }
 
     /*
      * checks to see there is no extra libjvm.so than needed
< prev index next >