This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new a73825b9d Clean up leftovers of the JUnit 4.7 provider (#3571)
a73825b9d is described below
commit a73825b9d6eeadd64ee9376ea12c149f6c7ccc5a
Author: Olivier Lamy <[email protected]>
AuthorDate: Mon Nov 9 21:30:22 2026 +1000
Clean up leftovers of the JUnit 4.7 provider (#3571)
Since 3.6.0 every JUnit 4 test runs on the JUnit Platform through the
vintage engine, which needs JUnit 4.12 or newer. A few checks and docs
still talked about the old JUnit 4.7 provider.
- The groups/excludedGroups check no longer looks at the JUnit version.
A JUnit older than 4.12 is already rejected by createProviders(), which
names the version it found, so the groups check only fails when the
module has no test framework at all.
- The 4.12 minimum now lives in one place, SurefireDependencyResolver.
- Remove the unused ProviderInfo.Engine enum, the JUnit 4.7 helpers and a
duplicated engine resolution block.
- Parameter docs say "JUnit 4 via the Vintage engine" instead of
"JUnit 4.7 provider".
Signed-off-by: Olivier Lamy <[email protected]>
---
.../maven/plugin/failsafe/IntegrationTestMojo.java | 4 +-
.../plugin/surefire/AbstractSurefireMojo.java | 91 +++++++---------------
.../surefire/StartupReportConfiguration.java | 2 +-
.../surefire/SurefireDependencyResolver.java | 11 +++
.../maven/surefire/providerapi/ProviderInfo.java | 16 ++--
.../AbstractSurefireMojoProvidersInfoTest.java | 22 +++++-
.../plugin/surefire/AbstractSurefireMojoTest.java | 14 ++--
.../apache/maven/plugin/surefire/SurefireMojo.java | 4 +-
.../surefire/api/report/TestReportListener.java | 3 -
9 files changed, 80 insertions(+), 87 deletions(-)
diff --git
a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
index 925eb28ec..66b085acc 100644
---
a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
+++
b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
@@ -242,7 +242,7 @@ public class IntegrationTestMojo extends
AbstractSurefireMojo {
* <br>
* Each include item may also contain a comma-separated sublist of items,
which will be treated as multiple
* {@literal <include>} entries.<br>
- * Since 2.19 a complex syntax is supported in one parameter (JUnit 4,
JUnit 4.7+, TestNG):
+ * Since 2.19 a complex syntax is supported in one parameter:
* <pre><code>
* {@literal <include>}%regex[.*[Cat|Dog].*], Basic????,
!Unstable*{@literal </include>}
* {@literal <include>}%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class],
pkg{@literal /}**{@literal /}*Fast*.java{@literal </include>}
@@ -273,7 +273,7 @@ public class IntegrationTestMojo extends
AbstractSurefireMojo {
* <br>
* Each exclude item may also contain a comma-separated sub-list of items,
which will be treated as multiple
* {@literal <exclude>} entries.<br>
- * Since 2.19 a complex syntax is supported in one parameter (JUnit 4,
JUnit 4.7+, TestNG):
+ * Since 2.19 a complex syntax is supported in one parameter:
* <pre><code>
* {@literal <exclude>}%regex[pkg.*Slow.*.class], Unstable*{@literal
</exclude>}
* </code></pre>
diff --git
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index e5011324b..84c56d256 100644
---
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -584,11 +584,9 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private boolean childDelegation;
/**
- * (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since
2.22.0) Groups/categories/tags for this
- * test. Only classes/methods/etc decorated with one of the
groups/categories/tags specified here will be included
- * in test run, if specified.<br>
- * For JUnit4 tests, this parameter forces the use of the 4.7 provider.
For JUnit5 tests, this parameter forces
- * the use of the JUnit platform provider.<br>
+ * Groups/categories/tags for this test. Only classes/methods/etc
decorated with one of the
+ * groups/categories/tags specified here will be included in test run, if
specified.<br>
+ * Needs TestNG, JUnit 4.12+ or a JUnit Platform engine on the test
classpath.<br>
* Since version 2.18.1 and JUnit 4.12, the {@code @Category} annotation
type is automatically inherited from
* superclasses, see {@code @java.lang.annotation.Inherited}. Make sure
that test class inheritance still makes
* sense together with {@code @Category} annotation of the JUnit 4.12 or
higher appeared in superclass.
@@ -599,11 +597,9 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private String groups;
/**
- * (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since
2.22.0) Excluded groups/categories/tags.
- * Any methods/classes/etc with one of the groups/categories/tags
specified in this list will specifically not be
- * run.<br>
- * For JUnit4, this parameter forces the use of the 4.7 provider. For
JUnit5, this parameter forces the use of the
- * JUnit platform provider.<br>
+ * Excluded groups/categories/tags. Any methods/classes/etc with one of
the groups/categories/tags
+ * specified in this list will specifically not be run.<br>
+ * Needs TestNG, JUnit 4.12+ or a JUnit Platform engine on the test
classpath.<br>
* Since version 2.18.1 and JUnit 4.12, the {@code @Category} annotation
type is automatically inherited from
* superclasses, see {@code @java.lang.annotation.Inherited}. Make sure
that test class inheritance still makes
* sense together with {@code @Category} annotation of the JUnit 4.12 or
higher appeared in superclass.
@@ -630,8 +626,9 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private String testNGArtifactName;
/**
- * (TestNG/JUnit 4.7 provider) The attribute thread-count allows you to
specify how many threads should be
- * allocated for this execution. Only makes sense to use in conjunction
with the {@code parallel} parameter.
+ * (TestNG and JUnit 4 via the Vintage engine) The attribute thread-count
allows you to specify how
+ * many threads should be allocated for this execution. Only makes sense
to use in conjunction
+ * with the {@code parallel} parameter.
*
* @since 2.2
*/
@@ -666,8 +663,8 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private boolean reuseForks;
/**
- * (JUnit 4.7 provider) Indicates that threadCount, threadCountSuites,
threadCountClasses, threadCountMethods
- * are per cpu core.
+ * (JUnit 4 via the Vintage engine) Indicates that threadCount,
threadCountSuites,
+ * threadCountClasses, threadCountMethods are per cpu core.
*
* @since 2.5
* @deprecated not used on the JUnit Platform since 3.6.0, {@code
threadCount} is no longer multiplied by the
@@ -678,9 +675,10 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private boolean perCoreThreadCount;
/**
- * (JUnit 4.7 provider) Indicates that the thread pool will be unlimited.
The {@code parallel} parameter and
- * the actual number of classes/methods will decide. Setting this to
"true" effectively disables
- * {@code perCoreThreadCount} and {@code threadCount}. Defaults to "false".
+ * (JUnit 4 via the Vintage engine) Indicates that the thread pool will be
unlimited. The
+ * {@code parallel} parameter and the actual number of classes/methods
will decide. Setting this
+ * to "true" effectively disables {@code perCoreThreadCount} and {@code
threadCount}.
+ * Defaults to "false".
*
* @since 2.5
* @deprecated not used on the JUnit Platform since 3.6.0, use {@code
threadCount}
@@ -695,11 +693,11 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
* to respect their order of execution. Supports {@code methods}, {@code
classes}, {@code tests} and
* {@code instances}.
* <br>
- * (JUnit 4.7 provider) Supports values {@code classes}, {@code methods},
{@code both} to run
+ * (JUnit 4 via the Vintage engine) Supports values {@code classes},
{@code methods}, {@code both} to run
* in separate threads been controlled by {@code threadCount}.
* <br>
* <br>
- * Since version 2.16 (JUnit 4.7 provider), the value {@code both} is
<strong>DEPRECATED</strong>.
+ * Since version 2.16, the value {@code both} is
<strong>DEPRECATED</strong>.
* Use {@code classesAndMethods} instead.
* <br>
* <br>
@@ -713,7 +711,7 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private String parallel;
/**
- * (JUnit 4.7 / provider only) The thread counts do not exceed the number
of parallel suite, class runners and
+ * (JUnit 4 via the Vintage engine) The thread counts do not exceed the
number of parallel suite, class runners and
* average number of methods per class if set to <strong>true</strong>.
* <br>
* True by default.
@@ -726,7 +724,7 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private boolean parallelOptimized;
/**
- * (JUnit 4.7 provider) This attribute allows you to specify the
concurrency in test suites, i.e.:
+ * (JUnit 4 via the Vintage engine) This attribute allows you to specify
the concurrency in test suites, i.e.:
* <ul>
* <li>number of concurrent suites if {@code threadCount} is 0 or
unspecified</li>
* <li>limited suites concurrency if {@code useUnlimitedThreads} is set
to <strong>true</strong></li>
@@ -747,7 +745,7 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private int threadCountSuites;
/**
- * (JUnit 4.7 provider) This attribute allows you to specify the
concurrency in test classes, i.e.:
+ * (JUnit 4 via the Vintage engine) This attribute allows you to specify
the concurrency in test classes, i.e.:
* <ul>
* <li>number of concurrent classes if {@code threadCount} is 0 or
unspecified</li>
* <li>limited classes concurrency if {@code useUnlimitedThreads} is set
to <strong>true</strong></li>
@@ -770,7 +768,7 @@ public abstract class AbstractSurefireMojo extends
AbstractMojo implements Suref
private int threadCountClasses;
/**
- * (JUnit 4.7 provider) This attribute allows you to specify the
concurrency in test methods, i.e.:
+ * (JUnit 4 via the Vintage engine) This attribute allows you to specify
the concurrency in test methods, i.e.:
* <ul>
* <li>number of concurrent methods if {@code threadCount} is 0 or
unspecified</li>
* <li>limited concurrency of methods if {@code useUnlimitedThreads} is
set to <strong>true</strong></li>
@@ -1302,9 +1300,9 @@ protected List<ProviderInfo>
createProviders(TestClassPath testClasspath) throws
pluginArtifactMap,
consoleLogger,
getTestNgArtifact()));
- if (providerInfos.isEmpty()
- && getJunitArtifact() != null
- && !isWithinVersionSpec(getJunitArtifact(), "[4.12,)")) {
+ // No provider matched and the project does have JUnit, so its version
is below the minimum we
+ // support: that is the only way JUnit can fail to select the JUnit
Platform provider.
+ if (providerInfos.isEmpty() && getJunitArtifact() != null) {
throw new MojoExecutionException(String.format(
"The used JUnit Version %s is not supported anymore.
Please update to version 4.12+",
getJunitArtifact().getVersion()));
@@ -1860,14 +1858,6 @@ private static void checkThreadCountEntity(int count,
String entity) throws Mojo
}
}
- private boolean isJunit47Compatible(Artifact artifact) {
- return isWithinVersionSpec(artifact, "[4.7,)");
- }
-
- private boolean isAnyJunit4(Artifact artifact) {
- return isWithinVersionSpec(artifact, "[4.0,)");
- }
-
protected boolean isForking() {
return 0 < getEffectiveForkCount();
}
@@ -3016,24 +3006,18 @@ private List<CommandLineOption> commandLineOptions() {
}
private void warnIfDefunctGroupsCombinations() throws
MojoFailureException, MojoExecutionException {
- if (!isAnyGroupsSelected() || getTestNgArtifact() != null) {
- return;
- }
-
- Artifact junitArtifact = getJunitArtifact();
- if (isJunit47Compatible(junitArtifact) || getJUnit5Artifact() != null)
{
+ if (!isAnyGroupsSelected()) {
return;
}
- if (junitArtifact == null) {
+ // Don't check the JUnit version here. A JUnit older than 4.12 is
rejected right after by
+ // createProviders(), which names the version it found, so only
complain when the module has
+ // no test framework at all to group by.
+ if (getTestNgArtifact() == null && getJUnit5Artifact() == null &&
getJunitArtifact() == null) {
throw new MojoFailureException("groups/excludedGroups are
specified but no test framework "
- + "supporting groups was found on the test classpath. Add
TestNG, JUnit 4.7+ or a "
+ + "supporting groups was found on the test classpath. Add
TestNG, JUnit 4.12+ or a "
+ "JUnit Platform engine to the test dependencies of this
module.");
}
-
- throw new MojoFailureException("groups/excludedGroups are specified
but the JUnit version on the "
- + "test classpath (" + junitArtifact.getVersion() + ") is too
old to support groups. "
- + "Check your dependency:tree to see if your project is
picking up an old junit version.");
}
private void warnIfRerunClashes() throws MojoFailureException {
@@ -3195,7 +3179,6 @@ class JUnitPlatformProviderInfo implements ProviderInfo {
private final PluginDescriptor pluginDescriptor;
private final Map<String, Artifact> pluginArtifactMap;
private final ConsoleLogger consoleLogger;
- private ProviderInfo.Engine engine =
ProviderInfo.Engine.JUNIT_PLATFORM;
@SuppressWarnings("checkstyle:parameternumber")
JUnitPlatformProviderInfo(
@@ -3222,16 +3205,6 @@ class JUnitPlatformProviderInfo implements ProviderInfo {
this.junitArtifact = junitArtifact;
this.booterArtifact = booterArtifact;
this.testNgArtifact = testNgArtifact;
- // JUnit 4.12+ is required by JUnit 5.3+
- // JUnit 4.13+ is required by JUnit 5.8+
- // JUnit 4.13.2 is required by JUnit 5.9+
- // JUnit 4.13.3 is required by JUnit 5.10+
- // JUnit 4.13.4 is required by JUnit 5.12+
- //
https://junit.org/junit5/docs/current/user-guide/#dependency-metadata
-
- if (isAnyJunit4(junitArtifact)) {
- this.engine = Engine.JUNIT4;
- }
this.surefireDependencyResolver = surefireDependencyResolver;
}
@@ -3363,10 +3336,6 @@ public Set<Artifact> getProviderClasspath() throws
MojoExecutionException {
addEngineByApi(engineGroupId, engineArtifactId, engineVersion,
providerArtifacts);
}
- if (!hasDependencyPlatformEngine(providerArtifacts)) {
- addEngineByApi(engineGroupId, engineArtifactId, engineVersion,
providerArtifacts);
- }
-
narrowDependencies(providerArtifacts, testDeps);
alignProviderVersions(providerArtifacts, engineVersion,
testDeps.get(api));
diff --git
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
index 45f642b5c..eed513d1d 100644
---
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
+++
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
@@ -228,7 +228,7 @@ public StatelessReportEventListener<WrappedReportEntry,
TestSetStats> instantiat
// If forking TestNG the suites have same name 'TestSuite' and tend to
override report statistics in stateful
// reporter, see Surefire1535TestNGParallelSuitesIT. The
testClassMethodRunHistory should be isolated.
- // In the in-plugin execution of parallel JUnit4.7 with rerun the map
must be shared because reports and
+ // In the in-plugin execution of parallel JUnit 4 with rerun the map
must be shared because reports and
// listeners are in ThreadLocal, see
Surefire1122ParallelAndFlakyTestsIT.
Map<String, Deque<WrappedReportEntry>> testClassMethodRunHistory =
isForking ? new ConcurrentHashMap<>() :
this.testClassMethodRunHistory;
diff --git
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
index 23a922797..8791dcfb1 100644
---
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
+++
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
@@ -72,6 +72,17 @@ public class SurefireDependencyResolver {
static final String PROVIDER_GROUP_ID = "org.apache.maven.surefire";
+ /**
+ * The oldest JUnit 4 we can run. Anything older is rejected: JUnit 3 and
4 tests run through the
+ * JUnit Platform vintage engine, which needs 4.12 or newer.
+ * <p>
+ * Newer JUnit 5 lines ask for more again, so a project may still need a
later JUnit 4 than this:
+ * 4.12+ for JUnit 5.3+, 4.13+ for 5.8+, 4.13.2 for 5.9+, 4.13.3 for
5.10+, 4.13.4 for 5.12+. See
+ * <a
href="https://junit.org/junit5/docs/current/user-guide/#dependency-metadata">the
JUnit 5
+ * dependency metadata</a>.
+ */
+ public static final String MINIMUM_JUNIT4_VERSION_SPEC = "[4.12,)";
+
private static final String[] PROVIDER_CLASSPATH_ORDER = {
"surefire-junit-platform", "surefire-api", "surefire-logger-api",
"surefire-shared-utils", "common-java5"
};
diff --git
a/maven-surefire-common/src/main/java/org/apache/maven/surefire/providerapi/ProviderInfo.java
b/maven-surefire-common/src/main/java/org/apache/maven/surefire/providerapi/ProviderInfo.java
index 4d6957aa2..8b4764dfa 100644
---
a/maven-surefire-common/src/main/java/org/apache/maven/surefire/providerapi/ProviderInfo.java
+++
b/maven-surefire-common/src/main/java/org/apache/maven/surefire/providerapi/ProviderInfo.java
@@ -25,8 +25,10 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.surefire.SurefireDependencyResolver;
import org.apache.maven.plugin.surefire.TestClassPath;
+import static
org.apache.maven.plugin.surefire.SurefireDependencyResolver.MINIMUM_JUNIT4_VERSION_SPEC;
import static
org.apache.maven.plugin.surefire.SurefireDependencyResolver.isWithinVersionSpec;
/**
@@ -34,13 +36,6 @@
*/
public interface ProviderInfo {
- enum Engine {
- JUNIT3,
- JUNIT4,
- TESTNG,
- JUNIT_PLATFORM
- }
-
@Nonnull
String getProviderName();
@@ -54,8 +49,13 @@ enum Engine {
@Nonnull
List<String[]> getJpmsArguments(@Nonnull ProviderRequirements
forkRequirements);
+ /**
+ * Is this a JUnit 4 we can actually run? Older than
+ * {@link SurefireDependencyResolver#MINIMUM_JUNIT4_VERSION_SPEC} is not
supported, so this is false
+ * for those and for a missing artifact.
+ */
default boolean isAnyJunit4(Artifact artifact) {
- return isWithinVersionSpec(artifact, "[4.12,)");
+ return isWithinVersionSpec(artifact, MINIMUM_JUNIT4_VERSION_SPEC);
}
default TestClassPath decorateTestClassPath(TestClassPath testClasspath)
throws MojoExecutionException {
diff --git
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoProvidersInfoTest.java
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoProvidersInfoTest.java
index bf40954dd..cbaf927f2 100644
---
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoProvidersInfoTest.java
+++
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoProvidersInfoTest.java
@@ -113,7 +113,7 @@ public void jUnit4ProviderJunit3AsDependencyArtifact() {
@Test
public void jUnit4ProviderJunit45AsDependencyArtifact() {
- Artifact junit = aArtifact("3.8.1");
+ Artifact junit = aArtifact("4.5");
ProviderInfo providerInfo = mojo
.new JUnitPlatformProviderInfo(
null, null, aTestClassPath(), junit, null, null, null, null,
null, null, null, null);
@@ -122,13 +122,31 @@ public void jUnit4ProviderJunit45AsDependencyArtifact() {
@Test
public void jUnit4ProviderJunit47AsDependencyArtifact() {
- Artifact junit = aArtifact("3.8.1");
+ Artifact junit = aArtifact("4.7");
+ ProviderInfo providerInfo = mojo
+ .new JUnitPlatformProviderInfo(
+ null, null, aTestClassPath(), junit, null, null, null, null,
null, null, null, null);
+ assertThat(providerInfo.isApplicable()).isFalse();
+ }
+
+ @Test
+ public void jUnit4ProviderJunit411AsDependencyArtifact() {
+ Artifact junit = aArtifact("4.11");
ProviderInfo providerInfo = mojo
.new JUnitPlatformProviderInfo(
null, null, aTestClassPath(), junit, null, null, null, null,
null, null, null, null);
assertThat(providerInfo.isApplicable()).isFalse();
}
+ @Test
+ public void jUnit4ProviderJunit412AsDependencyArtifact() {
+ Artifact junit = aArtifact("4.12");
+ ProviderInfo providerInfo = mojo
+ .new JUnitPlatformProviderInfo(
+ null, null, aTestClassPath(), junit, null, null, null, null,
null, null, null, null);
+ assertThat(providerInfo.isApplicable()).isTrue();
+ }
+
@Test
public void jUnit4ProviderJunit413AsDependencyArtifact() {
Artifact junit = aArtifact("4.13");
diff --git
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
index 4fafa2cf8..024d83719 100644
---
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
+++
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
@@ -1969,21 +1969,19 @@ public void
shouldFailWhenGroupsSelectedAndNoTestFrameworkOnClasspath() {
}
@Test
- public void shouldFailWhenGroupsSelectedAndJunitIsTooOld() {
+ public void shouldLeaveAnUnsupportedJunitVersionToProviderResolution()
throws Exception {
givenProjectArtifact();
- givenJunitOnTestClasspath("4.5");
+ givenJunitOnTestClasspath("4.11");
setInternalState(mojo, "excludedGroups", "SlowTest");
- Exception e = assertThrows(Exception.class, () -> invokeMethod(mojo,
"warnIfDefunctGroupsCombinations"));
- assertThat(e.getCause())
- .isInstanceOf(MojoFailureException.class)
- .hasMessageContaining("(4.5) is too old to support groups");
+ // createProviders() rejects this JUnit and names its version, so this
check stays quiet
+ invokeMethod(mojo, "warnIfDefunctGroupsCombinations");
}
@Test
- public void shouldAcceptGroupsWithJunit47OrNewer() throws Exception {
+ public void shouldAcceptGroupsWithSupportedJunit4() throws Exception {
givenProjectArtifact();
- givenJunitOnTestClasspath("4.13.2");
+ givenJunitOnTestClasspath("4.12");
setInternalState(mojo, "excludedGroups", "SlowTest");
invokeMethod(mojo, "warnIfDefunctGroupsCombinations");
diff --git
a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefireMojo.java
b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefireMojo.java
index 6d50f7f05..84ea744e9 100644
---
a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefireMojo.java
+++
b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefireMojo.java
@@ -196,7 +196,7 @@ public class SurefireMojo extends AbstractSurefireMojo
implements SurefireReport
* </code></pre>
* Each include item may also contain a comma-separated sub-list of items,
which will be treated as multiple
* {@literal <include>} entries.<br>
- * Since 2.19 a complex syntax is supported in one parameter (JUnit 4,
JUnit 4.7+, TestNG):
+ * Since 2.19 a complex syntax is supported in one parameter:
* <pre><code>
* {@literal <include>}%regex[.*[Cat|Dog].*], Basic????,
!Unstable*{@literal </include>}
* {@literal <include>}%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class],
pkg{@literal /}**{@literal /}*Fast*.java{@literal </include>}
@@ -227,7 +227,7 @@ public class SurefireMojo extends AbstractSurefireMojo
implements SurefireReport
* <br>
* Each exclude item may also contain a comma-separated sub-list of items,
which will be treated as multiple
* {@literal <exclude>} entries.<br>
- * Since 2.19 a complex syntax is supported in one parameter (JUnit 4,
JUnit 4.7+, TestNG):
+ * Since 2.19 a complex syntax is supported in one parameter:
* <pre><code>
* {@literal <exclude>}%regex[pkg.*Slow.*.class], Unstable*{@literal
</exclude>}
* </code></pre>
diff --git
a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/TestReportListener.java
b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/TestReportListener.java
index dbc6a0322..0a1bb34c8 100644
---
a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/TestReportListener.java
+++
b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/TestReportListener.java
@@ -34,9 +34,6 @@
* <br>
* The serialization of data in {@link TestReportListener} ensures that the
ReportEntries are transferred
* from the fork to the plugin.
- * <br>
- * Note: The adapters in the module <i>surefire-junit47</i> are temporal and
will be removed after we have fixed
- * the SUREFIRE-1860 and XML reporter in SUREFIRE-1643. The adapters are a
workaround of a real fix in both Jira issues.
*
* @param <T> usually {@link TestOutputReportEntry} or {@link
OutputReportEntry}
*/