8235499: Change HotSpot jtreg records test to better handle JDK updates

Reviewed-by: hseigel, iignatyev
This commit is contained in:
Joe Darcy 2019-12-06 12:13:25 -08:00
parent 72cb073c09
commit 0da41b464e
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ import jdk.test.lib.process.OutputAnalyzer;
public class ignoreRecordAttribute {
public static void main(String[] args) throws Exception {
String MAJOR_VERSION = Integer.toString(44 + Runtime.version().feature());
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--enable-preview",
"-Xlog:class+record", "-Xshare:off", "superNotJLRecord");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
@ -46,7 +46,7 @@ public class ignoreRecordAttribute {
"-Xlog:class+record", "-Xshare:off", "recordIgnoredVersion");
output = new OutputAnalyzer(pb.start());
output.shouldContain("Ignoring Record attribute");
output.shouldContain("because class file version is not 58.65535");
output.shouldContain("because class file version is not " + MAJOR_VERSION + ".65535");
}
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @compile --enable-preview --source 14 recordReflectionTest.java
* @compile --enable-preview --source ${jdk.version} recordReflectionTest.java
* @run main/othervm --enable-preview recordReflectionTest
*/