diff --git a/documentation/src/docs/asciidoc/release-notes/index.adoc b/documentation/src/docs/asciidoc/release-notes/index.adoc index a13ddd5d1a9b..c7f8737025c6 100644 --- a/documentation/src/docs/asciidoc/release-notes/index.adoc +++ b/documentation/src/docs/asciidoc/release-notes/index.adoc @@ -21,6 +21,8 @@ include::{basedir}/release-notes-6.1.0-M2.adoc[] include::{basedir}/release-notes-6.1.0-M1.adoc[] +include::{basedir}/release-notes-6.0.2.adoc[] + include::{basedir}/release-notes-6.0.1.adoc[] include::{basedir}/release-notes-6.0.0.adoc[] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-6.0.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-6.0.2.adoc new file mode 100644 index 000000000000..a0ba07732b62 --- /dev/null +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-6.0.2.adoc @@ -0,0 +1,67 @@ +[[release-notes-6.0.2]] +== 6.0.2 + +*Date of Release:* ❓ + +*Scope:* ❓ + +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit-framework-repo}+/milestone/113?closed=1+[6.0.2] milestone page in the JUnit +repository on GitHub. + + +[[release-notes-6.0.2-junit-platform]] +=== JUnit Platform + +[[release-notes-6.0.2-junit-platform-bug-fixes]] +==== Bug Fixes + +* Make `ConsoleLauncher` compatible with JDK 26 by avoiding final field mutations. + +[[release-notes-6.0.2-junit-platform-deprecations-and-breaking-changes]] +==== Deprecations and Breaking Changes + +* ❓ + +[[release-notes-6.0.2-junit-platform-new-features-and-improvements]] +==== New Features and Improvements + +* ❓ + + +[[release-notes-6.0.2-junit-jupiter]] +=== JUnit Jupiter + +[[release-notes-6.0.2-junit-jupiter-bug-fixes]] +==== Bug Fixes + +* ❓ + +[[release-notes-6.0.2-junit-jupiter-deprecations-and-breaking-changes]] +==== Deprecations and Breaking Changes + +* ❓ + +[[release-notes-6.0.2-junit-jupiter-new-features-and-improvements]] +==== New Features and Improvements + +* ❓ + + +[[release-notes-6.0.2-junit-vintage]] +=== JUnit Vintage + +[[release-notes-6.0.2-junit-vintage-bug-fixes]] +==== Bug Fixes + +* ❓ + +[[release-notes-6.0.2-junit-vintage-deprecations-and-breaking-changes]] +==== Deprecations and Breaking Changes + +* ❓ + +[[release-notes-6.0.2-junit-vintage-new-features-and-improvements]] +==== New Features and Improvements + +* ❓ diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptionsMixin.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptionsMixin.java index 489f6910961b..e9e3b7e1c410 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptionsMixin.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/TestConsoleOutputOptionsMixin.java @@ -41,11 +41,11 @@ public static class ConsoleOutputOptions { @Option(names = "--details", paramLabel = "MODE", defaultValue = DEFAULT_DETAILS_NAME, description = "Select an output details mode for when tests are executed. " // + "Use one of: ${COMPLETION-CANDIDATES}. If 'none' is selected, " // + "then only the summary and test failures are shown. Default: ${DEFAULT-VALUE}.") - private final Details details = DEFAULT_DETAILS; + private Details details = DEFAULT_DETAILS; @Option(names = "--details-theme", paramLabel = "THEME", description = "Select an output details tree theme for when tests are executed. " + "Use one of: ${COMPLETION-CANDIDATES}. Default is detected based on default character encoding.") - private final Theme theme = DEFAULT_THEME; + private Theme theme = DEFAULT_THEME; @Option(names = "--redirect-stdout", paramLabel = "FILE", description = "Redirect test output to stdout to a file.") private @Nullable Path stdout; diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java index 0d44fc76d336..42ff8eb12c98 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/TestDiscoveryOptionsMixin.java @@ -68,55 +68,55 @@ public static class SelectorOptions { @Option(names = { "-u", "--select-uri" }, paramLabel = "URI", arity = "1..*", converter = SelectorConverter.Uri.class, description = "Select a URI for test discovery. This option can be repeated.") - private final List selectedUris = new ArrayList<>(); + private List selectedUris = new ArrayList<>(); @Option(names = { "-f", "--select-file" }, paramLabel = "FILE", arity = "1..*", converter = SelectorConverter.File.class, // description = "Select a file for test discovery. " + "The line and column numbers can be provided as URI query parameters (e.g. foo.txt?line=12&column=34). " + "This option can be repeated.") - private final List selectedFiles = new ArrayList<>(); + private List selectedFiles = new ArrayList<>(); @Option(names = { "-d", "--select-directory" }, paramLabel = "DIR", arity = "1..*", converter = SelectorConverter.Directory.class, description = "Select a directory for test discovery. This option can be repeated.") - private final List selectedDirectories = new ArrayList<>(); + private List selectedDirectories = new ArrayList<>(); @Option(names = { "-o", "--select-module" }, paramLabel = "NAME", arity = "1..*", converter = SelectorConverter.Module.class, description = "Select single module for test discovery. This option can be repeated.") - private final List selectedModules = new ArrayList<>(); + private List selectedModules = new ArrayList<>(); @Option(names = { "-p", "--select-package" }, paramLabel = "PKG", arity = "1..*", converter = SelectorConverter.Package.class, description = "Select a package for test discovery. This option can be repeated.") - private final List selectedPackages = new ArrayList<>(); + private List selectedPackages = new ArrayList<>(); @Option(names = { "-c", "--select-class" }, paramLabel = "CLASS", arity = "1..*", converter = SelectorConverter.Class.class, description = "Select a class for test discovery. This option can be repeated.") - private final List selectedClasses = new ArrayList<>(); + private List selectedClasses = new ArrayList<>(); @Option(names = { "-m", "--select-method" }, paramLabel = "NAME", arity = "1..*", converter = SelectorConverter.Method.class, description = "Select a method for test discovery. This option can be repeated.") - private final List selectedMethods = new ArrayList<>(); + private List selectedMethods = new ArrayList<>(); @Option(names = { "-r", "--select-resource" }, paramLabel = "RESOURCE", arity = "1..*", converter = SelectorConverter.ClasspathResource.class, description = "Select a classpath resource for test discovery. This option can be repeated.") - private final List selectedClasspathResources = new ArrayList<>(); + private List selectedClasspathResources = new ArrayList<>(); @Option(names = { "-i", "--select-iteration" }, paramLabel = "PREFIX:VALUE[INDEX(..INDEX)?(,INDEX(..INDEX)?)*]", arity = "1..*", converter = SelectorConverter.Iteration.class, // description = "Select iterations for test discovery via a prefixed identifier and a list of indexes or index ranges " + "(e.g. method:com.acme.Foo#m()[1..2] selects the first and second iteration of the m() method in the com.acme.Foo class). " + "This option can be repeated.") - private final List selectedIterations = new ArrayList<>(); + private List selectedIterations = new ArrayList<>(); @Option(names = { "--select-unique-id", "--uid" }, paramLabel = "UNIQUE-ID", arity = "1..*", converter = SelectorConverter.UniqueId.class, // description = "Select a unique id for test discovery. This option can be repeated.") - private final List selectedUniqueIds = new ArrayList<>(); + private List selectedUniqueIds = new ArrayList<>(); @Option(names = "--select", paramLabel = "PREFIX:VALUE", arity = "1..*", converter = SelectorConverter.Identifier.class, // description = "Select via a prefixed identifier (e.g. method:com.acme.Foo#m selects the m() method in the com.acme.Foo class). " + "This option can be repeated.") - private final List selectorIdentifiers = new ArrayList<>(); + private List selectorIdentifiers = new ArrayList<>(); SelectorOptions() { } @@ -147,46 +147,46 @@ public static class FilterOptions { + "names that begin with \"Test\" or end with \"Test\" or \"Tests\". " // + "When this option is repeated, all patterns will be combined using OR semantics. " // + "Default: ${DEFAULT-VALUE}") - private final List includeClassNamePatterns = new ArrayList<>(); + private List includeClassNamePatterns = new ArrayList<>(); @Option(names = { "-N", "--exclude-classname" }, paramLabel = "PATTERN", arity = "1", description = "Provide a regular expression to exclude those classes whose fully qualified names match. " // + "When this option is repeated, all patterns will be combined using OR semantics.") - private final List excludeClassNamePatterns = new ArrayList<>(); + private List excludeClassNamePatterns = new ArrayList<>(); @Option(names = "--include-package", paramLabel = "PKG", arity = "1", description = "?Provide a package to be included in the test run. This option can be repeated.") - private final List includePackages = new ArrayList<>(); + private List includePackages = new ArrayList<>(); @Option(names = "--exclude-package", paramLabel = "PKG", arity = "1", description = "Provide a package to be excluded from the test run. This option can be repeated.") - private final List excludePackages = new ArrayList<>(); + private List excludePackages = new ArrayList<>(); @Option(names = "--include-methodname", paramLabel = "PATTERN", arity = "1", description = "Provide a regular expression to include only methods whose fully qualified names without parameters match. " // + "When this option is repeated, all patterns will be combined using OR semantics.") - private final List includeMethodNamePatterns = new ArrayList<>(); + private List includeMethodNamePatterns = new ArrayList<>(); @Option(names = "--exclude-methodname", paramLabel = "PATTERN", arity = "1", description = "Provide a regular expression to exclude those methods whose fully qualified names without parameters match. " // + "When this option is repeated, all patterns will be combined using OR semantics.") - private final List excludeMethodNamePatterns = new ArrayList<>(); + private List excludeMethodNamePatterns = new ArrayList<>(); @Option(names = { "-t", "--include-tag" }, paramLabel = "TAG", arity = "1", description = "Provide a tag or tag expression to include only tests whose tags match. " + // "When this option is repeated, all patterns will be combined using OR semantics.") - private final List includedTags = new ArrayList<>(); + private List includedTags = new ArrayList<>(); @Option(names = { "-T", "--exclude-tag" }, paramLabel = "TAG", arity = "1", description = "Provide a tag or tag expression to exclude those tests whose tags match. " + // "When this option is repeated, all patterns will be combined using OR semantics.") - private final List excludedTags = new ArrayList<>(); + private List excludedTags = new ArrayList<>(); @Option(names = { "-e", "--include-engine" }, paramLabel = "ID", arity = "1", description = "Provide the ID of an engine to be included in the test run. This option can be repeated.") - private final List includedEngines = new ArrayList<>(); + private List includedEngines = new ArrayList<>(); @Option(names = { "-E", "--exclude-engine" }, paramLabel = "ID", arity = "1", description = "Provide the ID of an engine to be excluded from the test run. This option can be repeated.") - private final List excludedEngines = new ArrayList<>(); + private List excludedEngines = new ArrayList<>(); private void applyTo(TestDiscoveryOptions result) { result.setIncludedClassNamePatterns(this.includeClassNamePatterns); @@ -207,10 +207,10 @@ public static class RuntimeConfigurationOptions { @Option(names = { "-" + CP_OPTION, "--classpath", "--class-path" }, converter = ClasspathEntriesConverter.class, paramLabel = "PATH", arity = "1", description = "Provide additional classpath entries " + "-- for example, for adding engines and their dependencies. This option can be repeated.") - private final List additionalClasspathEntries = new ArrayList<>(); + private List additionalClasspathEntries = new ArrayList<>(); // Implementation note: the @Option annotation is on a setter method to allow validation. - private final Map configurationParameters = new LinkedHashMap<>(); + private Map configurationParameters = new LinkedHashMap<>(); @Option(names = "--config-resource", paramLabel = "PATH", arity = "1", description = "Set configuration parameters for test discovery and execution via a classpath resource. This option can be repeated.") private List configurationParametersResources = new ArrayList<>(); diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/ProcessStarters.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/ProcessStarters.java index 0fc656e669c8..1b0fdb2859d8 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/ProcessStarters.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/ProcessStarters.java @@ -50,10 +50,6 @@ public static ProcessStarter gradlew() { .addArguments("-PjunitVersion=" + Helper.version()); } - public static ProcessStarter maven() { - return maven(currentJdkHome()); - } - public static ProcessStarter maven(Path javaHome) { return new ProcessStarter() // .executable(Path.of(System.getProperty("mavenDistribution")).resolve("bin").resolve( diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java index 115ea298e815..3390935d71f0 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenEnvVars.java @@ -10,19 +10,33 @@ package platform.tooling.support.tests; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import org.junit.jupiter.api.condition.JRE; final class MavenEnvVars { - private static final Map FOR_JDK24_AND_LATER = Map.of("MAVEN_OPTS", String.join(" ", // + private static final List FOR_JDK24_AND_LATER = List.of( // "--enable-native-access=ALL-UNNAMED", // https://issues.apache.org/jira/browse/MNG-8248 "--sun-misc-unsafe-memory-access=allow" // https://issues.apache.org/jira/browse/MNG-8399 - )); + ); + private static final List FOR_JDK26_AND_LATER = List.of( // + "--enable-final-field-mutation=ALL-UNNAMED" // https://github.com/junit-team/junit-framework/issues/5173 + ); static Map forJre(JRE jre) { - return jre.compareTo(JRE.JAVA_24) >= 0 ? FOR_JDK24_AND_LATER : Map.of(); + var list = new ArrayList(); + if (jre.compareTo(JRE.JAVA_24) >= 0) + list.addAll(FOR_JDK24_AND_LATER); + if (jre.compareTo(JRE.JAVA_26) >= 0) { + // exclude "leyden" and "valhalla" builds + if (Runtime.version().build().orElse(0) >= 25) { + list.addAll(FOR_JDK26_AND_LATER); + } + } + return list.isEmpty() ? Map.of() : Map.of("MAVEN_OPTS", String.join(" ", list)); } private MavenEnvVars() { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/UnalignedClasspathTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/UnalignedClasspathTests.java index c68e03811024..9db82883e399 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/UnalignedClasspathTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/UnalignedClasspathTests.java @@ -51,8 +51,8 @@ void verifyErrorMessageForUnalignedClasspath(JRE jre, Path javaHome, @TempDir Pa .workingDir(copyToWorkspace(Projects.JUPITER_STARTER, workspace)) // .addArguments(localMavenRepo.toCliArgument(), "-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("-Dsnapshot.repo.url=" + mavenRepoProxy.getBaseUri()) // - .addArguments("-Djunit.platform.commons.version=1.11.4").addArguments("--update-snapshots", - "--batch-mode", "verify") // + .addArguments("-Djunit.platform.commons.version=1.11.4") // + .addArguments("--update-snapshots", "--batch-mode", "verify") // .putEnvironment(MavenEnvVars.forJre(jre)) // .redirectOutput(outputFiles); var result = starter.startAndWait();