|
19 | 19 | * Support for cancelling test execution via `CancellationToken`
|
20 | 20 | * Removal of various deprecated behaviors and APIs
|
21 | 21 |
|
22 |
| - |
23 |
| -For a complete list of all _closed_ issues and pull requests for this release, consult the |
24 |
| -link:{junit-framework-repo}+/milestone/87?closed=1+[6.0.0-M1], |
25 |
| -link:{junit-framework-repo}+/milestone/99?closed=1+[6.0.0-M2], |
26 |
| -link:{junit-framework-repo}+/milestone/102?closed=1+[6.0.0-RC1], |
27 |
| -link:{junit-framework-repo}+/milestone/105?closed=1+[6.0.0-RC2], |
28 |
| -link:{junit-framework-repo}+/milestone/106?closed=1+[6.0.0-RC3], and |
29 |
| -link:{junit-framework-repo}+/milestone/103?closed=1+[6.0.0] |
30 |
| -milestone pages in the JUnit repository on GitHub. |
31 |
| - |
32 |
| -[TIP] |
33 |
| -.Migration Guide |
34 |
| -==== |
35 |
| -Please refer to the |
36 |
| -https://github.com/junit-team/junit-framework/wiki/Upgrading-to-JUnit-6.0[wiki] for |
37 |
| -guidance on upgrading from JUnit 5.x.y to 6.0.0. |
38 |
| -==== |
39 |
| - |
40 |
| - |
41 |
| -[[release-notes-6.0.0-overall-improvements]] |
42 |
| -=== Overall Improvements |
43 |
| - |
44 |
| -[[release-notes-6.0.0-overall-deprecations-and-breaking-changes]] |
45 |
| -==== Deprecations and Breaking Changes |
46 |
| - |
47 |
| -* Minimum required Java version is now 17. |
48 |
| -* Minimum required Kotlin version is now 2.2. |
49 |
| -* Platform artifacts now use the same version number as Jupiter and Vintage artifacts. |
50 |
| - |
51 |
| -[[release-notes-6.0.0-overall-new-features-and-improvements]] |
52 |
| -==== New Features and Improvements |
53 |
| - |
54 |
| -* All JUnit modules now use https://jspecify.dev/[JSpecify] nullability annotations to |
55 |
| - indicate which method parameters, return types, etc. can be `null`. |
56 |
| - |
57 |
| - |
58 |
| -[[release-notes-6.0.0-junit-platform]] |
59 |
| -=== JUnit Platform |
60 |
| - |
61 |
| -[[release-notes-6.0.0-junit-platform-deprecations-and-breaking-changes]] |
62 |
| -==== Deprecations and Breaking Changes |
63 |
| - |
64 |
| -* Support for running the `ConsoleLauncher` without specifying a subcommand has been |
65 |
| - removed. |
66 |
| -* Support for non-conventional `ConsoleLauncher` options such as `--h` (rather than `-h`) |
67 |
| - or `-help` (rather than `--help`) has been removed. |
68 |
| -* The `junit-platform-runner` module which provided the JUnit 4 based `JUnitPlatform` |
69 |
| - runner has been removed. |
70 |
| -* The `junit-platform-jfr` module which provided custom Java Flight Recorder (JFR) events |
71 |
| - for test discovery and execution has been removed. The functionality is now available |
72 |
| - directly in the `junit-platform-launcher` module. |
73 |
| -* Support for Maven Surefire/Failsafe versions less than 3.0.0 has been removed. |
74 |
| -* The following deprecated APIs have been removed: |
75 |
| - - `ReflectionSupport.loadClass(String)` method |
76 |
| - - `ReflectionUtils.readFieldValue(...)` methods |
77 |
| - - `ReflectionUtils.getMethod(...)` method |
78 |
| - - `BlacklistedExceptions` class |
79 |
| - - `PreconditionViolationException` class (from `org.junit.platform.commons.util`) |
80 |
| - - `ClasspathScanningSupport` class |
81 |
| - - `ConfigurationParameters.size()` method |
82 |
| - - `MethodSelector.getMethodParameterTypes()` method |
83 |
| - - `NestedMethodSelector.getMethodParameterTypes()` method |
84 |
| - - `ReportEntry()` constructor |
85 |
| - - `SingleTestExecutor` class |
86 |
| - - `LauncherDiscoveryRequestBuilder()` constructor |
87 |
| - - `LegacyReportingUtils` class |
88 |
| - - `TestPlan.add(TestIdentifier)`, `TestPlan.getChildren(String)`, and |
89 |
| - `TestPlan.getTestIdentifier(String)` methods |
90 |
| - - `@UseTechnicalNames` annotation for suites |
91 |
| - - `EngineTestKit.execute(String, EngineDiscoveryRequest)`, |
92 |
| - `EngineTestKit.execute(TestEngine, EngineDiscoveryRequest)`, and |
93 |
| - `EngineTestKit.Builder.filters(DiscoveryFilter...)` methods |
94 |
| -* Support for "legacy semantics" for field and method searches that used to be |
95 |
| - configurable via the `junit.platform.reflection.search.useLegacySemantics` system |
96 |
| - property has been removed. JUnit now always adheres to standard Java semantics regarding |
97 |
| - whether a given field or method is visible or overridden according to the rules of the |
98 |
| - Java language. |
99 |
| -* The type bounds of the following methods have been changed to be more flexible and allow |
100 |
| - nullable and non-nullable types: |
101 |
| - - `ConfigurationParameters.get(String, Function)` |
102 |
| - - `NamespacedHierarchicalStore.getOrComputeIfAbsent(N, K, Function)` |
103 |
| - - `NamespacedHierarchicalStore.getOrComputeIfAbsent(N, K, Function, Class)` |
104 |
| -* The `junit-platform-suite-commons` module has been removed. Its functionality is now |
105 |
| - integrated directly in the `junit-platform-suite` module. |
106 |
| -* `ConversionSupport` now converts `String` to `Locale` using the IETF BCP 47 language tag |
107 |
| - format supported by the `Locale.forLanguageTag(String)` factory method instead of the |
108 |
| - format used by the deprecated `Locale(String)` constructor. |
109 |
| -* All `getOrComputeIfAbsent(...)` methods in `NamespacedHierarchicalStore` have been |
110 |
| - deprecated in favor of the new `computeIfAbsent(...)` methods. |
111 |
| -* Setting an invalid value for one of the following enum-based configuration parameters |
112 |
| - now causes test discovery to fail: |
113 |
| - - `junit.platform.discovery.issue.failure.phase` |
114 |
| - - `junit.platform.discovery.issue.severity.critical` |
115 |
| -* The methods `findNestedClasses(...)` and `streamNestedClasses(...)` in |
116 |
| - `ReflectionSupport` now return nested classes, which are declared in the same enclosing |
117 |
| - class or interface, ordered in a deterministic but intentionally nonobvious way. |
118 |
| -* Serialization support for `TestIdentifier` has been changed in a backwards-incompatible |
119 |
| - way in order to simplify the implementation. |
120 |
| - |
121 |
| -[[release-notes-6.0.0-junit-platform-new-features-and-improvements]] |
122 |
| -==== New Features and Improvements |
123 |
| - |
124 |
| -* New `Launcher.execute({LauncherExecutionRequest})` API with corresponding |
125 |
| - `{LauncherExecutionRequestBuilder}` to enable the addition of parameters to test |
126 |
| - executions in the future without additional overloads of `execute(...)`. |
127 |
| -* New `discoveryRequest()` method in `{LauncherDiscoveryRequestBuilder}` (analogous to |
128 |
| - `executionRequest(...)` in `{LauncherExecutionRequestBuilder}`), which is an alias for |
129 |
| - the existing `request()` method and is intended to be used via a `static` import. |
130 |
| -* New `LauncherDiscoveryRequestBuilder.forExecution()` method which serves as a |
131 |
| - convenience for constructing a `{LauncherExecutionRequest}` that contains a |
132 |
| - `{LauncherDiscoveryRequest}`. |
133 |
| -* New `selectClasses(...)` and `selectClassesByName(...)` factory methods have been |
134 |
| - introduced in `{DiscoverySelectors}` to simplify use cases where one needs to select |
135 |
| - multiple individual test classes for the `Launcher` or `EngineTestKit`. |
136 |
| -* New `selectors(List)` builder method for `{EngineTestKit}` which can be used in |
137 |
| - conjunction with the new `selectClasses(...)` and `selectClassesByName(...)` factory |
138 |
| - methods in `DiscoverySelectors`. |
139 |
| -* New support for cancelling a running test execution via a `{CancellationToken}` passed |
140 |
| - to the `{Launcher}` as part of a `{LauncherExecutionRequest}` and from there to all |
141 |
| - registered test engines. Please refer to the |
142 |
| - <<../user-guide/index.adoc#launcher-api-launcher-cancellation, User Guide>> for details |
143 |
| - and a usage example. |
144 |
| -* Passing the `--fail-fast` option to the `execute` subcommand of the `ConsoleLauncher` |
145 |
| - now causes test execution to be cancelled after the first failed test. |
146 |
| -* Cancellation support for implementations of `{HierarchicalTestEngine}` such as JUnit |
147 |
| - Jupiter, Spock, and Cucumber. |
148 |
| -* Cancellation support for the `@Suite` test engine. |
149 |
| -* New `TestTask.getTestDescriptor()` method for use in `HierarchicalTestExecutorService` |
150 |
| - implementations. |
151 |
| -* New `computeIfAbsent(...)` methods in `NamespacedHierarchicalStore` to simplify working |
152 |
| - with non-nullable types. |
153 |
| -* Convention-based conversion in `ConversionSupport` now supports factory methods and |
154 |
| - factory constructors that accept a single `CharSequence` argument in addition to the |
155 |
| - existing support for factories that accept a single `String` argument. |
156 |
| -* Non-printable control characters in display names are now replaced with alternative |
157 |
| - representations. For example, `\n` is replaced with `<LF>`. This applies to all display |
158 |
| - names in JUnit Jupiter, `@SuiteDisplayName`, and any other test engines that subclass |
159 |
| - `AbstractTestDescriptor`. Please refer to the |
160 |
| - <<../user-guide/index.adoc#writing-tests-display-names, User Guide>> for details. |
161 |
| -* Stack traces are now pruned up to the test method or lifecycle method. |
162 |
| - |
163 |
| - |
164 |
| -[[release-notes-6.0.0-junit-jupiter]] |
165 |
| -=== JUnit Jupiter |
166 |
| - |
167 |
| -[[release-notes-6.0.0-junit-jupiter-bug-fixes]] |
168 |
| -==== Bug Fixes |
169 |
| - |
170 |
| -* CSV headers are now properly supported with the default display name pattern and the |
171 |
| - explicit `+{argumentsWithNames}+` display name pattern for parameterized tests that |
172 |
| - utilize the `useHeadersInDisplayName` flag in `@CsvSource` and `@CsvFileSource`. |
173 |
| - Specifically, the parameter name is no longer duplicated in the display name when a CSV |
174 |
| - header is desired instead. |
175 |
| - |
176 |
| -[[release-notes-6.0.0-junit-jupiter-deprecations-and-breaking-changes]] |
177 |
| -==== Deprecations and Breaking Changes |
178 |
| - |
179 |
| -* The following deprecated APIs have been removed: |
180 |
| - - `MethodOrderer.Alphanumeric` class |
181 |
| - - `InvocationInterceptor.interceptDynamicTest(Invocation, ExtensionContext)` method |
182 |
| -* The deprecated `junit.jupiter.tempdir.scope` configuration parameter is no longer |
183 |
| - supported. |
184 |
| -* The `JRE` enum constants for `JAVA_8` to `JAVA_16` have been deprecated because they can |
185 |
| - no longer be used at runtime since `JAVA_17` is the new baseline. Please also manually |
186 |
| - update any values used with the `minVersion` and `maxVersion` attributes in |
187 |
| - `@EnabledForJreRange` and `@DisabledForJreRange` or the `versions` attributes in |
188 |
| - `@EnabledOnJre` and `@DisabledOnJre` to ensure that you are no longer declaring version |
189 |
| - values less than 17. |
190 |
| -* `@EnabledForJreRange` and `@DisabledForJreRange` now use `JAVA_17` as their default |
191 |
| - `min` value. |
192 |
| -* For consistency with test methods, `@Nested` classes declared in the same enclosing |
193 |
| - class or interface are now ordered in a deterministic but intentionally nonobvious |
194 |
| - way. |
195 |
| -* The `junit-jupiter-migrationsupport` module and its contained classes are now |
196 |
| - deprecated and will be removed in the next major version. |
197 |
| -* As a result of migrating from |
198 |
| - https://github.com/uniVocity/univocity-parsers[univocity-parsers] to |
199 |
| - https://fastcsv.org/[FastCSV] for `@CsvSource` and `@CsvFileSource`, root causes and |
200 |
| - messages of exceptions thrown for malformed CSV input may differ in some cases. While |
201 |
| - the overall parsing behavior remains consistent, this may affect custom error handling |
202 |
| - that relies on specific exception types or messages. |
203 |
| -* The `lineSeparator` attribute in `@CsvFileSource` has been removed. The line separator |
204 |
| - is now automatically detected, meaning that any of `\r`, `\n`, or `\r\n` is treated as a |
205 |
| - line separator. |
206 |
| -* Attributes such as `ignoreLeadingAndTrailingWhitespace`, `nullValues`, and others in |
207 |
| - `@CsvSource` and `@CsvFileSource` now apply to header fields as well as to regular |
208 |
| - fields. |
209 |
| -* Extra characters after a closing quote are no longer allowed in `@CsvSource` and |
210 |
| - `@CsvFileSource`. For example, if a single quote is used as the quote character, |
211 |
| - the following CSV value `'foo'INVALID,'bar'` will now cause an exception to be thrown. |
212 |
| - This helps ensure that malformed input is not silently accepted or misinterpreted. |
213 |
| -* Support for the `junit.jupiter.params.arguments.conversion.locale.format` configuration |
214 |
| - parameter has been removed. `Locale` conversions are now always performed using the IETF |
215 |
| - BCP 47 language tag format supported by the `Locale.forLanguageTag(String)` factory |
216 |
| - method. |
217 |
| -* The return type of the `provideTestTemplateInvocationContexts(ExtensionContext)` method |
218 |
| - in the `TestTemplateInvocationContextProvider` interface has been changed from |
219 |
| - `Stream<TestTemplateInvocationContext>` to |
220 |
| - `Stream<?{nbsp}extends{nbsp}TestTemplateInvocationContext>`. |
221 |
| -* The type bounds of the following methods have been changed to be more flexible and allow |
222 |
| - nullable and non-nullable types: |
223 |
| - - `ExtensionContext.getConfigurationParameter(String, Function)` |
224 |
| - - `ExtensionContext.getOrComputeIfAbsent(K, Function)` |
225 |
| - - `ExtensionContext.getOrComputeIfAbsent(K, Function, Class)` |
226 |
| -* All `getOrComputeIfAbsent(...)` methods in `ExtensionContext.Store` are now deprecated |
227 |
| - in favor of the new `computeIfAbsent(...)` methods. |
228 |
| -* Setting an invalid value for one of the following enum-based configuration parameters |
229 |
| - now causes test discovery or execution to fail: |
230 |
| - - `junit.jupiter.execution.parallel.mode.default` |
231 |
| - - `junit.jupiter.execution.parallel.mode.classes.default` |
232 |
| - - `junit.jupiter.execution.timeout.mode` |
233 |
| - - `junit.jupiter.execution.timeout.thread.mode.default` |
234 |
| - - `junit.jupiter.extensions.testinstantiation.extensioncontextscope.default` |
235 |
| - - `junit.jupiter.tempdir.cleanup.mode.default` |
236 |
| - - `junit.jupiter.testinstance.lifecycle.default` |
237 |
| -* The contracts for `Executable` parameters of Kotlin-specific `assertTimeout` functions |
238 |
| - have been changed from `callsInPlace(executable, EXACTLY_ONCE)` to |
239 |
| - `callsInPlace(executable, AT_MOST_ONCE)` which might result in compilation errors. |
240 |
| - |
241 |
| -[[release-notes-6.0.0-junit-jupiter-new-features-and-improvements]] |
242 |
| -==== New Features and Improvements |
243 |
| - |
244 |
| -* Non-printable control characters in display names are now replaced with alternative |
245 |
| - representations. Please refer to the |
246 |
| - <<../user-guide/index.adoc#writing-tests-display-names, User Guide>> for details. |
247 |
| -* For consistency with `@TestClassOrder`, `@TestMethodOrder` annotations specified on a |
248 |
| - test class are now inherited by its `@Nested` inner classes, recursively. |
249 |
| -* New `MethodOrderer.Default` and `ClassOrderer.Default` types for reverting back to |
250 |
| - default ordering on a `@Nested` class and its `@Nested` inner classes when an enclosing |
251 |
| - class specifies a different orderer via `@TestMethodOrder` or `@TestClassOrder`, |
252 |
| - respectively. |
253 |
| -* The implementation of `@CsvSource` and `@CsvFileSource` has been migrated from the no |
254 |
| - longer maintained https://github.com/uniVocity/univocity-parsers[univocity-parsers] to |
255 |
| - https://fastcsv.org/[FastCSV]. This improves the consistency of CSV input handling, |
256 |
| - especially for malformed entries, and provides better error reporting and overall |
257 |
| - performance. |
258 |
| -* Display names for `@ParameterizedClass` and `@ParameterizedTest` now consistently style |
259 |
| - name-value pairs for arguments using `name = value` formatting – for example, |
260 |
| - `fruit{nbsp}={nbsp}apple` instead of `fruit=apple`. |
261 |
| -* Text-based arguments in display names for parameterized tests are now quoted by default. |
262 |
| - In addition, special characters are escaped within quoted text. Please refer to the |
263 |
| - <<../user-guide/index.adoc#writing-tests-parameterized-tests-display-names-quoted-text, |
264 |
| - User Guide>> for details. |
265 |
| -* <<../user-guide/index.adoc#writing-tests-parameterized-tests-argument-conversion-implicit-fallback, |
266 |
| - Fallback String-to-Object Conversion>> for parameterized tests now supports factory |
267 |
| - methods and factory constructors that accept a single `CharSequence` argument in |
268 |
| - addition to the existing support for factories that accept a single `String` argument. |
269 |
| -* The `Arguments` interface for parameterized tests is now officially a |
270 |
| - `@FunctionalInterface`. |
271 |
| -* Kotlin's `suspend` modifier may now be applied to test and lifecycle methods. |
272 |
| -* New `computeIfAbsent(...)` methods in `ExtensionContext.Store` to simplify working |
273 |
| - with non-nullable types. |
274 |
| -* Reason strings supplied to `ConditionEvaluationResult` APIs are now officially declared |
275 |
| - as `@Nullable`. |
276 |
| - |
277 |
| - |
278 |
| -[[release-notes-6.0.0-junit-vintage]] |
279 |
| -=== JUnit Vintage |
280 |
| - |
281 |
| -[[release-notes-6.0.0-junit-vintage-deprecations-and-breaking-changes]] |
282 |
| -==== Deprecations and Breaking Changes |
283 |
| - |
284 |
| -* The JUnit Vintage test engine is now deprecated and will report an INFO level discovery |
285 |
| - issue if it finds at least one JUnit 4 test class. The deprecation warning is intended |
286 |
| - to clarify the purpose of the engine: it should only be used temporarily while migrating |
287 |
| - tests to JUnit Jupiter or another testing framework with native JUnit Platform support. |
288 |
| - |
289 |
| -[[release-notes-6.0.0-junit-vintage-new-features-and-improvements]] |
290 |
| -==== New Features and Improvements |
291 |
| - |
292 |
| -* Cancellation support for the Vintage test engine. |
| 22 | +For complete details consult the |
| 23 | +https://docs.junit.org/6.0.0/release-notes/[6.0.0 Release Notes] online. |
0 commit comments