From fae788a20087b046fa35914d7fb105a8dfb5bda9 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 17 Dec 2019 16:46:37 -0800 Subject: [PATCH] 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 --- .../cds/appcds/CommandLineFlagComboNegative.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java index e1709ff5d72..f06f423ef2e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java @@ -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); + }); } }