Skip to content

Commit

Permalink
[SUREFIRE-2138] Update JUnit4/JUnit5 versions in docs
Browse files Browse the repository at this point in the history
Update JUnit versions referenced in configuration examples
to 4.13.2 and 5.9.1, the respective latest versions
  • Loading branch information
andpab authored and slawekjaranowski committed Jan 3, 2023
1 parent 6420f7c commit dd70772
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions maven-surefire-plugin/src/site/apt/examples/jpms.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module test
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -154,7 +154,7 @@ module test
demonstrating the Java Modularity (JPMS) in Maven multi-module project.

The JDK version must be 9 or higher. The POM contains the dependency
<<<org.junit.jupiter:junit-jupiter-engine:5.6.2>>> which is named module. It activates the internal provider
<<<org.junit.jupiter:junit-jupiter-engine:5.9.1>>> which is named module. It activates the internal provider
<<<surefire-junit-platform>>> in the plugin.

+---+
Expand Down
52 changes: 26 additions & 26 deletions maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
[...]
Expand All @@ -55,15 +55,15 @@ Using JUnit 5 Platform
(e.g., <<<src/test/java>>>).

If you want to write and execute JUnit 3 or 4 tests via the JUnit Platform add the Vintage Engine to the
dependencies, which transitively pulls in (and requires) <<<junit:junit:4.12>>>:
dependencies, which transitively pulls in (and requires) <<<junit:junit:4.13.2>>>:

+---+
<dependencies>
[...]
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.4.0</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
[...]
Expand All @@ -85,7 +85,7 @@ Using JUnit 5 Platform

** How to run only one API

Normally, the developer does not want to access internal classes of JUnit5 engine (e.g. <<<5.4.0>>>).
Normally, the developer does not want to access internal classes of JUnit5 engine (e.g. <<<5.9.1>>>).
In the next chapters you can find your way to use the Jupiter or JUnit5 API where the plugin would resolve the engine.

*** Jupiter API in test dependencies
Expand All @@ -100,7 +100,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.0</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
[...]
Expand All @@ -125,15 +125,15 @@ Using JUnit 5 Platform

In the following example the engine artifact appears in plugin dependencies and the engine is resolved by the plugin
and downloaded from a remote repository for plugins. You may want to update the version of engine with fixed bugs in
<<<5.3.2>>> but the API version <<<5.3.0>>> stays intact!
<<<5.9.1>>> but the API version <<<5.9.0>>> stays intact!

+---+
<dependencies>
[...]
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.0</version>
<version>5.9.0</version>
<scope>test</scope>
</dependency>
[...]
Expand All @@ -150,7 +150,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.3.2</version>
<version>5.9.1</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -172,7 +172,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
[...]
Expand All @@ -189,7 +189,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.4.0</version>
<version>5.9.1</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -212,13 +212,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -231,13 +231,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -250,13 +250,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -277,13 +277,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -299,7 +299,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -318,13 +318,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -340,7 +340,7 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -390,13 +390,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.6.2</version>
<version>1.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -413,13 +413,13 @@ Using JUnit 5 Platform
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<version>1.8.2</version>
<version>1.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion maven-surefire-plugin/src/site/apt/examples/junit.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Using JUnit
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
[...]
Expand Down
4 changes: 2 additions & 2 deletions maven-surefire-plugin/src/site/apt/examples/spock.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class CalculatorTest extends Specification
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
[...]
Expand Down Expand Up @@ -140,7 +140,7 @@ class CalculatorTest extends Specification
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.2</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
[...]
Expand Down
2 changes: 1 addition & 1 deletion maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Using TestNG
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
[...]
Expand Down
2 changes: 1 addition & 1 deletion maven-surefire-plugin/src/site/markdown/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The `pom.xml`:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
</dependency>
</dependencies>

Expand Down

0 comments on commit dd70772

Please sign in to comment.