test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java
Print this page
*** 45,75 ****
@Override
protected void verifyJVMStartup() throws Throwable {
if (Platform.isServer()) {
if (!Platform.isDebugBuild()) {
String errorMessage = CommandLineOptionTest.
getDiagnosticOptionErrorMessage(optionName);
// verify that option is actually diagnostic
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null, ExitCode.FAIL,
prepareOptionValue("true"));
CommandLineOptionTest.verifySameJVMStartup(null,
! new String[] { errorMessage }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
prepareOptionValue("true"));
} else {
! CommandLineOptionTest.verifySameJVMStartup(
! null, null, ExitCode.OK, prepareOptionValue("true"));
}
} else {
String errorMessage = CommandLineOptionTest.
getUnrecognizedOptionErrorMessage(optionName);
!
CommandLineOptionTest.verifySameJVMStartup(
! new String[]{errorMessage}, null, ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
prepareOptionValue("true"));
}
}
--- 45,90 ----
@Override
protected void verifyJVMStartup() throws Throwable {
if (Platform.isServer()) {
if (!Platform.isDebugBuild()) {
+ String shouldFailMessage = String.format("VM option '%s' is "
+ + "diagnostic%nJVM startup should fail without "
+ + "-XX:\\+UnlockDiagnosticVMOptions flag", optionName);
+ String shouldPassMessage = String.format("VM option '%s' is "
+ + "diagnostic%nJVM startup should pass with "
+ + "-XX:\\+UnlockDiagnosticVMOptions in debug build",
+ optionName);
String errorMessage = CommandLineOptionTest.
getDiagnosticOptionErrorMessage(optionName);
// verify that option is actually diagnostic
CommandLineOptionTest.verifySameJVMStartup(
! new String[] { errorMessage }, null, shouldFailMessage,
! shouldFailMessage, ExitCode.FAIL,
prepareOptionValue("true"));
CommandLineOptionTest.verifySameJVMStartup(null,
! new String[] { errorMessage }, shouldPassMessage,
! shouldPassMessage + "without any warnings", ExitCode.OK,
CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
prepareOptionValue("true"));
} else {
! String shouldPassMessage = String.format("JVM startup should "
! + "pass with '%s' option in debug build",
! optionName);
! CommandLineOptionTest.verifySameJVMStartup(null, null,
! shouldPassMessage, shouldPassMessage,
! ExitCode.OK, prepareOptionValue("true"));
}
} else {
String errorMessage = CommandLineOptionTest.
getUnrecognizedOptionErrorMessage(optionName);
! String shouldFailMessage = String.format("JVM startup should fail"
! + " with '%s' option in not debug build", optionName);
CommandLineOptionTest.verifySameJVMStartup(
! new String[]{errorMessage}, null, shouldFailMessage,
! shouldFailMessage, ExitCode.FAIL,
CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
prepareOptionValue("true"));
}
}
*** 77,85 ****
--- 92,103 ----
protected void verifyOptionValues() throws Throwable {
if (Platform.isServer()) {
// Verify default value
CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+ String.format("Option '%s' should have '%s' default value",
+ optionName,
+ TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE),
CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS);
}
}
}