test/hotspot/jtreg/runtime/appcds/ClassLoaderTest.java
changeset 49335 3271310a6af7
parent 48791 6e079ff6c83c
child 51990 6003e034cdd8
--- a/test/hotspot/jtreg/runtime/appcds/ClassLoaderTest.java	Sun Mar 04 20:57:46 2018 -0500
+++ b/test/hotspot/jtreg/runtime/appcds/ClassLoaderTest.java	Sun Mar 04 22:24:06 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,15 +62,10 @@
 
         TestCommon.dump(appJar, appClasses, bootClassPath);
 
-        OutputAnalyzer runtimeOutput = TestCommon.execCommon(
+        TestCommon.run(
             "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
-            "-cp", appJar, bootClassPath, "-Xlog:class+load", "HelloWB");
-
-        if (!TestCommon.isUnableToMap(runtimeOutput)) {
-            runtimeOutput.shouldNotContain(
-                "[class,load] HelloWB source: shared objects file by jdk/internal/misc/ClassLoaders$AppClassLoader");
-            runtimeOutput.shouldContain("[class,load] HelloWB source: shared objects file");
-        }
+            "-cp", appJar, bootClassPath, "HelloWB")
+          .assertNormalExit(output -> output.shouldContain("HelloWB.class.getClassLoader() = null"));
     }
 
     public void testDefiningLoader() throws Exception {
@@ -84,9 +79,11 @@
         String bootClassPath = "-Xbootclasspath/a:" + helloJar +
             File.pathSeparator + whiteBoxJar;
 
+        // Archive the "Hello" class from the appended bootclasspath
         TestCommon.dump(helloJar, TestCommon.list("Hello"), bootClassPath);
 
-        TestCommon.execCommon("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
-            "-cp", appJar, bootClassPath, "-XX:+TraceClassPaths", "ForNameTest");
+        TestCommon.run("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
+            "-cp", appJar, bootClassPath, "-Xlog:class+path=trace", "ForNameTest")
+          .assertNormalExit();
     }
 }