< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java

Print this page
*** 188,17 ***
  
      // Now make nonExistPath exist. CDS still loads, but archived non-system classes will not be used.
      Files.copy(Paths.get(cp), Paths.get(nonExistPath),
                 StandardCopyOption.REPLACE_EXISTING);
  
!     TestCommon.run(
          "-Xlog:class+path",
          "-cp", cp,
!         "CpAttr6")
!       .assertNormalExit(output -> {
!           output.shouldMatch("Archived non-system classes are disabled because the file .*cpattrX.jar exists");
!         });
    }
  
    static void testClassPathAttrJarOnCP() throws Exception {
      String helloJar = JarBuilder.getOrCreateHelloJar();
      String jar1 = TestCommon.getTestJar("cpattr1.jar");
--- 188,24 ---
  
      // Now make nonExistPath exist. CDS still loads, but archived non-system classes will not be used.
      Files.copy(Paths.get(cp), Paths.get(nonExistPath),
                 StandardCopyOption.REPLACE_EXISTING);
  
!     CDSTestUtils.Result result = TestCommon.run(
          "-Xlog:class+path",
          "-cp", cp,
!         "CpAttr6");
!     if (CDSTestUtils.isAOTClassLinkingEnabled()) {
!         result.assertAbnormalExit(output -> {
!                 output.shouldMatch("CDS archive has aot-linked classes. It cannot be used because the file .*cpattrX.jar exists");
+             });
+ 
+     } else {
+         result.assertNormalExit(output -> {
+                 output.shouldMatch("Archived non-system classes are disabled because the file .*cpattrX.jar exists");
+             });
+     }
    }
  
    static void testClassPathAttrJarOnCP() throws Exception {
      String helloJar = JarBuilder.getOrCreateHelloJar();
      String jar1 = TestCommon.getTestJar("cpattr1.jar");
< prev index next >