test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
changeset 47903 7f22774a5f42
parent 47776 52e85a3fa0ab
child 48108 9d00b6f9cbed
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Wed Nov 15 08:25:28 2017 -0500
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java	Wed Nov 15 10:34:17 2017 -0500
@@ -88,9 +88,23 @@
         output.shouldMatch(match);
     }
 
+    // Deprecated experimental command line options need to be preceded on the
+    // command line by -XX:+UnlockExperimentalVMOption.
+    static void testDeprecatedExperimental(String option, String value)  throws Throwable {
+        String XXoption = CommandLineOptionTest.prepareFlag(option, value);
+        ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, XXoption, "-version");
+        OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
+        // check for option deprecation message:
+        output.shouldHaveExitValue(0);
+        String match = getDeprecationString(option);
+        output.shouldMatch(match);
+    }
+
     public static void main(String[] args) throws Throwable {
         testDeprecated(DEPRECATED_OPTIONS);  // Make sure that each deprecated option is mentioned in the output.
         testDeprecatedDiagnostic("UnsyncloadClass", "false");
         testDeprecatedDiagnostic("IgnoreUnverifiableClassesDuringDump", "false");
+        testDeprecatedExperimental("UseCGroupMemoryLimitForHeap", "true");
     }
 }