Skip to content

Commit 1e157e9

Browse files
shipilevRealCLanger
authored andcommitted
8361950: Update to use jtreg 8
Backport-of: 5db1dfe
1 parent 3f28d42 commit 1e157e9

File tree

11 files changed

+22
-32
lines changed

11 files changed

+22
-32
lines changed

make/autoconf/lib-tests.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
################################################################################
2929

3030
# Minimum supported versions
31-
JTREG_MINIMUM_VERSION=7.5.2
31+
JTREG_MINIMUM_VERSION=8
3232
GTEST_MINIMUM_VERSION=1.14.0
3333

3434
################################################################################

make/conf/github-actions.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Versions and download locations for dependencies used by GitHub Actions (GHA)
2727

2828
GTEST_VERSION=1.14.0
29-
JTREG_VERSION=7.5.2+1
29+
JTREG_VERSION=8+2
3030

3131
LINUX_X64_BOOT_JDK_EXT=tar.gz
3232
LINUX_X64_BOOT_JDK_URL=https://github.com/SAP/SapMachine/releases/download/sapmachine-24/sapmachine-jdk-24_linux-x64_bin.tar.gz

make/conf/jib-profiles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
11741174
jtreg: {
11751175
server: "jpg",
11761176
product: "jtreg",
1177-
version: "7.5.2",
1178-
build_number: "1",
1179-
file: "bundles/jtreg-7.5.2+1.zip",
1177+
version: "8",
1178+
build_number: "2",
1179+
file: "bundles/jtreg-8+2.zip",
11801180
environment_name: "JT_HOME",
11811181
environment_path: input.get("jtreg", "home_path") + "/bin",
11821182
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),

test/docs/TEST.ROOT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
groups=TEST.groups
3939

4040
# Minimum jtreg version
41-
requiredVersion=7.5.2+1
41+
requiredVersion=8+2
4242

4343
# Use new module options
4444
useNewOptions=true

test/hotspot/jtreg/TEST.ROOT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ requires.properties= \
106106
jdk.static
107107

108108
# Minimum jtreg version
109-
requiredVersion=7.5.2+1
109+
requiredVersion=8+2
110110

111111
# Path to libraries in the topmost test directory. This is needed so @library
112112
# does not need ../../../ notation to reach them

test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
import java.io.File;
2626
import java.io.FileInputStream;
2727
import java.io.PrintStream;
28+
import java.net.URI;
29+
import java.nio.file.Path;
30+
import java.security.CodeSource;
2831
import java.security.ProtectionDomain;
29-
import java.util.regex.Pattern;
30-
import java.util.regex.Matcher;
3132

3233
import nsk.share.Consts;
3334
import nsk.share.test.Stresser;
@@ -80,24 +81,12 @@ static byte[] fileBytes(String fileName) {
8081

8182

8283
public static int run(String args[], PrintStream out) {
83-
String testclasspath = System.getProperty("test.class.path");
84-
String [] testpaths = testclasspath.split(System.getProperty("path.separator"));
85-
String classesDir = "";
86-
87-
Pattern pattern = Pattern.compile("^(.*)classes(.*)vmTestbase(.*)$");
88-
for (int i = 0 ; i < testpaths.length; i++) {
89-
if (pattern.matcher(testpaths[i]).matches()) {
90-
classesDir = testpaths[i];
91-
}
92-
}
93-
if (classesDir.equals("")) {
94-
System.err.println("TEST BUG: Classes directory not found in test,class.path.");
95-
return Consts.TEST_FAILED;
96-
}
9784
Stresser stress = new Stresser(args);
9885

9986
String className = Helper.class.getName();
100-
byte[] bloatBytes = fileBytes(classesDir + File.separator + className.replace('.', '/') + ".class");
87+
CodeSource classCodeSource = Helper.class.getProtectionDomain().getCodeSource();
88+
Path classFilePath = Path.of(URI.create(classCodeSource.getLocation().toString()));
89+
byte[] bloatBytes = fileBytes(classFilePath.resolve(className.replace('.', '/') + ".class").toString());
10190

10291
int count = 0;
10392
Helper.resetExhaustedEvent();

test/jaxp/TEST.ROOT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ modules=java.xml
2323
groups=TEST.groups
2424

2525
# Minimum jtreg version
26-
requiredVersion=7.5.2+1
26+
requiredVersion=8+2
2727

2828
# Path to libraries in the topmost test directory. This is needed so @library
2929
# does not need ../../ notation to reach them

test/jdk/TEST.ROOT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ requires.properties= \
121121
jdk.static
122122

123123
# Minimum jtreg version
124-
requiredVersion=7.5.2+1
124+
requiredVersion=8+2
125125

126126
# Path to libraries in the topmost test directory. This is needed so @library
127127
# does not need ../../ notation to reach them

test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2022, Red Hat, Inc.
3+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
56
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +31,7 @@
3031
import java.util.Locale;
3132
import java.util.List;
3233
import java.util.ArrayList;
34+
import java.net.URI;
3335
import java.nio.file.Paths;
3436
import java.nio.file.Path;
3537
import java.nio.file.Files;
@@ -54,12 +56,9 @@
5456
*/
5557
public class TestSPISigned {
5658

57-
private static final String TEST_CLASSES = System.getProperty("test.classes", ".");
5859
private static final String TEST_SRC = System.getProperty("test.src", ".");
5960

6061
private static final Path META_INF_DIR = Paths.get(TEST_SRC, "provider", "meta");
61-
private static final Path PROVIDER_PARENT = Paths.get(TEST_CLASSES, "..");
62-
private static final Path PROVIDER_DIR = PROVIDER_PARENT.resolve("provider");
6362
private static final Path MODS_DIR = Paths.get("mods");
6463
private static final Path UNSIGNED_JAR = MODS_DIR.resolve("unsigned-with-locale.jar");
6564
private static final Path SIGNED_JAR = MODS_DIR.resolve("signed-with-locale.jar");
@@ -81,7 +80,9 @@ public static void main(String[] args) throws Throwable {
8180
// Set up signed jar with custom calendar data provider
8281
//
8382
// 1. Create jar with custom CalendarDataProvider
84-
JarUtils.createJarFile(UNSIGNED_JAR, PROVIDER_DIR);
83+
var codeSource = baz.CalendarDataProviderImpl.class.getProtectionDomain().getCodeSource();
84+
var providerDir = Path.of(URI.create(codeSource.getLocation().toString()));
85+
JarUtils.createJarFile(UNSIGNED_JAR, providerDir);
8586
JarUtils.updateJarFile(UNSIGNED_JAR, META_INF_DIR);
8687
// create signer's keypair
8788
SecurityTools.keytool("-genkeypair -keyalg RSA -keystore ks " +

test/langtools/TEST.ROOT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ keys=intermittent randomness needs-src needs-src-jdk_javadoc
1515
groups=TEST.groups
1616

1717
# Minimum jtreg version
18-
requiredVersion=7.5.2+1
18+
requiredVersion=8+2
1919

2020
# Use new module options
2121
useNewOptions=true

0 commit comments

Comments
 (0)