From 1b621f5527a0d7ae345d79f293357446ab7876d9 Mon Sep 17 00:00:00 2001 From: Matias Saavedra Silva Date: Tue, 12 Dec 2023 22:49:41 +0000 Subject: [PATCH] 8321474: TestAutoCreateSharedArchiveUpgrade.java should be updated with JDK 21 Reviewed-by: dholmes, iklam --- .../TestAutoCreateSharedArchiveUpgrade.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java index c55da54b5ab..88697496ac6 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java @@ -30,7 +30,7 @@ * @library /test/lib * @compile -source 1.8 -target 1.8 ../test-classes/HelloJDK8.java * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar Hello.jar HelloJDK8 - * @run driver TestAutoCreateSharedArchiveUpgrade + * @run driver/timeout=600 TestAutoCreateSharedArchiveUpgrade */ import java.io.File; @@ -52,7 +52,7 @@ public class TestAutoCreateSharedArchiveUpgrade { // the JDK using "jtreg -vmoption:-Dtest.previous.jdk=${JDK19_HOME} ..." private static final String PREV_JDK = System.getProperty("test.previous.jdk", null); - // If you're unning this test using something like + // If you're running this test using something like // "make test TEST=test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java", // the test.boot.jdk property is normally passed by make/RunTests.gmk private static String BOOT_JDK = System.getProperty("test.boot.jdk", null); @@ -103,8 +103,12 @@ public class TestAutoCreateSharedArchiveUpgrade { newJVM = TEST_JDK + FS + "bin" + FS + "java"; + // Version 0 is used here to indicate that no version is supplied so that + // PREV_JDK or BOOT_JDK are used if (fetchVersion >= 19) { oldJVM = fetchJDK(fetchVersion) + FS + "bin" + FS + "java"; + } else if (fetchVersion > 0) { + throw new RuntimeException("Unsupported JDK version " + fetchVersion); } else if (PREV_JDK != null) { oldJVM = PREV_JDK + FS + "bin" + FS + "java"; } else if (BOOT_JDK != null) { @@ -187,6 +191,9 @@ public class TestAutoCreateSharedArchiveUpgrade { case 20: build = 29; break; + case 21: + build = 35; + break; default: throw new RuntimeException("Unsupported JDK version " + version); }