equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
34 import jdk.test.lib.process.OutputAnalyzer; |
34 import jdk.test.lib.process.OutputAnalyzer; |
35 import jdk.test.lib.Platform; |
35 import jdk.test.lib.Platform; |
36 |
36 |
37 public class VMOptionWarning { |
37 public class VMOptionWarning { |
38 public static void main(String[] args) throws Exception { |
38 public static void main(String[] args) throws Exception { |
39 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PredictedLoadedClassCount", "-version"); |
39 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version"); |
40 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
40 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
41 output.shouldContain("Error: VM option 'PredictedLoadedClassCount' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions."); |
41 output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions."); |
42 |
42 |
43 if (Platform.isDebugBuild()) { |
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."); |
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; |
45 return; |
46 } |
46 } |