< prev index next >

test/hotspot/jtreg/runtime/cds/TestDefaultArchiveLoading.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
   * Copyright (c) 2024, Red Hat, Inc. 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
--- 1,7 ---
  /*
!  * Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved.
   * Copyright (c) 2024, Red Hat, Inc. 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

*** 53,11 ***
   * @summary Test Loading of default archives in all configurations
   * @requires vm.cds
   * @requires vm.cds.default.archive.available
   * @requires vm.cds.write.archived.java.heap
   * @requires vm.bits == 64
!  * @requires !vm.gc.Z
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
   * @run driver TestDefaultArchiveLoading coops_nocoh
   */
--- 53,11 ---
   * @summary Test Loading of default archives in all configurations
   * @requires vm.cds
   * @requires vm.cds.default.archive.available
   * @requires vm.cds.write.archived.java.heap
   * @requires vm.bits == 64
!  * @requires vm.gc != "Z"
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
   * @run driver TestDefaultArchiveLoading coops_nocoh
   */

*** 67,11 ***
   * @summary Test Loading of default archives in all configurations (requires --enable-cds-archive-coh)
   * @requires vm.cds
   * @requires vm.cds.default.archive.available
   * @requires vm.cds.write.archived.java.heap
   * @requires vm.bits == 64
!  * @requires !vm.gc.Z
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
   * @run driver TestDefaultArchiveLoading coops_coh
   */
--- 67,11 ---
   * @summary Test Loading of default archives in all configurations (requires --enable-cds-archive-coh)
   * @requires vm.cds
   * @requires vm.cds.default.archive.available
   * @requires vm.cds.write.archived.java.heap
   * @requires vm.bits == 64
!  * @requires vm.gc != "Z"
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
   * @run driver TestDefaultArchiveLoading coops_coh
   */

*** 85,12 ***
  
  import jtreg.SkippedException;
  
  public class TestDefaultArchiveLoading {
  
      private static String archiveName(String archiveSuffix) {
!         return "classes" + archiveSuffix + ".jsa";
      }
  
      private static Path archivePath(String archiveSuffix) {
          return Paths.get(System.getProperty("java.home"), "lib",
                           "server", archiveName(archiveSuffix));
--- 85,14 ---
  
  import jtreg.SkippedException;
  
  public class TestDefaultArchiveLoading {
  
+     static String archivePreviewSuffix = "";
+ 
      private static String archiveName(String archiveSuffix) {
!         return "classes" + archiveSuffix + archivePreviewSuffix + ".jsa";
      }
  
      private static Path archivePath(String archiveSuffix) {
          return Paths.get(System.getProperty("java.home"), "lib",
                           "server", archiveName(archiveSuffix));

*** 108,10 ***
--- 110,14 ---
              throw new RuntimeException("Expected argument");
          }
  
          String archiveSuffix;
          char coh, coops;
+         String preview = System.getProperty("test.java.opts", "");
+         if (preview.contains("--enable-preview")) {
+             archivePreviewSuffix = "_preview";
+         }
  
          switch (args[0]) {
              case "nocoops_nocoh":
                  coh = coops = '-';
                  archiveSuffix = "_nocoops";
< prev index next >