--- old/test/compiler/arguments/BMICommandLineOptionTestBase.java 2014-05-12 22:20:20.372109615 +0400 +++ new/test/compiler/arguments/BMICommandLineOptionTestBase.java 2014-05-12 22:20:20.244109609 +0400 @@ -58,10 +58,11 @@ String supportedCPUFeatures[], String unsupportedCPUFeatures[]) { super(".*", supportedCPUFeatures, unsupportedCPUFeatures); - this.optionName = optionName; - this.warningMessage = warningMessage; - this.errorMessage = CommandLineOptionTest. - UNRECOGNIZED_OPTION_ERROR_FORMAT.format(optionName); + this.optionName = optionName; + this.warningMessage = warningMessage; + this.errorMessage = String.format( + CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT, + optionName); } } --- old/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java 2014-05-12 22:20:20.384109616 +0400 +++ new/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java 2014-05-12 22:20:20.268109610 +0400 @@ -25,7 +25,7 @@ * @test * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option - * on CPU without TZCNT instuction (BMI1 feature) support. + * on CPU without TZCNT instruction (BMI1 feature) support. * @library /testlibrary /testlibrary/whitebox * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU * BMIUnsupportedCPUTest @@ -40,7 +40,8 @@ import com.oracle.java.testlibrary.cli.*; public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU - extends BMIUnsupportedCPUTest { + extends BMIUnsupportedCPUTest { + private static final String ENABLE_BMI = "-XX:+UseBMI1Instructions"; public TestUseCountTrailingZerosInstructionOnUnsupportedCPU() { super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); @@ -52,15 +53,15 @@ super.unsupportedX86CPUTestCases(); // verify that option will not be turned on during - // UseBMI1Instuctions processing - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:+UseBMI1Instructions"); - - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:+UseCountTrailingZerosInstruction", - "-XX:+UseBMI1Instructions"); + // UseBMI1Instructions processing + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + TestUseCountTrailingZerosInstructionOnUnsupportedCPU. + ENABLE_BMI); + + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, true), + TestUseCountTrailingZerosInstructionOnUnsupportedCPU. + ENABLE_BMI); } public static void main(String args[]) throws Throwable { --- old/test/compiler/arguments/BMIUnsupportedCPUTest.java 2014-05-12 22:20:20.424109618 +0400 +++ new/test/compiler/arguments/BMIUnsupportedCPUTest.java 2014-05-12 22:20:20.300109612 +0400 @@ -64,28 +64,25 @@ */ public void unsupportedX86CPUTestCases() throws Throwable { - // verify that VM will succesfully start up, but output will + // verify that VM will successfully start up, but output will // contain a warning - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - new String[] { warningMessage }, - new String[] { errorMessage }, - ExitCode.OK); - - // verify that VM will succesfully startup without any warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - null, - new String[] { warningMessage, errorMessage }, - ExitCode.OK); + CommandLineOptionTest.verifySameJVMStartup( + new String[] { warningMessage }, new String[] { errorMessage }, + ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag( + optionName, true)); + + // verify that VM will successfully startup without any warnings + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage, errorMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); // verify that on unsupported CPUs option is off by default - CommandLineOptionTest.verifyOptionValue(optionName, "false"); + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false"); // verify that on unsupported CPUs option will be off even if - // it was explicitly turned on by uset - CommandLineOptionTest.verifyOptionValue(optionName, "false", - "-XX:+" + optionName); + // it was explicitly turned on by user + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); } @@ -98,17 +95,13 @@ public void unsupportedNonX86CPUTestCases() throws Throwable { // verify that VM known nothing about tested option - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - new String[] { errorMessage }, - null, - ExitCode.FAIL); - - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - new String[] { errorMessage }, - null, - ExitCode.FAIL); + CommandLineOptionTest.verifySameJVMStartup( + new String[] { errorMessage }, null, ExitCode.FAIL, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); + + CommandLineOptionTest.verifySameJVMStartup( + new String[] { errorMessage }, null, ExitCode.FAIL, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); } } --- old/test/compiler/arguments/BMISupportedCPUTest.java 2014-05-12 22:20:20.432109618 +0400 +++ new/test/compiler/arguments/BMISupportedCPUTest.java 2014-05-12 22:20:20.304109612 +0400 @@ -49,24 +49,22 @@ @Override public void runTestCases() throws Throwable { - // verify that VM will succesfully start up whithout warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:+" + optionName, - null, new String[] { warningMessage }, - ExitCode.OK); + // verify that VM will successfully start up without warnings + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); - // verify that VM will succesfully start up whithout warnings - CommandLineOptionTest. - verifyJVMStartup("-XX:-" + optionName, - null, new String[] { warningMessage }, - ExitCode.OK); + // verify that VM will successfully start up without warnings + CommandLineOptionTest.verifySameJVMStartup(null, + new String[] { warningMessage }, ExitCode.OK, + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); // verify that on appropriate CPU option in on by default - CommandLineOptionTest.verifyOptionValue(optionName, "true"); + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true"); // verify that option could be explicitly turned off - CommandLineOptionTest.verifyOptionValue(optionName, "false", - "-XX:-" + optionName); + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + CommandLineOptionTest.prepareBooleanFlag(optionName, false)); } } --- old/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java 2014-05-12 22:20:20.504109621 +0400 +++ new/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java 2014-05-12 22:20:20.376109615 +0400 @@ -40,7 +40,8 @@ import com.oracle.java.testlibrary.cli.*; public class TestUseCountTrailingZerosInstructionOnSupportedCPU - extends BMISupportedCPUTest { + extends BMISupportedCPUTest { + private static final String DISABLE_BMI = "-XX:-UseBMI1Instructions"; public TestUseCountTrailingZerosInstructionOnSupportedCPU() { super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); @@ -51,18 +52,16 @@ super.runTestCases(); - // verify that option will be disabled if all BMI1 instuctions + // verify that option will be disabled if all BMI1 instructions // are explicitly disabled - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "false", - "-XX:-UseBMI1Instructions"); + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", + TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI); // verify that option could be turned on even if other BMI1 // instructions were turned off - CommandLineOptionTest. - verifyOptionValue("UseCountTrailingZerosInstruction", "true", - "-XX:-UseBMI1Instructions", - "-XX:+UseCountTrailingZerosInstruction"); + CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true", + TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI, + CommandLineOptionTest.prepareBooleanFlag(optionName, true)); } public static void main(String args[]) throws Throwable {