< prev index next >

test/lib/jdk/test/lib/cds/CDSTestUtils.java

Print this page

        

@@ -30,11 +30,11 @@
 import java.util.ArrayList;
 import java.util.Date;
 import jdk.test.lib.Utils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-
+import jtreg.SkippedException;
 
 // This class contains common test utilities for testing CDS
 public class CDSTestUtils {
     public interface Checker {
         public void check(OutputAnalyzer output) throws Exception;

@@ -221,11 +221,11 @@
 
     // This property is passed to child test processes
     public static final String TestTimeoutFactor = System.getProperty("test.timeout.factor", "1.0");
 
     public static final String UnableToMapMsg =
-        "Unable to map shared archive: test did not complete; assumed PASS";
+        "Unable to map shared archive: test did not complete";
 
     // Create bootstrap CDS archive,
     // use extra JVM command line args as a prefix.
     // For CDS tests specifying prefix makes more sense than specifying suffix, since
     // normally there are no classes or arguments to classes, just "-version"

@@ -312,12 +312,11 @@
 
         // Special case -- sometimes Xshare:on fails because it failed to map
         // at given address. This behavior is platform-specific, machine config-specific
         // and can be random (see ASLR).
         if (isUnableToMap(output)) {
-            System.out.println(UnableToMapMsg);
-            return true;
+            throw new SkippedException(UnableToMapMsg);
         }
 
         if (e != null) {
             throw e;
         }

@@ -444,12 +443,11 @@
 
     public static OutputAnalyzer checkExecExpectError(OutputAnalyzer output,
                                              int expectedExitValue,
                                              String... extraMatches) throws Exception {
         if (isUnableToMap(output)) {
-            System.out.println(UnableToMapMsg);
-            return output;
+            throw new SkippedException(UnableToMapMsg);
         }
 
         output.shouldHaveExitValue(expectedExitValue);
         checkMatches(output, extraMatches);
         return output;
< prev index next >