Skip to content

Commit

Permalink
fix compatibility issue with new junit-jupiter version 5.4.* (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschmid committed Jul 5, 2019
1 parent 0c9a16e commit a5729d6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ dist: trusty
sudo: false

script:
- ./gradlew build -Pjunit4Version=4.10 -PjunitJupiterVersion=5.0.3 -PskipSpotBugs
- ./gradlew build -Pjunit4Version=4.11 -PjunitJupiterVersion=5.1.1 -PskipSpotBugs
- ./gradlew build -Pjunit4Version=4.10 -PjunitJupiterVersion=5.4.0 -PskipSpotBugs
- ./gradlew build -Pjunit4Version=4.11 -PjunitJupiterVersion=5.4.2 -PskipSpotBugs

- ./gradlew build

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Have a look to this repositories [Wiki](/../../wiki/) pages for documenation, us
* [Requirements](/../../wiki/Getting-started#requirements)
* [Download](/../../wiki/Getting-started#download)
* [Usage](/../../wiki/Getting-started#usage)
* [Version compatibility](/../../wiki/Version-compatibility)
* [Migration guides](/../../wiki/Migration-guides)
* [Migration from v1 to v2](/../../wiki/Migration-guides#migration-from-v1-to-v2)
* [Migration to JUnit5](/../../wiki/Migration-guides#migration-to-junit5)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (!hasProperty("junit4Version")) { // set default junit version if not set via
println "Using JUnit4 version ${junit4Version} for current build."

if (!hasProperty("junitJupiterVersion")) { // set default junit version if not set via command line
ext.junitJupiterVersion = "5.2.0"
ext.junitJupiterVersion = "5.4.0"
}
println "Using JUnit Jupiter version ${junitJupiterVersion} for current build."

Expand Down
4 changes: 2 additions & 2 deletions junit-jupiter-params/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.1.1</version>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.1.1</version>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
import org.junit.jupiter.api.extension.ExtensionContext.Store;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.engine.config.DefaultJupiterConfiguration;
import org.junit.jupiter.engine.execution.ExecutableInvoker;
import org.junit.jupiter.engine.extension.ExtensionRegistry;
import org.junit.jupiter.params.provider.Arguments;
Expand Down Expand Up @@ -135,7 +136,7 @@ protected Object invokeDataProviderMethodToRetrieveData(Method dataProviderMetho
}
try {
// TODO how to not require junit-jupiter-engine dependency and reuse already existing ExtensionRegistry?
ExtensionRegistry extensionRegistry = createRegistryWithDefaultExtensions(emptyConfigurationParameters());
ExtensionRegistry extensionRegistry = createRegistryWithDefaultExtensions(new DefaultJupiterConfiguration(emptyConfigurationParameters()));
Object data = executableInvoker.invoke(dataProviderMethod, context.getTestInstance().orElse(null), context,
extensionRegistry);
if (cacheDataProviderResult) {
Expand Down
2 changes: 1 addition & 1 deletion junit-jupiter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.1.1</version>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.junit.jupiter.api.extension.ExtensionContext.Store;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.junit.jupiter.api.extension.TestTemplateInvocationContext;
import org.junit.jupiter.engine.config.DefaultJupiterConfiguration;
import org.junit.jupiter.engine.execution.ExecutableInvoker;
import org.junit.jupiter.engine.extension.ExtensionRegistry;
import org.junit.platform.engine.ConfigurationParameters;
Expand Down Expand Up @@ -157,7 +158,7 @@ protected Object invokeDataProviderMethodToRetrieveData(Method dataProviderMetho
}
try {
// TODO how to not require junit-jupiter-engine dependency and reuse already existing ExtensionRegistry?
ExtensionRegistry extensionRegistry = createRegistryWithDefaultExtensions(emptyConfigurationParameters());
ExtensionRegistry extensionRegistry = createRegistryWithDefaultExtensions(new DefaultJupiterConfiguration(emptyConfigurationParameters()));
Object data = executableInvoker.invoke(dataProviderMethod, context.getTestInstance().orElse(null), context,
extensionRegistry);
if (cacheDataProviderResult) {
Expand Down

0 comments on commit a5729d6

Please sign in to comment.