< prev index next >

test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java

Print this page
rev 52333 : imported patch 8213058


  36 
  37 public class VMOptionWarning {
  38     public static void main(String[] args) throws Exception {
  39         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version");
  40         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  41         output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.");
  42 
  43         if (Platform.isDebugBuild()) {
  44             System.out.println("Skip the rest of the tests on debug builds since diagnostic, develop, and notproduct options are available on debug builds.");
  45             return;
  46         }
  47 
  48         pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version");
  49         output = new OutputAnalyzer(pb.start());
  50         output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.");
  51 
  52         pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version");
  53         output = new OutputAnalyzer(pb.start());
  54         output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
  55 
  56         pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version");
  57         output = new OutputAnalyzer(pb.start());
  58         output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM.");
  59     }
  60 }


  36 
  37 public class VMOptionWarning {
  38     public static void main(String[] args) throws Exception {
  39         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version");
  40         OutputAnalyzer output = new OutputAnalyzer(pb.start());
  41         output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.");
  42 
  43         if (Platform.isDebugBuild()) {
  44             System.out.println("Skip the rest of the tests on debug builds since diagnostic, develop, and notproduct options are available on debug builds.");
  45             return;
  46         }
  47 
  48         pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version");
  49         output = new OutputAnalyzer(pb.start());
  50         output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.");
  51 
  52         pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version");
  53         output = new OutputAnalyzer(pb.start());
  54         output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
  55 
  56         pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version");
  57         output = new OutputAnalyzer(pb.start());
  58         output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM.");
  59     }
  60 }
< prev index next >