test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java
changeset 51411 4699147a4f91
parent 49931 840e26123940
child 51990 6003e034cdd8
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Wed Aug 15 14:35:33 2018 +0200
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Wed Aug 15 10:00:16 2018 -0700
@@ -35,7 +35,6 @@
 import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import java.io.File;
 
 public class NonBootLoaderClasses {
     public static void main(String[] args) throws Exception {
@@ -56,11 +55,11 @@
                 "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
                 "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary");
         OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "print-shared-archive");
-        if (!CDSTestUtils.isUnableToMap(out)) {
-            out.shouldContain("archive is valid")
-               .shouldHaveExitValue(0)               // Should report success in error code.
-               .shouldContain(PLATFORM_CLASS.replace('/', '.'))
-               .shouldContain(APP_CLASS.replace('/', '.'));
-        }
+        CDSTestUtils.checkMappingFailure(out);
+
+        out.shouldContain("archive is valid")
+            .shouldHaveExitValue(0)               // Should report success in error code.
+            .shouldContain(PLATFORM_CLASS.replace('/', '.'))
+            .shouldContain(APP_CLASS.replace('/', '.'));
    }
 }