50 public TestVector(String testOptionForDumpStep, String testOptionForExecuteStep,
51 String expectedErrorMsg, int expectedErrorCode) {
52 this.testOptionForDumpStep=testOptionForDumpStep;
53 this.testOptionForExecuteStep=testOptionForExecuteStep;
54 this.expectedErrorMsg=expectedErrorMsg;
55 this.expectedErrorCode=expectedErrorCode;
56 }
57 }
58
59 private ArrayList<TestVector> testTable = new ArrayList<TestVector>();
60
61 private void initTestTable() {
62 testTable.add( new TestVector("-XX:ObjectAlignmentInBytes=8", "-XX:ObjectAlignmentInBytes=16",
63 "An error has occurred while processing the shared archive file", 1) );
64 if (!TestCommon.isDynamicArchive()) {
65 testTable.add( new TestVector("-XX:ObjectAlignmentInBytes=64", "-XX:ObjectAlignmentInBytes=32",
66 "An error has occurred while processing the shared archive file", 1) );
67 }
68 testTable.add( new TestVector("-XX:+UseCompressedOops", "-XX:-UseCompressedOops",
69 "The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.", 1) );
70 testTable.add( new TestVector("-XX:+UseCompressedClassPointers", "-XX:-UseCompressedClassPointers",
71 "The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.", 1) );
72 }
73
74 private void runTests() throws Exception
75 {
76 for (TestVector testEntry : testTable) {
77 System.out.println("CommandLineFlagComboNegative: dump = " + testEntry.testOptionForDumpStep);
78 System.out.println("CommandLineFlagComboNegative: execute = " + testEntry.testOptionForExecuteStep);
79
80 String appJar = JarBuilder.getOrCreateHelloJar();
81 OutputAnalyzer dumpOutput = TestCommon.dump(
82 appJar, new String[] {"Hello"}, testEntry.testOptionForDumpStep);
83
84 TestCommon.checkDump(dumpOutput, "Loading classes to share");
85
86 TestCommon.run(
87 "-cp", appJar,
88 testEntry.testOptionForExecuteStep,
89 "-Xlog:cds", // for checking log message
90 "Hello")
91 .assertAbnormalExit(output -> {
|
50 public TestVector(String testOptionForDumpStep, String testOptionForExecuteStep,
51 String expectedErrorMsg, int expectedErrorCode) {
52 this.testOptionForDumpStep=testOptionForDumpStep;
53 this.testOptionForExecuteStep=testOptionForExecuteStep;
54 this.expectedErrorMsg=expectedErrorMsg;
55 this.expectedErrorCode=expectedErrorCode;
56 }
57 }
58
59 private ArrayList<TestVector> testTable = new ArrayList<TestVector>();
60
61 private void initTestTable() {
62 testTable.add( new TestVector("-XX:ObjectAlignmentInBytes=8", "-XX:ObjectAlignmentInBytes=16",
63 "An error has occurred while processing the shared archive file", 1) );
64 if (!TestCommon.isDynamicArchive()) {
65 testTable.add( new TestVector("-XX:ObjectAlignmentInBytes=64", "-XX:ObjectAlignmentInBytes=32",
66 "An error has occurred while processing the shared archive file", 1) );
67 }
68 testTable.add( new TestVector("-XX:+UseCompressedOops", "-XX:-UseCompressedOops",
69 "The saved state of UseCompressedOops and UseCompressedClassPointers is different from runtime, CDS will be disabled.", 1) );
70 }
71
72 private void runTests() throws Exception
73 {
74 for (TestVector testEntry : testTable) {
75 System.out.println("CommandLineFlagComboNegative: dump = " + testEntry.testOptionForDumpStep);
76 System.out.println("CommandLineFlagComboNegative: execute = " + testEntry.testOptionForExecuteStep);
77
78 String appJar = JarBuilder.getOrCreateHelloJar();
79 OutputAnalyzer dumpOutput = TestCommon.dump(
80 appJar, new String[] {"Hello"}, testEntry.testOptionForDumpStep);
81
82 TestCommon.checkDump(dumpOutput, "Loading classes to share");
83
84 TestCommon.run(
85 "-cp", appJar,
86 testEntry.testOptionForExecuteStep,
87 "-Xlog:cds", // for checking log message
88 "Hello")
89 .assertAbnormalExit(output -> {
|