test/compiler/arguments/BMISupportedCPUTest.java

Print this page




  43      * @param optionName Name of the option to be tested
  44      *                   without -XX:[+-] prefix.
  45      * @param warningMessage Message that can occur in VM output
  46      *                       if CPU on test box does not support
  47      *                       features required by the option.
  48      * @param cpuFeatures CPU features requires by the option.
  49      */
  50     public BMISupportedCPUTest(String optionName,
  51                                String warningMessage,
  52                                String... cpuFeatures) {
  53         super(optionName, warningMessage, cpuFeatures, null);
  54     }
  55 
  56     @Override
  57     public void runTestCases() throws Throwable {
  58         /*
  59           Verify that VM will successfully start up without warnings.
  60           VM will be launched with following flags:
  61           -XX:+<tested option> -version
  62         */


  63         CommandLineOptionTest.verifySameJVMStartup(null,
  64                 new String[] { warningMessage }, ExitCode.OK,

  65                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  66 
  67         /*
  68           Verify that VM will successfully start up without warnings.
  69           VM will be launched with following flags:
  70           -XX:-<tested option> -version
  71         */


  72         CommandLineOptionTest.verifySameJVMStartup(null,
  73                 new String[] { warningMessage }, ExitCode.OK,

  74                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
  75 
  76         /*
  77           Verify that on appropriate CPU option in on by default.
  78           VM will be launched with following flags:
  79           -version
  80         */
  81         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");


  82 
  83         /*
  84           Verify that option could be explicitly turned off.
  85           VM will be launched with following flags:
  86           -XX:-<tested option> -version
  87         */
  88         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",


  89                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
  90     }
  91 }
  92 


  43      * @param optionName Name of the option to be tested
  44      *                   without -XX:[+-] prefix.
  45      * @param warningMessage Message that can occur in VM output
  46      *                       if CPU on test box does not support
  47      *                       features required by the option.
  48      * @param cpuFeatures CPU features requires by the option.
  49      */
  50     public BMISupportedCPUTest(String optionName,
  51                                String warningMessage,
  52                                String... cpuFeatures) {
  53         super(optionName, warningMessage, cpuFeatures, null);
  54     }
  55 
  56     @Override
  57     public void runTestCases() throws Throwable {
  58         /*
  59           Verify that VM will successfully start up without warnings.
  60           VM will be launched with following flags:
  61           -XX:+<tested option> -version
  62         */
  63         String errorString = String.format("JVM should start with '-XX:+%s'"
  64                 + " flag without any warnings", optionName);
  65         CommandLineOptionTest.verifySameJVMStartup(null,
  66                 new String[] { warningMessage }, errorString, errorString,
  67                 ExitCode.OK,                
  68                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
  69 
  70         /*
  71           Verify that VM will successfully start up without warnings.
  72           VM will be launched with following flags:
  73           -XX:-<tested option> -version
  74         */
  75         errorString = String.format("JVM should start with '-XX:-%s'"
  76                 + " flag without any warnings", optionName);
  77         CommandLineOptionTest.verifySameJVMStartup(null,
  78                 new String[] { warningMessage }, errorString,
  79                 errorString, ExitCode.OK,
  80                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
  81 
  82         /*
  83           Verify that on appropriate CPU option in on by default.
  84           VM will be launched with following flags:
  85           -version
  86         */
  87         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  88                 String.format("Option '%s' is expected to have default value "
  89                     + "'true'", optionName));
  90 
  91         /*
  92           Verify that option could be explicitly turned off.
  93           VM will be launched with following flags:
  94           -XX:-<tested option> -version
  95         */
  96         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
  97                 String.format("Option '%s' is set to have value 'false'",
  98                     optionName),
  99                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
 100     }
 101 }
 102