Skip to content

Commit 1b621f5

Browse files
author
Matias Saavedra Silva
committedDec 12, 2023
8321474: TestAutoCreateSharedArchiveUpgrade.java should be updated with JDK 21
Reviewed-by: dholmes, iklam
1 parent 5463c9c commit 1b621f5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @library /test/lib
3131
* @compile -source 1.8 -target 1.8 ../test-classes/HelloJDK8.java
3232
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar Hello.jar HelloJDK8
33-
* @run driver TestAutoCreateSharedArchiveUpgrade
33+
* @run driver/timeout=600 TestAutoCreateSharedArchiveUpgrade
3434
*/
3535

3636
import java.io.File;
@@ -52,7 +52,7 @@ public class TestAutoCreateSharedArchiveUpgrade {
5252
// the JDK using "jtreg -vmoption:-Dtest.previous.jdk=${JDK19_HOME} ..."
5353
private static final String PREV_JDK = System.getProperty("test.previous.jdk", null);
5454

55-
// If you're unning this test using something like
55+
// If you're running this test using something like
5656
// "make test TEST=test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java",
5757
// the test.boot.jdk property is normally passed by make/RunTests.gmk
5858
private static String BOOT_JDK = System.getProperty("test.boot.jdk", null);
@@ -103,8 +103,12 @@ static void setupJVMs(int fetchVersion) throws Throwable {
103103

104104
newJVM = TEST_JDK + FS + "bin" + FS + "java";
105105

106+
// Version 0 is used here to indicate that no version is supplied so that
107+
// PREV_JDK or BOOT_JDK are used
106108
if (fetchVersion >= 19) {
107109
oldJVM = fetchJDK(fetchVersion) + FS + "bin" + FS + "java";
110+
} else if (fetchVersion > 0) {
111+
throw new RuntimeException("Unsupported JDK version " + fetchVersion);
108112
} else if (PREV_JDK != null) {
109113
oldJVM = PREV_JDK + FS + "bin" + FS + "java";
110114
} else if (BOOT_JDK != null) {
@@ -187,6 +191,9 @@ private static String fetchJDK(int version) throws Throwable {
187191
case 20:
188192
build = 29;
189193
break;
194+
case 21:
195+
build = 35;
196+
break;
190197
default:
191198
throw new RuntimeException("Unsupported JDK version " + version);
192199
}

0 commit comments

Comments
 (0)
Please sign in to comment.