You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by so...@apache.org on 2020/03/25 11:23:09 UTC
[maven-surefire] 01/01: [SUREFIRE-1764] Upgrade JUnit Platform to
1.6.1
This is an automated email from the ASF dual-hosted git repository.
sor pushed a commit to branch release/2.22.3
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 69bb857b49f48bbf077a2623fef0f10aaec4a0ee
Author: Christian Stein <so...@gmail.com>
AuthorDate: Wed Mar 25 10:24:44 2020 +0100
[SUREFIRE-1764] Upgrade JUnit Platform to 1.6.1
The JUnit team improved error reporting for engine
discovery/execution failures. The relevant changes are
in DefaultLauncher which is contained in the
junit-platform-launcher artifact.
This commit upgrades the JUnit Platform version to 1.6.1.
See also https://issues.apache.org/jira/browse/SUREFIRE-1764
---
surefire-providers/surefire-junit-platform/pom.xml | 4 ++--
.../maven/surefire/junitplatform/RunListenerAdapterTest.java | 11 ++++++-----
.../maven/surefire/junitplatform/TestMethodFilterTest.java | 8 ++++----
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/surefire-providers/surefire-junit-platform/pom.xml b/surefire-providers/surefire-junit-platform/pom.xml
index 3aa5820..b50dc6d 100644
--- a/surefire-providers/surefire-junit-platform/pom.xml
+++ b/surefire-providers/surefire-junit-platform/pom.xml
@@ -86,12 +86,12 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
- <version>1.3.1</version>
+ <version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
- <version>5.3.1</version>
+ <version>5.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
index 0ccb4fe..a6cbddd 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
@@ -46,9 +46,9 @@ import org.apache.maven.surefire.report.SimpleReportEntry;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.jupiter.engine.descriptor.ClassTestDescriptor;
import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor;
-import org.junit.platform.engine.ConfigurationParameters;
import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.TestDescriptor.Type;
import org.junit.platform.engine.TestExecutionResult;
@@ -69,7 +69,7 @@ import org.mockito.InOrder;
*/
public class RunListenerAdapterTest
{
- private static final ConfigurationParameters CONFIG_PARAMS = mock(ConfigurationParameters.class);
+ private static final JupiterConfiguration JUPITER_CONFIGURATION = mock(JupiterConfiguration.class);
private RunListener listener;
@@ -412,7 +412,7 @@ public class RunListenerAdapterTest
throws NoSuchMethodException
{
TestMethodTestDescriptor descriptor = new TestMethodTestDescriptor( newId(), MyTestClass.class,
- MyTestClass.class.getDeclaredMethod( "myNamedTestMethod" ) );
+ MyTestClass.class.getDeclaredMethod( "myNamedTestMethod" ), JUPITER_CONFIGURATION );
TestIdentifier factoryIdentifier = TestIdentifier.from( descriptor );
ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass( ReportEntry.class );
@@ -437,7 +437,8 @@ public class RunListenerAdapterTest
return new TestMethodTestDescriptor(
UniqueId.forEngine( "method" ),
MyTestClass.class,
- MyTestClass.class.getDeclaredMethod( MY_TEST_METHOD_NAME, parameterTypes ) );
+ MyTestClass.class.getDeclaredMethod( MY_TEST_METHOD_NAME, parameterTypes ),
+ JUPITER_CONFIGURATION );
}
private static TestIdentifier newClassIdentifier()
@@ -447,7 +448,7 @@ public class RunListenerAdapterTest
private static TestDescriptor newClassDescriptor()
{
- return new ClassTestDescriptor( UniqueId.root( "class", MyTestClass.class.getName() ), MyTestClass.class, CONFIG_PARAMS );
+ return new ClassTestDescriptor( UniqueId.root( "class", MyTestClass.class.getName() ), MyTestClass.class, JUPITER_CONFIGURATION );
}
private static TestIdentifier newSourcelessChildIdentifierWithParent(
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
index 6d4394e..3633faa 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
@@ -29,9 +29,9 @@ import java.lang.reflect.Method;
import org.apache.maven.surefire.testset.TestListResolver;
import org.junit.Test;
+import org.junit.jupiter.engine.config.JupiterConfiguration;
import org.junit.jupiter.engine.descriptor.ClassTestDescriptor;
import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor;
-import org.junit.platform.engine.ConfigurationParameters;
import org.junit.platform.engine.FilterResult;
import org.junit.platform.engine.UniqueId;
@@ -42,7 +42,7 @@ import org.junit.platform.engine.UniqueId;
*/
public class TestMethodFilterTest
{
- private static final ConfigurationParameters CONFIG_PARAMS = mock(ConfigurationParameters.class);
+ private static final JupiterConfiguration JUPITER_CONFIGURATION = mock(JupiterConfiguration.class);
private final TestListResolver resolver = mock( TestListResolver.class );
@@ -87,13 +87,13 @@ public class TestMethodFilterTest
UniqueId uniqueId = UniqueId.forEngine( "method" );
Class<TestClass> testClass = TestClass.class;
Method testMethod = testClass.getMethod( "testMethod" );
- return new TestMethodTestDescriptor( uniqueId, testClass, testMethod );
+ return new TestMethodTestDescriptor( uniqueId, testClass, testMethod, JUPITER_CONFIGURATION);
}
private static ClassTestDescriptor newClassTestDescriptor()
{
UniqueId uniqueId = UniqueId.forEngine( "class" );
- return new ClassTestDescriptor( uniqueId, TestClass.class, CONFIG_PARAMS );
+ return new ClassTestDescriptor( uniqueId, TestClass.class, JUPITER_CONFIGURATION);
}
public static class TestClass