hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java
changeset 43605 07baf498d588
parent 41705 332239c052cc
equal deleted inserted replaced
43604:49949d36e3f9 43605:07baf498d588
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2015, 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.
    35 public class ObsoleteFlagErrorMessage {
    35 public class ObsoleteFlagErrorMessage {
    36   public static void main(String[] args) throws Exception {
    36   public static void main(String[] args) throws Exception {
    37 
    37 
    38     // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449)
    38     // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449)
    39     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    39     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    40         "-XX:UseOldInliningPlusJunk", "-version");
    40         "-XX:ConvertSleepToYieldPlusJunk", "-version");
    41 
    41 
    42     OutputAnalyzer output = new OutputAnalyzer(pb.start());
    42     OutputAnalyzer output = new OutputAnalyzer(pb.start());
    43     output.shouldContain("Unrecognized VM option 'UseOldInliningPlusJunk'"); // Must identify bad option.
    43     output.shouldContain("Unrecognized VM option 'ConvertSleepToYieldPlusJunk'"); // Must identify bad option.
    44     output.shouldHaveExitValue(1);
    44     output.shouldHaveExitValue(1);
    45 
    45 
    46     // Case 2: Newly obsolete integer-valued flags should be recognized as newly obsolete (8073989)
    46     // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989)
    47     ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder(
    47     ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder(
    48         "-XX:NmethodSweepFraction=10", "-version");
    48         "-XX:+ConvertSleepToYield", "-version");
    49 
    49 
    50     OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
    50     OutputAnalyzer output2 = new OutputAnalyzer(pb2.start());
    51     output2.shouldContain("Ignoring option").shouldContain("support was removed");
    51     output2.shouldContain("Ignoring option").shouldContain("support was removed");
    52     output2.shouldContain("NmethodSweepFraction");
    52     output2.shouldContain("ConvertSleepToYield");
    53   }
    53   }
    54 }
    54 }