Skip to content

Commit 29f4f70

Browse files
committed
Document @testinstance lifecycle support in the M5 Release Notes
Issue: #419
1 parent 56c484a commit 29f4f70

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Diff for: documentation/src/docs/asciidoc/release-notes-5.0.0-M5.adoc

+20-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
*Date of Release:* ❓
55

6-
*Scope:* Fifth milestone release of JUnit 5 with a focus on dynamic containers and minor
7-
API changes.
6+
*Scope:* Fifth milestone release of JUnit 5 with a focus on dynamic containers, test
7+
instance lifecycle management, and minor API changes.
88

99
WARNING: This is a milestone release and contains breaking changes. Please refer to the
1010
<<running-tests-ide-intellij-idea,instructions>> above to use this version in a version of
@@ -38,6 +38,7 @@ is placed on the Java 9 module path.
3838
| `junit-vintage-engine-<VERSION>.jar` | `org.junit.vintage.engine`
3939
|===
4040

41+
4142
[[release-notes-5.0.0-m5-junit-platform]]
4243
==== JUnit Platform
4344

@@ -69,7 +70,7 @@ is placed on the Java 9 module path.
6970
- `junit-platform-commons`: `ReflectionUtils.findAllClassesInClasspathRoot(Path, Predicate, Predicate)`
7071
* The `isLeaf()` method of the `org.junit.platform.engine.support.hierarchical.Node`
7172
interface has been removed.
72-
* The default methods `pruneTree()`, and `hasTests()` have been removed from
73+
* The default methods `pruneTree()` and `hasTests()` have been removed from
7374
`TestDescriptor`.
7475

7576
===== New Features and Improvements
@@ -94,6 +95,7 @@ is placed on the Java 9 module path.
9495
* The `ENGINE` enum constant was removed from `TestDescriptor.Type`. The default type of
9596
the `EngineDescriptor` is now `TestDescriptor.Type.CONTAINER`.
9697

98+
9799
[[release-notes-5.0.0-m5-junit-jupiter]]
98100
==== JUnit Jupiter
99101

@@ -116,6 +118,8 @@ is placed on the Java 9 module path.
116118
the functionality for creating an `Arguments` instance is now available via the
117119
`Arguments.of(...)` static factory method.
118120
* The `names` property of `@MethodSource` has been renamed to `value`.
121+
* The `getTestInstance()` method in the `TestExtensionContext` API has been moved to the
122+
`ExtensionContext` API.
119123

120124
[[release-notes-5.0.0-m5-migration-extension-api]]
121125
.Extension API Migration
@@ -133,6 +137,18 @@ is placed on the Java 9 module path.
133137

134138
===== New Features and Improvements
135139

140+
* The test instance lifecycle can now be switched from the default per-method mode to a
141+
new per-class mode via the new class-level `@TestInstance` annotation. This enables
142+
shared test instance state between test methods in a given test class as well as
143+
between non-static `@BeforeAll` and `@AfterAll` methods in the test class.
144+
- See <<writing-tests-test-instance-lifecycle>> for details.
145+
* `@BeforeAll` and `@AfterAll` methods are no longer required to be `static` if the test
146+
class is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. This enables the
147+
following new features.
148+
- Declaration of `@BeforeAll` and `@AfterAll` methods in `@Nested` test classes.
149+
- Declaration of `@BeforeAll` and `@AfterAll` on interface `default` methods.
150+
- Simplified declaration of `@BeforeAll` and `@AfterAll` methods in test classes
151+
implemented with the Kotlin programming language.
136152
* `Assertions.assertAll()` now tracks exceptions of any type (as opposed to only tracking
137153
exceptions of type `AssertionError`), unless the exception is a _blacklisted_ exception
138154
in which case it will be immediately rethrown.
@@ -149,6 +165,7 @@ is placed on the Java 9 module path.
149165
* `@TestFactory` now supports arbitrarily nested dynamic containers. See `DynamicContainer`
150166
and abstract base class `DynamicNode` for details.
151167

168+
152169
[[release-notes-5.0.0-m5-junit-vintage]]
153170
==== JUnit Vintage
154171

0 commit comments

Comments
 (0)