16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import jdk.test.lib.process.ProcessTools;
25 import jdk.test.lib.process.OutputAnalyzer;
26 import jdk.test.lib.Platform;
27
28 /*
29 * @test
30 * @bug 8129855
31 * @summary -XX:+IgnoreUnrecognizedVMOptions should work according to the spec from JDK-8129855
32 *
33 * @library /test/lib
34 * @modules java.base/jdk.internal.misc
35 * java.management
36 * @run main IgnoreUnrecognizedVMOptions
37 */
38 public class IgnoreUnrecognizedVMOptions {
39
40 private static void runJavaAndCheckExitValue(boolean shouldSucceed, String... args) throws Exception {
41 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
42 OutputAnalyzer output = new OutputAnalyzer(pb.start());
43 if (shouldSucceed) {
44 output.shouldHaveExitValue(0);
45 } else {
46 output.shouldHaveExitValue(1);
47 }
48 }
49
50 public static void main(String[] args) throws Exception {
51 boolean product = !Platform.isDebugBuild();
52
53 /*
54 #1.1 wrong value and non-existing flag:
55 exists, invalid value does not exist
56 -XX:MinHeapFreeRatio=notnum -XX:THIS_FLAG_DOESNT_EXIST
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import jdk.test.lib.process.ProcessTools;
25 import jdk.test.lib.process.OutputAnalyzer;
26 import jdk.test.lib.Platform;
27
28 /*
29 * @test
30 * @bug 8129855
31 * @summary -XX:+IgnoreUnrecognizedVMOptions should work according to the spec from JDK-8129855
32 *
33 * @library /test/lib
34 * @modules java.base/jdk.internal.misc
35 * java.management
36 * @run driver IgnoreUnrecognizedVMOptions
37 */
38 public class IgnoreUnrecognizedVMOptions {
39
40 private static void runJavaAndCheckExitValue(boolean shouldSucceed, String... args) throws Exception {
41 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
42 OutputAnalyzer output = new OutputAnalyzer(pb.start());
43 if (shouldSucceed) {
44 output.shouldHaveExitValue(0);
45 } else {
46 output.shouldHaveExitValue(1);
47 }
48 }
49
50 public static void main(String[] args) throws Exception {
51 boolean product = !Platform.isDebugBuild();
52
53 /*
54 #1.1 wrong value and non-existing flag:
55 exists, invalid value does not exist
56 -XX:MinHeapFreeRatio=notnum -XX:THIS_FLAG_DOESNT_EXIST
|