|
20 | 20 | * Parallel execution support in JUnit Vintage engine |
21 | 21 | * Numerous bug fixes and other enhancements |
22 | 22 |
|
23 | | -For a complete list of all _closed_ issues and pull requests for this release, consult the link:{junit5-repo}+/milestone/75?closed=1+[5.12.0-M1], |
24 | | -link:{junit5-repo}+/milestone/88?closed=1+[5.12.0-RC1], |
25 | | -link:{junit5-repo}+/milestone/90?closed=1+[5.12.0-RC2], and |
26 | | -link:{junit5-repo}+/milestone/89?closed=1+[5.12.0] milestone pages in the JUnit repository |
27 | | -on GitHub. |
28 | | - |
29 | | - |
30 | | -[[release-notes-5.12.0-overall-improvements]] |
31 | | -=== Overall Improvements |
32 | | - |
33 | | -[[release-notes-5.12.0-overall-new-features-and-improvements]] |
34 | | -==== New Features and Improvements |
35 | | - |
36 | | -* All affected JAR files now include `native-image.properties` files that contain the |
37 | | -`--initialize-at-build-time` option to avoid breakages in GraalVM projects when updating |
38 | | -to newer versions of JUnit. |
39 | | - |
40 | | - |
41 | | -[[release-notes-5.12.0-junit-platform]] |
42 | | -=== JUnit Platform |
43 | | - |
44 | | -[[release-notes-5.12.0-junit-platform-deprecations-and-breaking-changes]] |
45 | | -==== Deprecations and Breaking Changes |
46 | | - |
47 | | -* `SearchOption` and `AnnotationSupport.findAnnotation(Class, Class, SearchOption)` from |
48 | | - `junit-platform-commons` have been deprecated. |
49 | | - |
50 | | -[[release-notes-5.12.0-junit-platform-new-features-and-improvements]] |
51 | | -==== New Features and Improvements |
52 | | - |
53 | | -* `ConsoleLauncher` now accepts multiple values for all `--select` options. |
54 | | -* `ConsoleLauncher` now supports a `--select-unique-id` option to select containers and |
55 | | - tests by unique ID. |
56 | | -* `ConsoleLauncher` supports new `--exclude-methodname` and `--include-methodname` options |
57 | | - to include or exclude methods based on fully qualified method names without parameters. |
58 | | - For example, `--exclude-methodname=^org\.example\..+#methodname` will exclude all |
59 | | - methods called `methodName` under package `org.example`. |
60 | | -* The `--select-file` and `--select-resource` options for the `ConsoleLauncher` now |
61 | | - support line and column numbers. |
62 | | -* New `ReflectionSupport.makeAccessible(Field)` public utility method to be used by third |
63 | | - parties instead of calling the internal `ReflectionUtils.makeAccessible(Field)` method |
64 | | - directly. |
65 | | -* The `ReflectionSupport.tryToLoadClass(...)` utility methods now support lookups for the |
66 | | - `"void"` pseudo-type, which indirectly supports `String` to `Class` conversion for |
67 | | - `"void"` in parameterized tests in JUnit Jupiter. |
68 | | -* New `addResourceContainerSelectorResolver()` method in |
69 | | - `EngineDiscoveryRequestResolver.Builder` which supports the discovery of class path |
70 | | - resource based tests, analogous to the existing `addClassContainerSelectorResolver()` |
71 | | - method. |
72 | | -* New `getOutputDirectoryProvider()` method in `EngineDiscoveryRequest` and `TestPlan` to |
73 | | - allow test engines to publish/attach files to containers and tests by calling |
74 | | - `EngineExecutionListener.fileEntryPublished(...)`. Registered `TestExecutionListeners` |
75 | | - can then access these files by overriding the `fileEntryPublished(...)` method. |
76 | | -* The following improvements have been made to the |
77 | | - <<../user-guide/index.adoc#junit-platform-reporting-open-test-reporting, Open Test Reporting>> |
78 | | - XML output: |
79 | | - - Information about the Git repository, the current branch, the commit hash, and the |
80 | | - current worktree status are now included in the XML report, if applicable. |
81 | | - - A section containing JUnit-specific metadata about each test/container to the HTML |
82 | | - report is now written by open-test-reporting when added to the classpath/module path |
83 | | - - Information about published files is now included as attachments. |
84 | | - - If <<../user-guide/index.adoc#running-tests-capturing-output, output capturing>> is |
85 | | - enabled, the captured output written to `System.out` and `System.err` is now included |
86 | | - in the XML report. |
87 | | -* Output written to `System.out` and `System.err` from non-test threads is now attributed |
88 | | - to the most recent test or container that was started or has written output. |
89 | | -* New public interface `ClasspathScanner` allowing third parties to provide a custom |
90 | | - implementation for scanning the classpath for classes and resources. |
91 | | -* New `AnnotationSupport.findAnnotation(Class, Class, List)` method to support searching |
92 | | - for an annotation on an inner class and its runtime enclosing instance types. |
93 | | -* New `TestDescriptor.orderChildren(UnaryOperator<List<TestDescriptor>> orderer)` |
94 | | - method to order children in place |
95 | | - |
96 | | - |
97 | | -[[release-notes-5.12.0-junit-jupiter]] |
98 | | -=== JUnit Jupiter |
99 | | - |
100 | | -[[release-notes-5.12.0-junit-jupiter-bug-fixes]] |
101 | | -==== Bug Fixes |
102 | | - |
103 | | -* Provide _runtime_ enclosing types of `@Nested` test classes and contained test methods |
104 | | - to `DisplayNameGenerator` implementations. Prior to this change, such generators were |
105 | | - only able to access the enclosing class in which `@Nested` was declared, but they could |
106 | | - not access the concrete runtime type of the enclosing instance. |
107 | | -* `@DisplayNameGeneration` annotations are now discovered on the _runtime_ enclosing types |
108 | | - of `@Nested` test classes instead of the compile-time enclosing class in which the |
109 | | - `@Nested` class was _declared_. |
110 | | -* Fix handling of "junctions" on Windows during `@TempDir` cleanup: junctions will no |
111 | | - longer be followed when deleting directories and broken junctions will be deleted. |
112 | | - |
113 | | -[[release-notes-5.12.0-junit-jupiter-deprecations-and-breaking-changes]] |
114 | | -==== Deprecations and Breaking Changes |
115 | | - |
116 | | -* When injecting `TestInfo` into test class constructors, the `TestInfo` now contains data |
117 | | - for the test method for which the test class instance is being created, unless the test |
118 | | - instance lifecycle is set to `PER_CLASS` (in which case it continues to contain the data |
119 | | - for the test class). If you require the `TestInfo` of the test class, you can implement |
120 | | - a `@BeforeAll` lifecycle method and inject `TestInfo` into that method. |
121 | | -* When injecting `TestReporter` into test class constructors the published report entries |
122 | | - are now associated with the test method rather than the test class, unless the test |
123 | | - instance lifecycle is set to `PER_CLASS` (in which case the published report entries |
124 | | - will continue to be associated with the test class). If you want to publish report |
125 | | - entries for the test class, you can implement a `@BeforeAll` lifecycle method and inject |
126 | | - `TestReporter` into that method. |
127 | | - |
128 | | -[[release-notes-5.12.0-junit-jupiter-new-features-and-improvements]] |
129 | | -==== New Features and Improvements |
130 | | - |
131 | | -* Kotlin contracts for Kotlin-specific assertion methods in `Assertions`. |
132 | | -* `@TempDir` is now supported on test class constructors. |
133 | | -* Shared resource locks may now be determined programmatically at runtime via the new |
134 | | - `@ResourceLock#providers` attribute that accepts implementations of |
135 | | - `ResourceLocksProvider`. |
136 | | -* Shared resource locks for _direct_ child nodes may now be configured via the new |
137 | | - `@ResourceLock(target = CHILDREN)` attribute. This may improve parallelization when |
138 | | - a test class declares a `READ` lock, but only a few methods hold a `READ_WRITE` lock. |
139 | | -* `@EnumSource` has new `from` and `to` attributes that support the selection of enum |
140 | | - constants within the specified range. |
141 | | -* In a `@ParameterizedTest` method, a `null` value can now be supplied for Java Date/Time |
142 | | - types such as `LocalDate` if the new `nullable` attribute in |
143 | | - `@JavaTimeConversionPattern` is set to `true`. |
144 | | -* The new `@ParameterizedTest(allowZeroInvocations = true)` attribute allows to specify that |
145 | | - the absence of invocations is expected in some cases and should not cause a test failure. |
146 | | -* Parameterized tests now support argument count validation. If the |
147 | | - `junit.jupiter.params.argumentCountValidation=strict` configuration parameter or the |
148 | | - `@ParameterizedTest(argumentCountValidation = STRICT)` attribute is set, any mismatch |
149 | | - between the declared number of arguments and the number of arguments provided by the |
150 | | - arguments source will result in an error. By default, it is still only an error if there |
151 | | - are fewer arguments provided than declared. |
152 | | -* `ArgumentsProvider` (declared via `@ArgumentsSource`), `ArgumentConverter` (declared via |
153 | | - `@ConvertWith`), and `ArgumentsAggregator` (declared via `@AggregateWith`) |
154 | | - implementations can now use constructor injection from registered `ParameterResolver` |
155 | | - extensions. |
156 | | -* `TestTemplateInvocationContextProvider` extensions can now signal that they may |
157 | | - potentially return zero invocation contexts by overriding the new |
158 | | - `mayReturnZeroTestTemplateInvocationContexts()` method. |
159 | | -* Extensions that implement `TestInstancePreConstructCallback`, `TestInstanceFactory`, |
160 | | - `TestInstancePostProcessor`, `ParameterResolver`, or `InvocationInterceptor` may |
161 | | - override the `getTestInstantiationExtensionContextScope()` method to enable receiving |
162 | | - a test-scoped `ExtensionContext` in `Extension` methods called during test class |
163 | | - instantiation. This behavior will become the default in future versions of JUnit. |
164 | | -* The new `PreInterruptCallback` interface defines the API for `Extensions` that wish to |
165 | | - be called prior to invocations of `Thread#interrupt()` by the `@Timeout` extension. |
166 | | -* When enabled via the `junit.jupiter.execution.timeout.threaddump.enabled` configuration |
167 | | - parameter, an implementation of `PreInterruptCallback` is registered that writes a |
168 | | - thread dump to `System.out` prior to interrupting a test thread due to a timeout. |
169 | | -* `TestReporter` now allows publishing files for a test method or test class which can be |
170 | | - used to include them in test reports, such as the Open Test Reporting format. |
171 | | -* Auto-registered extensions can now be |
172 | | - <<../user-guide/index.adoc#extensions-registration-automatic-filtering, filtered>> using |
173 | | - include and exclude patterns that can be specified as configuration parameters. |
174 | | -* `JRE`-based conditions such as `@EnabledOnJre` and `@DisabledForJreRange` now support |
175 | | - arbitrary Java versions. See the |
176 | | - <<../user-guide/index.adoc#writing-tests-conditional-execution-jre, User Guide>> for |
177 | | - details. |
178 | | -* The `@TempDir` extension now warns during cleanup when deleting symlinks that target |
179 | | - locations outside the temporary directory to signal that the target file or directory is |
180 | | - _not_ deleted, only the link to it. |
181 | | - |
182 | | - |
183 | | -[[release-notes-5.12.0-junit-vintage]] |
184 | | -=== JUnit Vintage |
185 | | - |
186 | | -[[release-notes-5.12.0-junit-vintage-new-features-and-improvements]] |
187 | | -==== New Features and Improvements |
188 | | - |
189 | | -* Added support for executing test classes and/or methods in parallel. Please refer to the |
190 | | - <<../user-guide/index.adoc#migrating-from-junit4-parallel-execution, User Guide>> for |
191 | | - more information. |
| 23 | +For complete details consult the |
| 24 | +https://junit.org/junit5/docs/5.12.0/release-notes/index.html[5.12.0 Release Notes] online. |
0 commit comments