Skip to content

Commit 06e0742

Browse files
committed
Stop mentioning "old" JUnit versions in Javadoc and User Guide
Closes #4878
1 parent a2d357d commit 06e0742

File tree

20 files changed

+91
-96
lines changed

20 files changed

+91
-96
lines changed

documentation/src/docs/asciidoc/user-guide/api-evolution.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ following values.
3131
incompatible way for *at least* the next minor release of the current
3232
major version. If scheduled for removal, it will be demoted to `DEPRECATED` first.
3333
| `STABLE` | Intended for features that will not be changed in a backwards-
34-
incompatible way in the current major version (`5.*`).
34+
incompatible way in the current major version (`6.*`).
3535
|===
3636

3737
If the `@API` annotation is present on a type, it is considered to be applicable for all

documentation/src/docs/asciidoc/user-guide/appendix.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
[[reproducible-builds]]
55
=== Reproducible Builds
66

7-
Starting with version 5.7, JUnit aims for its non-javadoc JARs to be
8-
https://reproducible-builds.org/[reproducible].
7+
JUnit aims for its non-javadoc JARs to be https://reproducible-builds.org/[reproducible].
98

109
Under identical build conditions, such as Java version, repeated builds should provide the
1110
same output byte-for-byte.

documentation/src/docs/asciidoc/user-guide/extensions.adoc

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Java's <<extensions-registration-automatic,`ServiceLoader`>> mechanism.
2525
Developers can register one or more extensions _declaratively_ by annotating a test
2626
interface, test class, test method, or custom _<<writing-tests-meta-annotations,composed
2727
annotation>>_ with `@ExtendWith(...)` and supplying class references for the extensions to
28-
register. As of JUnit Jupiter 5.8, `@ExtendWith` may also be declared on fields or on
29-
parameters in test class constructors, in test methods, and in `@BeforeAll`, `@AfterAll`,
30-
`@BeforeEach`, and `@AfterEach` lifecycle methods.
28+
register. `@ExtendWith` may also be declared on fields or on parameters in test class
29+
constructors, in test methods, and in `@BeforeAll`, `@AfterAll`, `@BeforeEach`, and
30+
`@AfterEach` lifecycle methods.
3131

3232
For example, to register a `WebServerExtension` for a particular test method, you would
3333
annotate the test method as follows. We assume the `WebServerExtension` starts a local web
@@ -864,15 +864,20 @@ inner contexts may also be limited. Consult the corresponding Javadoc for detail
864864
methods available for storing and retrieving values via the `{ExtensionContext_Store}`.
865865

866866
[[extensions-keeping-state-autocloseable-support]]
867+
[NOTE]
867868
.Resource management via `_AutoCloseable_`
868-
NOTE: An extension context store is bound to its extension context lifecycle. When an
869-
extension context lifecycle ends it closes its associated store. As of JUnit 5.13,
870-
all stored values that are instances of `AutoCloseable` are notified by an invocation of
869+
====
870+
An extension context store is bound to its extension context lifecycle. When an extension
871+
context lifecycle ends it closes its associated store.
872+
873+
All stored values that are instances of `AutoCloseable` are notified by an invocation of
871874
their `close()` method in the inverse order they were added in (unless the
872875
`junit.jupiter.extensions.store.close.autocloseable.enabled`
873-
<<running-tests-config-params, configuration parameter>> is set to `false`). Older
874-
versions only supported `CloseableResource`, which is deprecated but still available for
875-
backward compatibility.
876+
<<running-tests-config-params, configuration parameter>> is set to `false`).
877+
878+
Versions prior to 5.13 only supported `CloseableResource`, which is deprecated but still
879+
available for backward compatibility.
880+
====
876881

877882
An example implementation of `AutoCloseable` is shown below, using an `HttpServer`
878883
resource.
@@ -905,10 +910,9 @@ include::{testDir}/example/HttpServerDemo.java[tags=user_guide]
905910
[TIP]
906911
.Migration Note for Resource Cleanup
907912
====
908-
909-
Starting with JUnit Jupiter 5.13, the framework automatically closes resources stored in
910-
the `ExtensionContext.Store` that implement `AutoCloseable`. In earlier versions, only
911-
resources implementing `Store.CloseableResource` were automatically closed.
913+
The framework automatically closes resources stored in the `ExtensionContext.Store` that
914+
implement `AutoCloseable`. In versions prior to 5.13, only resources implementing
915+
`Store.CloseableResource` were automatically closed.
912916
913917
If you're developing an extension that needs to support both JUnit Jupiter 5.13+ and
914918
earlier versions and your extension stores resources that need to be cleaned up, you

documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ tests to JUnit Jupiter.
199199
- Note that you may continue to use assertion methods from `org.junit.Assert` or any
200200
other assertion library such as {AssertJ}, {Hamcrest}, {Truth}, etc.
201201
* Assumptions reside in `org.junit.jupiter.api.Assumptions`.
202-
- Note that JUnit Jupiter 5.4 and later versions support methods from JUnit 4's
203-
`org.junit.Assume` class for assumptions. Specifically, JUnit Jupiter supports JUnit
204-
4's `AssumptionViolatedException` to signal that a test should be aborted instead of
202+
- Note that JUnit Jupiter supports methods from JUnit 4's `org.junit.Assume` class for
203+
assumptions. Specifically, JUnit Jupiter supports JUnit 4's
204+
`AssumptionViolatedException` to signal that a test should be aborted instead of
205205
marked as a failure.
206206
* `@Before` and `@After` no longer exist; use `@BeforeEach` and `@AfterEach` instead.
207207
* `@BeforeClass` and `@AfterClass` no longer exist; use `@BeforeAll` and `@AfterAll`

documentation/src/docs/asciidoc/user-guide/overview.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ This document is also available as a link:{userGuidePdfFileName}[PDF download].
1111
endif::linkToPdf[]
1212
endif::backend-html5[]
1313

14-
[[overview-what-is-junit-5]]
14+
[[overview-what-is-junit]]
1515
=== What is JUnit?
1616

17-
Unlike previous versions of JUnit, JUnit 5 and later is composed of several different
18-
modules from three different sub-projects.
17+
JUnit is composed of several different modules from three different sub-projects.
1918

2019
**JUnit {version} = _JUnit Platform_ + _JUnit Jupiter_ + _JUnit Vintage_**
2120

documentation/src/docs/asciidoc/user-guide/running-tests.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ the task and can serve as a starting point.
559559
===== Basic Usage
560560

561561
The following example demonstrates how to configure the `junitlauncher` task to select a
562-
single test class (i.e., `org.myapp.test.MyFirstJUnit5Test`).
562+
single test class (i.e., `com.example.project.CalculatorTests`).
563563

564564
[source,xml,indent=0]
565565
----
@@ -572,7 +572,7 @@ single test class (i.e., `org.myapp.test.MyFirstJUnit5Test`).
572572
573573
<junitlauncher>
574574
<classpath refid="test.classpath" />
575-
<test name="org.myapp.test.MyFirstJUnit5Test" />
575+
<test name="com.example.project.CalculatorTests" />
576576
</junitlauncher>
577577
----
578578

documentation/src/docs/asciidoc/user-guide/writing-tests.adoc

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ table lists the default display name generators available in Jupiter.
346346
|===
347347
| DisplayNameGenerator | Behavior
348348

349-
| `Standard` | Matches the standard display name generation behavior in place since JUnit Jupiter 5.0 was released.
349+
| `Standard` | Matches the standard display name generation behavior in place since JUnit Jupiter was introduced.
350350
| `Simple` | Extends the functionality of `Standard` by removing trailing parentheses for methods with no parameters.
351351
| `ReplaceUnderscores` | Replaces underscores with spaces.
352352
| `IndicativeSentences` | Generates complete sentences by concatenating the names of the test and the enclosing classes.
@@ -858,11 +858,12 @@ include::{testDir}/example/ConditionalTestExecutionDemo.java[tags=user_guide_jre
858858

859859
Since the enum constants defined in {JRE} are static for any given JUnit release, you
860860
might find that you need to configure a Java version that is not supported by the `JRE`
861-
enum. For example, as of JUnit Jupiter 5.12 the `JRE` enum defines `JAVA_25` as the
862-
highest supported Java version. However, you may wish to run your tests against later
863-
versions of Java. To support such use cases, you can specify arbitrary Java versions via
864-
the `versions` attributes in `@EnabledOnJre` and `@DisabledOnJre` and via the `minVersion`
865-
and `maxVersion` attributes in `@EnabledForJreRange` and `@DisabledForJreRange`.
861+
enum. For example, when JUnit Jupiter 5.12 was released the `JRE` enum defined `JAVA_25`
862+
as the highest supported Java version. However, you may wish to run your tests against
863+
later versions of Java. To support such use cases, you can specify arbitrary Java versions
864+
via the `versions` attributes in `@EnabledOnJre` and `@DisabledOnJre` and via the
865+
`minVersion` and `maxVersion` attributes in `@EnabledForJreRange` and
866+
`@DisabledForJreRange`.
866867

867868
The following listing demonstrates the use of these annotations with arbitrary Java
868869
versions.
@@ -902,10 +903,10 @@ include::{testDir}/example/ConditionalTestExecutionDemo.java[tags=user_guide_sys
902903

903904
[TIP]
904905
====
905-
As of JUnit Jupiter 5.6, `{EnabledIfSystemProperty}` and `{DisabledIfSystemProperty}` are
906-
_repeatable annotations_. Consequently, these annotations may be declared multiple times
907-
on a test interface, test class, or test method. Specifically, these annotations will be
908-
found if they are directly present, indirectly present, or meta-present on a given element.
906+
`{EnabledIfSystemProperty}` and `{DisabledIfSystemProperty}` are _repeatable annotations_.
907+
Consequently, these annotations may be declared multiple times on a test interface, test
908+
class, or test method. Specifically, these annotations will be found if they are directly
909+
present, indirectly present, or meta-present on a given element.
909910
====
910911

911912
[[writing-tests-conditional-execution-environment-variables]]
@@ -923,11 +924,10 @@ include::{testDir}/example/ConditionalTestExecutionDemo.java[tags=user_guide_env
923924

924925
[TIP]
925926
====
926-
As of JUnit Jupiter 5.6, `{EnabledIfEnvironmentVariable}` and
927-
`{DisabledIfEnvironmentVariable}` are _repeatable annotations_. Consequently, these
928-
annotations may be declared multiple times on a test interface, test class, or test
929-
method. Specifically, these annotations will be found if they are directly present,
930-
indirectly present, or meta-present on a given element.
927+
`{EnabledIfEnvironmentVariable}` and `{DisabledIfEnvironmentVariable}` are _repeatable
928+
annotations_. Consequently, these annotations may be declared multiple times on a test
929+
interface, test class, or test method. Specifically, these annotations will be found if
930+
they are directly present, indirectly present, or meta-present on a given element.
931931
====
932932

933933
[[writing-tests-conditional-execution-custom]]
@@ -1472,11 +1472,11 @@ void repeatedTest() {
14721472
}
14731473
----
14741474

1475-
Since JUnit Jupiter 5.10, `@RepeatedTest` can be configured with a failure threshold which
1476-
signifies the number of failures after which remaining repetitions will be automatically
1477-
skipped. Set the `failureThreshold` attribute to a positive number less than the total
1478-
number of repetitions in order to skip the invocations of remaining repetitions after the
1479-
specified number of failures has been encountered.
1475+
`@RepeatedTest` can be configured with a failure threshold which signifies the number of
1476+
failures after which remaining repetitions will be automatically skipped. Set the
1477+
`failureThreshold` attribute to a positive number less than the total number of
1478+
repetitions in order to skip the invocations of remaining repetitions after the specified
1479+
number of failures has been encountered.
14801480

14811481
For example, if you are using `@RepeatedTest` to repeatedly invoke a test that you suspect
14821482
to be _flaky_, a single failure is sufficient to demonstrate that the test is flaky, and
@@ -3276,12 +3276,11 @@ This heuristic is queried by the `disabled_on_debug` mode.
32763276
[[writing-tests-parallel-execution]]
32773277
=== Parallel Execution
32783278

3279-
By default, JUnit Jupiter tests are run sequentially in a single thread. Running tests in
3280-
parallel -- for example, to speed up execution -- is available as an opt-in feature since
3281-
version 5.3. To enable parallel execution, set the
3282-
`junit.jupiter.execution.parallel.enabled` configuration parameter to `true` -- for
3283-
example, in `junit-platform.properties` (see <<running-tests-config-params>> for other
3284-
options).
3279+
By default, JUnit Jupiter tests are run sequentially in a single thread; however, running
3280+
tests in parallel -- for example, to speed up execution -- is available as an opt-in
3281+
feature. To enable parallel execution, set the `junit.jupiter.execution.parallel.enabled`
3282+
configuration parameter to `true` -- for example, in `junit-platform.properties` (see
3283+
<<running-tests-config-params>> for other options).
32853284

32863285
Please note that enabling this property is only the first step required to execute tests
32873286
in parallel. If enabled, test classes and methods will still be executed sequentially by

junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import static org.apiguardian.api.API.Status.INTERNAL;
1717
import static org.apiguardian.api.API.Status.MAINTAINED;
1818
import static org.apiguardian.api.API.Status.STABLE;
19+
import static org.junit.jupiter.api.DisplayNameGenerator.getDisplayNameGenerator;
20+
import static org.junit.jupiter.api.DisplayNameGenerator.parameterTypesAsString;
1921
import static org.junit.platform.commons.support.AnnotationSupport.findAnnotation;
2022
import static org.junit.platform.commons.support.ModifierSupport.isStatic;
2123
import static org.junit.platform.commons.util.KotlinReflectionUtils.getKotlinSuspendingFunctionParameterTypes;
@@ -209,7 +211,7 @@ static String parameterTypesAsString(Method method) {
209211
* Standard {@code DisplayNameGenerator}.
210212
*
211213
* <p>This implementation matches the standard display name generation
212-
* behavior in place since JUnit Jupiter 5.0 was released.
214+
* behavior in place since JUnit Jupiter was introduced.
213215
*/
214216
class Standard implements DisplayNameGenerator {
215217

junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@
5151
* custom <em>composed annotation</em> that inherits the semantics of this
5252
* annotation.
5353
*
54-
* <p>As of JUnit Jupiter 5.6, this annotation is a {@linkplain Repeatable
55-
* repeatable} annotation. Consequently, this annotation may be declared multiple
56-
* times on an {@link java.lang.reflect.AnnotatedElement AnnotatedElement} (i.e.,
57-
* test interface, test class, or test method). Specifically, this annotation will
58-
* be found if it is directly present, indirectly present, or meta-present on a
59-
* given element.
54+
* <p>This annotation is a {@linkplain Repeatable repeatable} annotation and may
55+
* be declared multiple times on an {@link java.lang.reflect.AnnotatedElement
56+
* AnnotatedElement} such as a test interface, test class, or test method.
57+
* Specifically, this annotation will be found if it is directly present,
58+
* indirectly present, or meta-present on a given element.
6059
*
6160
* @since 5.1
6261
* @see org.junit.jupiter.api.condition.EnabledIf

junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@
5151
* custom <em>composed annotation</em> that inherits the semantics of this
5252
* annotation.
5353
*
54-
* <p>As of JUnit Jupiter 5.6, this annotation is a {@linkplain Repeatable
55-
* repeatable} annotation. Consequently, this annotation may be declared multiple
56-
* times on an {@link java.lang.reflect.AnnotatedElement AnnotatedElement} (i.e.,
57-
* test interface, test class, or test method). Specifically, this annotation will
58-
* be found if it is directly present, indirectly present, or meta-present on a
59-
* given element.
54+
* <p>This annotation is a {@linkplain Repeatable repeatable} annotation and may
55+
* be declared multiple times on an {@link java.lang.reflect.AnnotatedElement
56+
* AnnotatedElement} such as a test interface, test class, or test method.
57+
* Specifically, this annotation will be found if it is directly present,
58+
* indirectly present, or meta-present on a given element.
6059
*
6160
* @since 5.1
6261
* @see org.junit.jupiter.api.condition.EnabledIf

0 commit comments

Comments
 (0)