Skip to content

8361950: Update to use jtreg 8 #26261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
################################################################################

# Minimum supported versions
JTREG_MINIMUM_VERSION=7.5.2
JTREG_MINIMUM_VERSION=8
GTEST_MINIMUM_VERSION=1.14.0

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion make/conf/github-actions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Versions and download locations for dependencies used by GitHub Actions (GHA)

GTEST_VERSION=1.14.0
JTREG_VERSION=7.5.2+1
JTREG_VERSION=8+2

LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk24/1f9ff9062db4449d8ca828c504ffae90/36/GPL/openjdk-24_linux-x64_bin.tar.gz
Expand Down
6 changes: 3 additions & 3 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "jpg",
product: "jtreg",
version: "7.5.2",
build_number: "1",
file: "bundles/jtreg-7.5.2+1.zip",
version: "8",
build_number: "2",
file: "bundles/jtreg-8+2.zip",
environment_name: "JT_HOME",
environment_path: input.get("jtreg", "home_path") + "/bin",
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
Expand Down
2 changes: 1 addition & 1 deletion test/docs/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
groups=TEST.groups

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Use new module options
useNewOptions=true
Expand Down
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ requires.properties= \
jdk.static

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../../ notation to reach them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.PrintStream;
import java.net.URI;
import java.nio.file.Path;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

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


public static int run(String args[], PrintStream out) {
String testclasspath = System.getProperty("test.class.path");
String [] testpaths = testclasspath.split(System.getProperty("path.separator"));
String classesDir = "";

Pattern pattern = Pattern.compile("^(.*)classes(.*)vmTestbase(.*)$");
for (int i = 0 ; i < testpaths.length; i++) {
if (pattern.matcher(testpaths[i]).matches()) {
classesDir = testpaths[i];
}
}
if (classesDir.equals("")) {
System.err.println("TEST BUG: Classes directory not found in test,class.path.");
return Consts.TEST_FAILED;
}
Stresser stress = new Stresser(args);

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

int count = 0;
Helper.resetExhaustedEvent();
Expand Down
2 changes: 1 addition & 1 deletion test/jaxp/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ modules=java.xml
groups=TEST.groups

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../ notation to reach them
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ requires.properties= \
jdk.static

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../ notation to reach them
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Red Hat, Inc.
* Copyright (c) 2022, 2025, Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -30,6 +30,7 @@
import java.util.Locale;
import java.util.List;
import java.util.ArrayList;
import java.net.URI;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.nio.file.Files;
Expand All @@ -54,12 +55,9 @@
*/
public class TestSPISigned {

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

private static final Path META_INF_DIR = Paths.get(TEST_SRC, "provider", "meta");
private static final Path PROVIDER_PARENT = Paths.get(TEST_CLASSES, "..");
private static final Path PROVIDER_DIR = PROVIDER_PARENT.resolve("provider");
private static final Path MODS_DIR = Paths.get("mods");
private static final Path UNSIGNED_JAR = MODS_DIR.resolve("unsigned-with-locale.jar");
private static final Path SIGNED_JAR = MODS_DIR.resolve("signed-with-locale.jar");
Expand All @@ -81,7 +79,9 @@ public static void main(String[] args) throws Throwable {
// Set up signed jar with custom calendar data provider
//
// 1. Create jar with custom CalendarDataProvider
JarUtils.createJarFile(UNSIGNED_JAR, PROVIDER_DIR);
var codeSource = baz.CalendarDataProviderImpl.class.getProtectionDomain().getCodeSource();
var providerDir = Path.of(URI.create(codeSource.getLocation().toString()));
JarUtils.createJarFile(UNSIGNED_JAR, providerDir);
JarUtils.updateJarFile(UNSIGNED_JAR, META_INF_DIR);
// create signer's keypair
SecurityTools.keytool("-genkeypair -keyalg RSA -keystore ks " +
Expand Down
2 changes: 1 addition & 1 deletion test/langtools/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ keys=intermittent randomness needs-src needs-src-jdk_javadoc
groups=TEST.groups

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Use new module options
useNewOptions=true
Expand Down
2 changes: 1 addition & 1 deletion test/lib-test/TEST.ROOT
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
keys=randomness

# Minimum jtreg version
requiredVersion=7.5.2+1
requiredVersion=8+2

# Allow querying of various System properties in @requires clauses
requires.extraPropDefns = ../jtreg-ext/requires/VMProps.java
Expand Down