--- old/test/hotspot/jtreg/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java 2018-08-09 13:43:56.705806345 -0700 +++ new/test/hotspot/jtreg/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java 2018-08-09 13:43:56.593806348 -0700 @@ -35,7 +35,7 @@ import jdk.test.lib.cds.CDSTestUtils; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; - +import jtreg.SkippedException; public class PrintSharedArchiveAndExit { public static void main(String[] args) throws Exception { @@ -49,7 +49,10 @@ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName, "-XX:+PrintSharedArchiveAndExit", "-version"); out = CDSTestUtils.executeAndLog(pb, "print-shared-archive-and-version"); - if (!CDSTestUtils.isUnableToMap(out)) { + + if (CDSTestUtils.isUnableToMap(out)) { + throw new SkippedException(CDSTestUtils.UnableToMapMsg); + } else { out.shouldContain("archive is valid") .shouldNotContain("java version") // Should not print JVM version .shouldHaveExitValue(0); // Should report success in error code. @@ -59,10 +62,13 @@ "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName, "-XX:+PrintSharedArchiveAndExit"); out = CDSTestUtils.executeAndLog(pb, "print-shared-archive"); - if (!CDSTestUtils.isUnableToMap(out)) { + + if (CDSTestUtils.isUnableToMap(out)) { + throw new SkippedException(CDSTestUtils.UnableToMapMsg); + } else { out.shouldContain("archive is valid") .shouldNotContain("Usage:") // Should not print JVM help message - .shouldHaveExitValue(0); // Should report success in error code. + .shouldHaveExitValue(0); // Should report success in error code. } } }