test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java

Print this page

        

*** 52,90 **** @Override public void runTestCases() throws Throwable { String unrecongnizedOption = CommandLineOptionTest.getUnrecognizedOptionErrorMessage( "UseRTMLocking"); // verify that there are no warning or error in VM output CommandLineOptionTest.verifySameJVMStartup(null, new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption ! }, ExitCode.OK, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking" ); CommandLineOptionTest.verifySameJVMStartup(null, new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption ! }, ExitCode.OK, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking" ); // verify that UseRTMLocking is of by default CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); // verify that we can change UseRTMLocking value CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking"); CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", ! "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking"); } public static void main(String args[]) throws Throwable { new TestUseRTMLockingOptionOnSupportedConfig().test(); --- 52,101 ---- @Override public void runTestCases() throws Throwable { String unrecongnizedOption = CommandLineOptionTest.getUnrecognizedOptionErrorMessage( "UseRTMLocking"); + String shouldPassMessage = "VM option 'UseRTMLocking' is experimental" + + "%nJVM startup should pass with " + + "-XX:+UnlockExperimentalVMOptions flag"; // verify that there are no warning or error in VM output CommandLineOptionTest.verifySameJVMStartup(null, new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption ! }, shouldPassMessage, "There should not be any warning when use" ! + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking" ); CommandLineOptionTest.verifySameJVMStartup(null, new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption ! }, shouldPassMessage, "There should not be any warning when use" ! + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK, CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking" ); // verify that UseRTMLocking is of by default CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, + String.format("Default value of option 'UseRTMLocking' should " + + "be '%s'", DEFAULT_VALUE), CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); // verify that we can change UseRTMLocking value CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, + String.format("Default value of option 'UseRTMLocking' should " + + "be '%s'", DEFAULT_VALUE), CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking"); CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", ! "true", "Value of 'UseRTMLocking' should be set " ! + "to 'true' if -XX:+UseRTMLocking flag set", ! CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking"); } public static void main(String args[]) throws Throwable { new TestUseRTMLockingOptionOnSupportedConfig().test();