Java Code Examples for com.oracle.java.testlibrary.cli.CommandLineOptionTest#verifySameJVMStartup()

The following examples show how to use com.oracle.java.testlibrary.cli.CommandLineOptionTest#verifySameJVMStartup() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenericTestCaseForUnsupportedX86CPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 2
Source File: GenericTestCaseForUnsupportedX86CPU.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 3
Source File: GenericTestCaseForSupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 4
Source File: TestUseRTMDeoptOptionOnSupportedConfig.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void runTestCases() throws Throwable {
    // verify that option could be turned on
    CommandLineOptionTest.verifySameJVMStartup(
            null, null, ExitCode.OK, "-XX:+UseRTMDeopt");
    // verify that option could be turned off
    CommandLineOptionTest.verifySameJVMStartup(
            null, null, ExitCode.OK, "-XX:-UseRTMDeopt");
    // verify default value
    CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
            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");
    // verify that option could be turned on
    CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true",
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
}
 
Example 5
Source File: GenericTestCaseForSupportedSparcCPU.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there are no warning when option is explicitly enabled.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that option could be disabled even if +UseSHA was passed to
    // JVM.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));

    // Verify that it is possible to enable the tested option and disable
    // all SHA intrinsics via -UseSHA without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 6
Source File: GenericTestCaseForUnsupportedX86CPU.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that when the tested option is explicitly enabled, then
    // a warning will occur in VM output.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    // Verify that the tested option could be explicitly disabled without
    // a warning.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 7
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to enable the tested option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 8
Source File: TestUseRTMForStackLocksOptionOnUnsupportedConfig.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void runX86SupportedVMTestCases() throws Throwable {
    // verify that option is experimental
    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{ experimentalOptionError },
            null, ExitCode.FAIL, prepareOptionValue("true"));

    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{ experimentalOptionError },
            null, ExitCode.FAIL, prepareOptionValue("false"));

    // verify that if we turn it on, then VM output will contain
    // warning saying that this option could be turned on only
    // when we use rtm locking
    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{
                RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING
            },
            null, ExitCode.OK,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            prepareOptionValue("true")
    );
    // verify that options is turned off by default
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
            TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
    // verify that it could not be turned on without rtm locking
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
            TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            prepareOptionValue("true"));
}
 
Example 9
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to use UseSHA option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 10
Source File: GenericTestCaseForUnsupportedSparcCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    //Verify that option could be disabled without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 11
Source File: GenericTestCaseForOtherCPU.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that on non-x86 and non-SPARC CPU usage of SHA-related
    // options will not cause any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 12
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to use UseSHA option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 13
Source File: GenericTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    //Verify that option could be disabled without any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 14
Source File: TestUseRTMForStackLocksOptionOnUnsupportedConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void runX86SupportedVMTestCases() throws Throwable {
    // verify that option is experimental
    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{ experimentalOptionError },
            null, ExitCode.FAIL, prepareOptionValue("true"));

    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{ experimentalOptionError },
            null, ExitCode.FAIL, prepareOptionValue("false"));

    // verify that if we turn it on, then VM output will contain
    // warning saying that this option could be turned on only
    // when we use rtm locking
    CommandLineOptionTest.verifySameJVMStartup(
            new String[]{
                RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING
            },
            null, ExitCode.OK,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            prepareOptionValue("true")
    );
    // verify that options is turned off by default
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
            TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
    // verify that it could not be turned on without rtm locking
    CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
            TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
            CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
            prepareOptionValue("true"));
}
 
Example 15
Source File: UseSHASpecificTestCaseForUnsupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to use UseSHA option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 16
Source File: GenericTestCaseForOtherCPU.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that on non-x86 and non-SPARC CPU usage of SHA-related
    // options will not cause any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 17
Source File: GenericTestCaseForOtherCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that on non-x86 and non-SPARC CPU usage of SHA-related
    // options will not cause any warnings.
    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));

    CommandLineOptionTest.verifySameJVMStartup(null,
            new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, false));
}
 
Example 18
Source File: UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that attempt to enable the tested option will cause a warning.
    CommandLineOptionTest.verifySameJVMStartup(new String[] {
                    SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
            }, null, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(optionName, true));
}
 
Example 19
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there will be no warnings when +UseSHA was passed and
    // all UseSHA*Intrinsics options were disabled.
    CommandLineOptionTest.verifySameJVMStartup(
            null, new String[] { ".*UseSHA.*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));
}
 
Example 20
Source File: UseSHASpecificTestCaseForSupportedSparcCPU.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void verifyWarnings() throws Throwable {
    // Verify that there will be no warnings when +UseSHA was passed and
    // all UseSHA*Intrinsics options were disabled.
    CommandLineOptionTest.verifySameJVMStartup(
            null, new String[] { ".*UseSHA.*" }, ExitCode.OK,
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA_OPTION, true),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA256_INTRINSICS_OPTION, false),
            CommandLineOptionTest.prepareBooleanFlag(
                    SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));
}