test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java
changeset 51411 4699147a4f91
parent 49008 d777541fceba
child 51990 6003e034cdd8
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java	Wed Aug 15 14:35:33 2018 +0200
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java	Wed Aug 15 10:00:16 2018 -0700
@@ -51,18 +51,16 @@
 
         // -Xshare=on
         OutputAnalyzer out = CDSTestUtils.runWithArchive(opts);
-        if (!CDSTestUtils.isUnableToMap(out)) {
-            out.shouldContain("Specified shared archive not found")
-               .shouldHaveExitValue(1);
-        }
+        CDSTestUtils.checkMappingFailure(out);
+        out.shouldContain("Specified shared archive not found")
+            .shouldHaveExitValue(1);
 
         // -Xshare=auto
         opts.setXShareMode("auto");
         out = CDSTestUtils.runWithArchive(opts);
-        if (!CDSTestUtils.isUnableToMap(out)) {
-            out.shouldMatch("(java|openjdk) version")
-               .shouldNotContain("sharing")
-               .shouldHaveExitValue(0);
-        }
+        CDSTestUtils.checkMappingFailure(out);
+        out.shouldMatch("(java|openjdk) version")
+            .shouldNotContain("sharing")
+            .shouldHaveExitValue(0);
     }
 }