提交 0d7187f3 编写于 作者: F fzhinkin

8054805: Update CLI tests on RTM options to reflect changes in JDK-8054376

Reviewed-by: kvn
上级 66dcdbff
......@@ -35,7 +35,7 @@ public class TestRTMRetryCountOption extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "5";
private TestRTMRetryCountOption() {
super(Boolean.TRUE::booleanValue, "RTMRetryCount", false, true,
super(Boolean.TRUE::booleanValue, "RTMRetryCount", false, false,
TestRTMRetryCountOption.DEFAULT_VALUE,
"0", "10", "100", "1000");
}
......
......@@ -50,38 +50,25 @@ public class TestUseRTMDeoptOptionOnSupportedConfig
@Override
public void runTestCases() throws Throwable {
String experimentalOptionError
= CommandLineOptionTest.getExperimentalOptionErrorMessage(
"UseRTMDeopt");
// verify that option is experimental
CommandLineOptionTest.verifySameJVMStartup(
new String[] { experimentalOptionError }, null, ExitCode.FAIL,
"-XX:+UseRTMDeopt");
// verify that option could be turned on
CommandLineOptionTest.verifySameJVMStartup(null, null, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMDeopt");
CommandLineOptionTest.verifySameJVMStartup(
null, null, ExitCode.OK, "-XX:+UseRTMDeopt");
// verify that option could be turned off
CommandLineOptionTest.verifySameJVMStartup(null, null, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMDeopt");
CommandLineOptionTest.verifySameJVMStartup(
null, null, ExitCode.OK, "-XX:-UseRTMDeopt");
// verify default value
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE);
// verify default value
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
// verify that option is off when UseRTMLocking is off
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "false",
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
"false", "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
// verify that option could be turned on
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true",
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
"true", "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
}
public static void main(String args[]) throws Throwable {
......
......@@ -48,7 +48,7 @@ public class TestUseRTMDeoptOptionOnUnsupportedConfig
private TestUseRTMDeoptOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedCPU(),
new SupportedVM())),
"UseRTMDeopt", true, true,
"UseRTMDeopt", true, false,
TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, "true");
}
......@@ -57,14 +57,11 @@ public class TestUseRTMDeoptOptionOnUnsupportedConfig
super.verifyJVMStartup();
// verify default value
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
defaultValue,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
defaultValue);
// verify that until RTMLocking is not used, value
// will be set to default false.
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
defaultValue,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMDeopt");
defaultValue, "-XX:+UseRTMDeopt");
}
public static void main(String args[]) throws Throwable {
......
......@@ -51,43 +51,31 @@ public class TestUseRTMLockingOptionOnSupportedConfig
@Override
public void runTestCases() throws Throwable {
String unrecongnizedOption
= CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
= CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
"UseRTMLocking");
String experimentalOptionError
= CommandLineOptionTest.getExperimentalOptionErrorMessage(
"UseRTMLocking");
// verify that options is experimental
CommandLineOptionTest.verifySameJVMStartup(
new String[] { experimentalOptionError }, null, ExitCode.FAIL,
"-XX:+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");
}, ExitCode.OK, "-XX:+UseRTMLocking"
);
CommandLineOptionTest.verifySameJVMStartup(null,
new String[]{
RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
unrecongnizedOption
}, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking");
}, ExitCode.OK, "-XX:-UseRTMLocking"
);
// verify that UseRTMLocking is of by default
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE);
// 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");
"true", "-XX:+UseRTMLocking");
}
public static void main(String args[]) throws Throwable {
......
......@@ -63,9 +63,7 @@ public class TestUseRTMLockingOptionOnUnsupportedCPU
CommandLineOptionTest.verifySameJVMStartup(
new String[] { errorMessage },
new String[] { unrecongnizedOption },
ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
ExitCode.FAIL, "-XX:+UseRTMLocking");
// verify that we can pass -UseRTMLocking without
// getting any error messages
CommandLineOptionTest.verifySameJVMStartup(
......@@ -73,27 +71,20 @@ public class TestUseRTMLockingOptionOnUnsupportedCPU
new String[]{
errorMessage,
unrecongnizedOption
}, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking");
}, ExitCode.OK, "-XX:-UseRTMLocking");
// verify that UseRTMLocking is false by default
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
TestUseRTMLockingOptionOnUnsupportedCPU.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
TestUseRTMLockingOptionOnUnsupportedCPU.DEFAULT_VALUE);
} else {
// verify that on non-x86 CPUs RTMLocking could not be used
CommandLineOptionTest.verifySameJVMStartup(
new String[] { unrecongnizedOption },
null, ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
null, ExitCode.FAIL, "-XX:+UseRTMLocking");
CommandLineOptionTest.verifySameJVMStartup(
new String[] { unrecongnizedOption },
null, ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking");
null, ExitCode.FAIL, "-XX:-UseRTMLocking");
}
}
......
......@@ -53,27 +53,17 @@ public class TestUseRTMLockingOptionOnUnsupportedVM
public void runTestCases() throws Throwable {
String errorMessage
= RTMGenericCommandLineOptionTest.RTM_UNSUPPORTED_VM_ERROR;
String experimentalOptionError
= CommandLineOptionTest.getExperimentalOptionErrorMessage(
"UseRTMLocking");
// verify that options is experimental
CommandLineOptionTest.verifySameJVMStartup(
new String[] { experimentalOptionError }, null, ExitCode.FAIL,
"-XX:+UseRTMLocking");
// verify that we can't use +UseRTMLocking
CommandLineOptionTest.verifySameJVMStartup(
new String[] { errorMessage }, null, ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
// verify that we can turn it off
CommandLineOptionTest.verifySameJVMStartup(null,
new String[] { errorMessage }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking");
// verify that it is off by default
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE);
}
public static void main(String args[]) throws Throwable {
......
......@@ -53,22 +53,18 @@ public class TestUseRTMLockingOptionWithBiasedLocking
// verify that we will not get a warning
CommandLineOptionTest.verifySameJVMStartup(null,
new String[] { warningMessage }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:-UseBiasedLocking");
// verify that we will get a warning
CommandLineOptionTest.verifySameJVMStartup(
new String[] { warningMessage }, null, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
// verify that UseBiasedLocking is false when we use rtm locking
CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
"false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
"false", "-XX:+UseRTMLocking");
// verify that we can't turn on biased locking when
// using rtm locking
CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
"false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
"false", "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
}
public static void main(String args[]) throws Throwable {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册