30
30
* @library /test/lib
31
31
* @compile -source 1.8 -target 1.8 ../test-classes/HelloJDK8.java
32
32
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar Hello.jar HelloJDK8
33
- * @run driver TestAutoCreateSharedArchiveUpgrade
33
+ * @run driver/timeout=600 TestAutoCreateSharedArchiveUpgrade
34
34
*/
35
35
36
36
import java .io .File ;
@@ -52,7 +52,7 @@ public class TestAutoCreateSharedArchiveUpgrade {
52
52
// the JDK using "jtreg -vmoption:-Dtest.previous.jdk=${JDK19_HOME} ..."
53
53
private static final String PREV_JDK = System .getProperty ("test.previous.jdk" , null );
54
54
55
- // If you're unning this test using something like
55
+ // If you're running this test using something like
56
56
// "make test TEST=test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java",
57
57
// the test.boot.jdk property is normally passed by make/RunTests.gmk
58
58
private static String BOOT_JDK = System .getProperty ("test.boot.jdk" , null );
@@ -103,8 +103,12 @@ static void setupJVMs(int fetchVersion) throws Throwable {
103
103
104
104
newJVM = TEST_JDK + FS + "bin" + FS + "java" ;
105
105
106
+ // Version 0 is used here to indicate that no version is supplied so that
107
+ // PREV_JDK or BOOT_JDK are used
106
108
if (fetchVersion >= 19 ) {
107
109
oldJVM = fetchJDK (fetchVersion ) + FS + "bin" + FS + "java" ;
110
+ } else if (fetchVersion > 0 ) {
111
+ throw new RuntimeException ("Unsupported JDK version " + fetchVersion );
108
112
} else if (PREV_JDK != null ) {
109
113
oldJVM = PREV_JDK + FS + "bin" + FS + "java" ;
110
114
} else if (BOOT_JDK != null ) {
@@ -187,6 +191,9 @@ private static String fetchJDK(int version) throws Throwable {
187
191
case 20 :
188
192
build = 29 ;
189
193
break ;
194
+ case 21 :
195
+ build = 35 ;
196
+ break ;
190
197
default :
191
198
throw new RuntimeException ("Unsupported JDK version " + version );
192
199
}
0 commit comments