< prev index next >

test/hotspot/jtreg/runtime/SharedArchiveFile/ArchiveDoesNotExist.java

Print this page

        

@@ -36,10 +36,12 @@
 
 import jdk.test.lib.cds.CDSOptions;
 import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import java.io.File;
+import jtreg.SkippedException;
+
 
 public class ArchiveDoesNotExist {
     public static void main(String[] args) throws Exception {
         String fileName = "ArchiveDoesNotExist.jsa";
 

@@ -49,11 +51,13 @@
 
         CDSOptions opts = (new CDSOptions()).setArchiveName(fileName);
 
         // -Xshare=on
         OutputAnalyzer out = CDSTestUtils.runWithArchive(opts);
-        if (!CDSTestUtils.isUnableToMap(out)) {
+        if (CDSTestUtils.isUnableToMap(out)) {
+            throw new SkippedException(CDSTestUtils.UnableToMapMsg);
+        } else {
             out.shouldContain("Specified shared archive not found")
                .shouldHaveExitValue(1);
         }
 
         // -Xshare=auto
< prev index next >