test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java
changeset 58310 81134def991d
parent 58300 c3b93d6603f5
child 58528 d0519b8bd8d9
--- a/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java	Tue Sep 24 18:25:54 2019 -0700
+++ b/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java	Tue Sep 24 20:16:13 2019 -0700
@@ -242,7 +242,12 @@
         if (opts.appJarDir != null) {
             pb.directory(new File(opts.appJarDir));
         }
-        return executeAndLog(pb, "dump");
+
+        OutputAnalyzer output = executeAndLog(pb, "dump");
+        if (DYNAMIC_DUMP && isUnableToMap(output)) {
+            throw new SkippedException(UnableToMapMsg);
+        }
+        return output;
     }
 
     // This allows you to run the AppCDS tests with JFR enabled at runtime (though not at
@@ -462,9 +467,6 @@
                                           String... suffix) throws Exception {
         OutputAnalyzer output = dump(appJar, classList, suffix);
         if (DYNAMIC_DUMP) {
-            if (isUnableToMap(output)) {
-                throw new SkippedException(UnableToMapMsg);
-            }
             output.shouldContain("Written dynamic archive");
         } else {
             output.shouldContain("Loading classes to share");
@@ -477,9 +479,6 @@
                                           String... suffix) throws Exception {
         OutputAnalyzer output = dump(appJarDir, appJar, classList, suffix);
         if (DYNAMIC_DUMP) {
-            if (isUnableToMap(output)) {
-                throw new SkippedException(UnableToMapMsg);
-            }
             output.shouldContain("Written dynamic archive");
         } else {
             output.shouldContain("Loading classes to share");