8235563: [TESTBUG] appcds/CommandLineFlagComboNegative.java does not handle archive mapping failure

Use the assertAbnormalExit method of the CDSTestUtils.Result class to handle archive mapping failure.

Reviewed-by: iklam
This commit is contained in:
Calvin Cheung 2019-12-17 16:46:37 -08:00
parent bdaa9c6a1c
commit fae788a200

View File

@ -85,9 +85,14 @@ public class CommandLineFlagComboNegative {
TestCommon.checkDump(dumpOutput, "Loading classes to share");
OutputAnalyzer execOutput = TestCommon.exec(appJar, testEntry.testOptionForExecuteStep, "Hello");
execOutput.shouldContain(testEntry.expectedErrorMsg);
execOutput.shouldHaveExitValue(testEntry.expectedErrorCode);
TestCommon.run(
"-cp", appJar,
testEntry.testOptionForExecuteStep,
"Hello")
.assertAbnormalExit(output -> {
output.shouldContain(testEntry.expectedErrorMsg)
.shouldHaveExitValue(testEntry.expectedErrorCode);
});
}
}