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