47 super(optionName, warningMessage, null, cpuFeatures);
48 }
49
50 @Override
51 public void runTestCases() throws Throwable {
52 if (Platform.isX86() || Platform.isX64()) {
53 unsupportedX86CPUTestCases();
54 } else {
55 unsupportedNonX86CPUTestCases();
56 }
57 }
58
59 /**
60 * Run test cases common for all bit manipulation related VM options
61 * targeted to X86 CPU that does not support required features.
62 *
63 * @throws Throwable if test failed.
64 */
65 public void unsupportedX86CPUTestCases() throws Throwable {
66
67 // verify that VM will succesfully start up, but output will
68 // contain a warning
69 CommandLineOptionTest.
70 verifyJVMStartup("-XX:+" + optionName,
71 new String[] { warningMessage },
72 new String[] { errorMessage },
73 ExitCode.OK);
74
75 // verify that VM will succesfully startup without any warnings
76 CommandLineOptionTest.
77 verifyJVMStartup("-XX:-" + optionName,
78 null,
79 new String[] { warningMessage, errorMessage },
80 ExitCode.OK);
81
82 // verify that on unsupported CPUs option is off by default
83 CommandLineOptionTest.verifyOptionValue(optionName, "false");
84
85 // verify that on unsupported CPUs option will be off even if
86 // it was explicitly turned on by uset
87 CommandLineOptionTest.verifyOptionValue(optionName, "false",
88 "-XX:+" + optionName);
89
90 }
91
92 /**
93 * Run test cases common for all bit manipulation related VM options
94 * targeted to non-X86 CPU that does not support required features.
95 *
96 * @throws Throwable if test failed.
97 */
98 public void unsupportedNonX86CPUTestCases() throws Throwable {
99
100 // verify that VM known nothing about tested option
101 CommandLineOptionTest.
102 verifyJVMStartup("-XX:+" + optionName,
103 new String[] { errorMessage },
104 null,
105 ExitCode.FAIL);
106
107 CommandLineOptionTest.
108 verifyJVMStartup("-XX:-" + optionName,
109 new String[] { errorMessage },
110 null,
111 ExitCode.FAIL);
112 }
113 }
114
|
47 super(optionName, warningMessage, null, cpuFeatures);
48 }
49
50 @Override
51 public void runTestCases() throws Throwable {
52 if (Platform.isX86() || Platform.isX64()) {
53 unsupportedX86CPUTestCases();
54 } else {
55 unsupportedNonX86CPUTestCases();
56 }
57 }
58
59 /**
60 * Run test cases common for all bit manipulation related VM options
61 * targeted to X86 CPU that does not support required features.
62 *
63 * @throws Throwable if test failed.
64 */
65 public void unsupportedX86CPUTestCases() throws Throwable {
66
67 // verify that VM will successfully start up, but output will
68 // contain a warning
69 CommandLineOptionTest.verifySameJVMStartup(
70 new String[] { warningMessage }, new String[] { errorMessage },
71 ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag(
72 optionName, true));
73
74 // verify that VM will successfully startup without any warnings
75 CommandLineOptionTest.verifySameJVMStartup(null,
76 new String[] { warningMessage, errorMessage }, ExitCode.OK,
77 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
78
79 // verify that on unsupported CPUs option is off by default
80 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
81
82 // verify that on unsupported CPUs option will be off even if
83 // it was explicitly turned on by user
84 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
85 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
86
87 }
88
89 /**
90 * Run test cases common for all bit manipulation related VM options
91 * targeted to non-X86 CPU that does not support required features.
92 *
93 * @throws Throwable if test failed.
94 */
95 public void unsupportedNonX86CPUTestCases() throws Throwable {
96
97 // verify that VM known nothing about tested option
98 CommandLineOptionTest.verifySameJVMStartup(
99 new String[] { errorMessage }, null, ExitCode.FAIL,
100 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
101
102 CommandLineOptionTest.verifySameJVMStartup(
103 new String[] { errorMessage }, null, ExitCode.FAIL,
104 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
105 }
106 }
107
|