[[v6.1.0]]
== 6.1.0

*Date of Release:* May 19, 2026

*Scope:*

* New `@DefaultLocale` and `@DefaultTimeZone` built-in extensions
* New built-in extension for clearing/setting/restoring system properties
* Configurable deletion strategy for `@TempDir` that allows ignoring failures
* New `org.junit.start` module for usage in compact source files
* Execution mode configuration support for dynamic tests and containers
* Improved stack trace pruning for assertion failures
* New `org.junit.jupiter.api.Constants` class for referencing configuration parameters
* Improvements to legacy XML reports for parameterized test classes
* New parallel test executor implementation
* New experimental memory cleanup mode for large test suites

For a complete list of all _closed_ issues and pull requests for this release, consult the
link:{junit-framework-repo}+/milestone/104?closed=1+[6.1.0-M1],
link:{junit-framework-repo}+/milestone/112?closed=1+[6.1.0-RC1], and
link:{junit-framework-repo}+/milestone/119?closed=1+[6.1.0] milestone pages in the JUnit
repository on GitHub.


[[v6.1.0-junit-platform]]
=== JUnit Platform

[[v6.1.0-junit-platform-bug-fixes]]
==== Bug Fixes

* A deadlock issue in `NamespacedHierarchicalStore.computeIfAbsent(N, K, Function)` has
  been fixed.
* `WorkerThreadPoolHierarchicalTestExecutorService` now rechecks the _done_ condition
  before rejecting an extraneous worker.
* Missing precondition checks have been added to `Launcher` implementations.
* Failures to resolve selectors are now propagated by the Suite Engine.
* `AbstractTestDescriptor.getChildren()` now returns immutable set of children rather than a
  merely unmodifiable set.

[[v6.1.0-junit-platform-deprecations-and-breaking-changes]]
==== Deprecations and Breaking Changes

* Deprecate constructors for `ForkJoinPoolHierarchicalTestExecutorService` in favor of the
  new `ParallelHierarchicalTestExecutorServiceFactory` that also supports
  `WorkerThreadPoolHierarchicalTestExecutorService`.
* In the `EngineTestKit`, `Executions.started()` has been deprecated in favor of
  `Executions.finished()`, since started executions are always finished.

[[v6.1.0-junit-platform-new-features-and-improvements]]
==== New Features and Improvements

* Support for creating a `ModuleSelector` from a `java.lang.Module` and using
  its classloader for test discovery.
* New `selectClasspathResources(String...)` and `selectClasspathResources(List<String)`
  methods in `DiscoverySelectors`.
* `OpenTestReportGeneratingListener` now supports redirecting XML events to a socket via
  the new `junit.platform.reporting.open.xml.socket` configuration parameter. When set to a
  port number, events are sent to `127.0.0.1:<port>` instead of being written to a file.
* New `WorkerThreadPoolHierarchicalTestExecutorService` implementation used for parallel
  test execution that is backed by a regular thread pool rather than a `ForkJoinPool`.
  Engine authors should switch to use `ParallelHierarchicalTestExecutorServiceFactory`
  rather than instantiating a concrete `HierarchicalTestExecutorService` implementation
  for parallel execution directly.
* New experimental memory cleanup mode that is useful when executing a large
  number of tests. It can be enabled via the new
  `junit.platform.execution.memory.cleanup.enabled` configuration parameter.
* Allow implementations of `HierarchicalTestEngine` to specify which nodes require the
  global read lock by overriding the `Node.isGlobalReadLockRequired()` method to return
  `false`.
* `TestDescriptor` implementation requirements have now been clarified in the
  corresponding Javadoc.
* The `UniqueId.uniqueIdFormat` field has been removed, reducing the size of `UniqueId`
  objects.


[[v6.1.0-junit-jupiter]]
=== JUnit Jupiter

[[v6.1.0-junit-jupiter-bug-fixes]]
==== Bug Fixes

* Recursive updates are now supported when using `computeIfAbsent(K, Function, Class)` in
  the `ExtensionContext.Store`, providing parity with the deprecated
  `getOrComputeIfAbsent(K, Function, Class)` method.
* Legacy XML reports now include the index of `@ClassTemplate`/`@ParameterizedClass`
  invocations in test names to make them unique.
* Legacy XML reports now include parent display names to make it easier to distinguish
  between invocations for different parameters.

[[v6.1.0-junit-jupiter-deprecations-and-breaking-changes]]
==== Deprecations and Breaking Changes

* The `OTHER` constant of `{JRE}` has been deprecated in favor of the `int`/`int[]`
  annotation attributes of `{EnabledOnJre}`, `{DisabledOnJre}`, `{EnabledForJreRange}`,
  and `{DisabledForJreRange}` which allow referencing JRE versions later than those
  supported by the `JRE` enum.
* The `org.junit.jupiter.engine.Constants` class and its constants are now deprecated in
  favor of `org.junit.jupiter.api.Constants`.

[[v6.1.0-junit-jupiter-new-features-and-improvements]]
==== New Features and Improvements

* https://www.junit-pioneer.org/[JUnit Pioneer]'s `DefaultLocaleExtension` and
  `DefaultTimeZoneExtension` are now part of JUnit Jupiter. Find examples in the
  xref:writing-tests/built-in-extensions.adoc#DefaultLocaleAndTimeZone[User Guide].
* JUnit Pioneer's `SystemPropertyExtension` is now part of JUnit Jupiter. Find examples in
  the xref:writing-tests/built-in-extensions.adoc#system-properties[User Guide]. For
  details regarding implementation differences between JUnit Pioneer and Jupiter, see the
  corresponding https://github.com/junit-team/junit-framework/pull/5258[pull request].
* `@TempDir` now allows configuring a deletion strategy for temporary directories. This is
  typically used to gain control over what happens when deletion of a file or directory
  fails (see
  xref:writing-tests/built-in-extensions.adoc#TempDirDeletionStrategy[User Guide] for
  details).
* `JAVA_27` has been added to the `JRE` enum for use with `JRE`-based execution conditions.
* Introduce new module `org.junit.start` for writing and running tests. It simplifies
  using JUnit in compact source files together with a single `module import` statement.
  Find an example at the xref:running-tests/source-launcher.adoc[User Guide].
* `Arguments` may now be created from instances of `Iterable` via the following new
  methods which make it easier to dynamically build arguments from collections when using
  `@ParameterizedTest`.
** `Arguments.of(Iterable<?>)`
** `Arguments.argumentsFrom(Iterable<?>)` (alias for `of(Iterable<?>)`)
** `Arguments.argumentSetFrom(String, Iterable<?>)`
** `Arguments.toList()` — returns a mutable `List<@Nullable Object>`
* `@EmptySource` now supports `Iterable`, `Iterator`, and `ListIterator`.
* `@Deprecated` factory methods are now excluded in the
  xref:writing-tests/parameterized-classes-and-tests.adoc#argument-conversion-implicit-fallback[fallback String-to-Object]
  conversion algorithm.
* Introduce new `dynamicTest(Consumer<? super Configuration>)` factory method for dynamic
  tests. It allows configuring the `ExecutionMode` of the dynamic test in addition to its
  display name, test source URI, and executable.
* Introduce new `dynamicContainer(Consumer<? super Configuration>)` factory method for
  dynamic containers. It allows configuring the `ExecutionMode` of the dynamic container
  and/or its children in addition to its display name, test source URI, and children.
* Enrich `assertInstanceOf` failure using the test subject `Throwable` as cause. It
  results in the stack trace of the test subject `Throwable` to get reported along with
  the failure.
* Make implementation of `HierarchicalTestExecutorService` used for parallel test
  execution configurable via the new
  `junit.jupiter.execution.parallel.config.executor-service` configuration parameter to
  in order to add support for `WorkerThreadPoolHierarchicalTestExecutorService`. Please
  refer to the
  xref:writing-tests/parallel-execution.adoc#config-executor-service[User Guide]
  for details.
* Internal stack frames are now removed from `AssertionFailedError` stack traces.
* New `trimStacktrace(Class<?>)` and `retainStackTraceElements(int)` methods in
  `AssertionFailureBuilder` which allow user-defined assertions to trim their stack traces.
* Generic inline value classes (such as `kotlin.Result<T>`) can now be used as parameters
  in `@ParameterizedTest` methods when `kotlin-reflect` is on the classpath. Note,
  however, that primitive-wrapper inline value classes (such as `UInt` or custom value
  classes wrapping primitives) are not yet supported.
* Kotlin-specific assertions now include a variant of `assertThrowsExactly` with reified
  generics.
* The new `org.junit.jupiter.api.Constants` class provides constants for
  xref:running-tests/configuration-parameters.adoc[] specific to the Jupiter engine.
* The `{EmptySource}` annotation now provides a `type` attribute that allows configuring
  the type of the empty argument explicitly. This is intended to be used in conjunction
  with an `{ArgumentConverter}` that supports the specified type.


[[v6.1.0-junit-vintage]]
=== JUnit Vintage

No changes.
