< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2021, 202, 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
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -60,11 +60,12 @@
      private static void doTestCustomBase(String topArchiveName) throws Exception {
          String appJar = ClassFileInstaller.getJarPath("old-class-base-archive.jar");
  
          // create a custom base archive containing and old class
          OutputAnalyzer output = TestCommon.dump(appJar,
-             TestCommon.list("OldSuper"), "-Xlog:class+load,cds+class=debug");
+             TestCommon.list("OldSuper"), "-Xlog:class+load,cds+class=debug",
+             "-XX:-PreloadSharedClasses");
          TestCommon.checkDump(output);
          // Check the OldSuper is being dumped into the base archive.
          output.shouldMatch(".cds.class.*klass.*0x.*app.*OldSuper.*unlinked");
  
          String baseArchiveName = TestCommon.getCurrentArchiveName();

@@ -75,10 +76,11 @@
          // The OldSuperApp, ChildOldSuper, and GChild classes will be archived
          // in the dynamic archive.
          dump2(baseArchiveName, topArchiveName,
                "-Xlog:cds,cds+dynamic,class+load,cds+class=debug",
                "-cp", appJar,
+               "-XX:-PreloadSharedClasses",
                appClass)
              .assertNormalExit(out -> {
                      out.shouldContain("OldSuper source: shared objects file")
                         // Check the following classes are being dumped into the dynamic archive.
                         .shouldMatch(".cds,class.*klass.*0x.*app.*OldSuperApp")
< prev index next >