2025-03-31 15:33:51 +00:00
|
|
|
From b42885011a1ba16ac446a2b83a8164677519066f Mon Sep 17 00:00:00 2001
|
2024-10-06 19:54:10 +00:00
|
|
|
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
|
|
|
|
Date: Tue, 1 Oct 2024 22:01:47 +0200
|
|
|
|
Subject: [PATCH 2/2] Unshade surefire
|
|
|
|
|
|
|
|
---
|
2025-03-31 08:06:45 +00:00
|
|
|
maven-failsafe-plugin/pom.xml | 26 +++++----------
|
2024-10-06 19:54:10 +00:00
|
|
|
.../maven/plugin/failsafe/VerifyMojo.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../util/FailsafeSummaryXmlUtils.java | 6 ++--
|
2025-03-31 15:33:51 +00:00
|
|
|
maven-surefire-common/pom.xml | 32 ++++++++++++------
|
|
|
|
.../plugin/surefire/AbstractSurefireMojo.java | 28 +++++++---------
|
2024-10-06 19:54:10 +00:00
|
|
|
.../surefire/StartupReportConfiguration.java | 2 +-
|
2025-03-31 15:33:51 +00:00
|
|
|
.../surefire/SurefireDependencyResolver.java | 1 -
|
2024-10-06 19:54:10 +00:00
|
|
|
.../maven/plugin/surefire/SurefireHelper.java | 2 +-
|
|
|
|
.../plugin/surefire/SurefireProperties.java | 2 +-
|
|
|
|
.../maven/plugin/surefire/TestClassPath.java | 2 +-
|
|
|
|
.../ClasspathForkConfiguration.java | 2 +-
|
|
|
|
.../DefaultForkConfiguration.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../surefire/booterclient/ForkStarter.java | 4 +--
|
2025-03-31 08:06:45 +00:00
|
|
|
.../JarManifestForkConfiguration.java | 8 ++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../ModularClasspathForkConfiguration.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../lazytestprovider/Commandline.java | 6 ++--
|
|
|
|
.../extensions/SurefireForkChannel.java | 4 +--
|
|
|
|
.../surefire/report/ConsoleReporter.java | 4 +--
|
|
|
|
.../report/DefaultReporterFactory.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../plugin/surefire/report/FileReporter.java | 2 +-
|
|
|
|
.../surefire/report/FileReporterUtils.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
.../surefire/report/StatelessXmlReporter.java | 8 ++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../plugin/surefire/report/TestSetStats.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../surefire/report/WrappedReportEntry.java | 2 +-
|
|
|
|
.../plugin/surefire/util/FileScanner.java | 2 +-
|
|
|
|
.../plugin/surefire/util/ScannerUtil.java | 2 +-
|
|
|
|
.../surefire/util/SpecificFileFilter.java | 2 +-
|
|
|
|
.../maven/surefire/stream/EventDecoder.java | 2 +-
|
2025-03-31 15:33:51 +00:00
|
|
|
.../AbstractSurefireMojoJava7PlusTest.java | 30 +++--------------
|
|
|
|
.../surefire/AbstractSurefireMojoTest.java | 33 +++----------------
|
2024-10-06 19:54:10 +00:00
|
|
|
.../plugin/surefire/SurefireHelperTest.java | 2 +-
|
2025-03-31 15:33:51 +00:00
|
|
|
.../booterclient/ForkConfigurationTest.java | 22 +++++--------
|
2025-03-31 07:54:45 +00:00
|
|
|
.../booterclient/ForkStarterTest.java | 6 ++--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../JarManifestForkConfigurationTest.java | 2 +-
|
|
|
|
...ModularClasspathForkConfigurationTest.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../lazytestprovider/CommandlineTest.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../report/DefaultReporterFactoryTest.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../report/StatelessXmlReporterTest.java | 6 ++--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../surefire/report/TestSetStatsTest.java | 2 +-
|
|
|
|
.../StatelessTestsetInfoReporterTest.java | 2 +-
|
|
|
|
.../report/ConsoleOutputFileReporterTest.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
maven-surefire-report-plugin/pom.xml | 21 +++++++++---
|
2025-03-31 15:33:51 +00:00
|
|
|
pom.xml | 17 ----------
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-api/pom.xml | 17 +++++++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../maven/surefire/api/booter/Command.java | 2 +-
|
|
|
|
.../api/filter/SpecificTestClassFilter.java | 2 +-
|
|
|
|
.../api/report/CategorizedReportEntry.java | 2 +-
|
|
|
|
.../report/LegacyPojoStackTraceWriter.java | 2 +-
|
|
|
|
.../api/stream/AbstractStreamDecoder.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
.../surefire/api/testset/ResolvedTest.java | 14 ++++----
|
|
|
|
.../api/testset/TestListResolver.java | 10 +++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../api/util/DefaultDirectoryScanner.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../api/util/internal/ClassMethod.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../api/util/internal/ObjectUtils.java | 4 +--
|
|
|
|
.../api/util/internal/ObjectUtilsTest.java | 4 +--
|
2025-03-31 15:33:51 +00:00
|
|
|
surefire-booter/pom.xml | 27 ++++++++++++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../maven/surefire/booter/CommandReader.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../maven/surefire/booter/ForkedBooter.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
.../maven/surefire/booter/PpidChecker.java | 10 +++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../surefire/booter/ProcessCheckerType.java | 2 +-
|
|
|
|
.../surefire/booter/PropertiesWrapper.java | 2 +-
|
|
|
|
.../booter/SurefireBooterForkException.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
.../maven/surefire/booter/SystemUtils.java | 14 ++++----
|
2024-10-06 19:54:10 +00:00
|
|
|
.../booter/stream/CommandDecoder.java | 2 +-
|
|
|
|
.../surefire/booter/ForkedBooterMockTest.java | 2 +-
|
|
|
|
.../booter/IsolatedClassLoaderTest.java | 2 +-
|
|
|
|
.../surefire/booter/NewClassLoaderRunner.java | 2 +-
|
2025-03-31 07:54:45 +00:00
|
|
|
.../surefire/booter/PpidCheckerTest.java | 4 +--
|
2025-03-31 08:06:45 +00:00
|
|
|
.../surefire/booter/SystemUtilsTest.java | 12 +++----
|
|
|
|
surefire-extensions-api/pom.xml | 13 +++++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../extensions/ConsoleOutputReporter.java | 2 +-
|
|
|
|
.../extensions/StatelessReporter.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
.../extensions/util/CommandlineExecutor.java | 8 ++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../extensions/CommandlineExecutorTest.java | 4 +--
|
|
|
|
surefire-grouper/pom.xml | 4 +--
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-its/pom.xml | 10 ------
|
2025-03-31 07:54:45 +00:00
|
|
|
surefire-providers/common-java5/pom.xml | 4 +--
|
|
|
|
.../report/SmartStackTraceParser.java | 4 +--
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-providers/common-junit4/pom.xml | 8 ++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../junit4/JUnit4RunListenerFactory.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-providers/common-junit48/pom.xml | 8 ++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../common/junit48/FilterFactory.java | 2 +-
|
|
|
|
.../common/junit48/FilterFactoryTest.java | 2 +-
|
2025-03-31 15:33:51 +00:00
|
|
|
.../surefire-junit-platform/pom.xml | 18 +++++++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../junitplatform/JUnitPlatformProvider.java | 4 +--
|
2024-10-06 19:54:10 +00:00
|
|
|
.../junitplatform/RunListenerAdapter.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-providers/surefire-junit3/pom.xml | 10 +++---
|
2025-03-31 07:54:45 +00:00
|
|
|
.../surefire/junit/JUnitTestSetTest.java | 4 +--
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-providers/surefire-testng/pom.xml | 8 ++---
|
2024-10-06 19:54:10 +00:00
|
|
|
.../testng/TestNGDirectoryTestSuite.java | 2 +-
|
|
|
|
.../maven/surefire/testng/TestNGExecutor.java | 2 +-
|
2025-03-31 08:06:45 +00:00
|
|
|
surefire-report-parser/pom.xml | 5 +++
|
2025-03-31 15:33:51 +00:00
|
|
|
surefire-shadefire/pom.xml | 1 -
|
|
|
|
93 files changed, 289 insertions(+), 310 deletions(-)
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index dc71f83ad..480a18dc1 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-failsafe-plugin/pom.xml
|
|
|
|
+++ b/maven-failsafe-plugin/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -49,7 +49,14 @@
|
|
|
|
<groupId>org.slf4j</groupId>
|
|
|
|
<artifactId>slf4j-simple</artifactId>
|
|
|
|
</dependency>
|
|
|
|
-
|
2024-10-06 19:54:10 +00:00
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-api</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -65,23 +72,11 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<artifactId>surefire-extensions-api</artifactId>
|
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>maven-surefire-common</artifactId>
|
2024-11-04 00:14:27 +00:00
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.plugins</groupId>
|
|
|
|
- <artifactId>maven-surefire-plugin</artifactId>
|
|
|
|
- <version>${project.version}</version>
|
|
|
|
- <classifier>site-source</classifier>
|
|
|
|
- <type>zip</type>
|
|
|
|
- <scope>provided</scope>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven</groupId>
|
|
|
|
<artifactId>maven-plugin-api</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -123,11 +118,6 @@
|
2024-11-04 00:14:27 +00:00
|
|
|
<artifactId>mockito-core</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.codehaus.plexus</groupId>
|
|
|
|
- <artifactId>plexus-xml</artifactId>
|
|
|
|
- <scope>test</scope>
|
|
|
|
- </dependency>
|
|
|
|
</dependencies>
|
|
|
|
|
|
|
|
<build>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index e53f4073e..727b667cb 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
|
|
|
|
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -40,8 +40,8 @@
|
|
|
|
import org.slf4j.LoggerFactory;
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter;
|
|
|
|
import static org.apache.maven.surefire.api.suite.RunResult.noTestsRun;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.capitalizeFirstLetter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Verify integration tests ran using Failsafe.
|
|
|
|
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index e72d34fcf..e83dbf581 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
|
|
|
|
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/util/FailsafeSummaryXmlUtils.java
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -40,9 +40,9 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import static java.lang.String.format;
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
import static javax.xml.xpath.XPathConstants.NODE;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringEscapeUtils.escapeXml10;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringEscapeUtils.unescapeXml;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.commons.lang3.StringEscapeUtils.escapeXml10;
|
|
|
|
+import static org.apache.commons.lang3.StringEscapeUtils.unescapeXml;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
|
|
|
|
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
|
2025-03-31 08:06:45 +00:00
|
|
|
index aba5a859b..58ed7a692 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/pom.xml
|
|
|
|
+++ b/maven-surefire-common/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -36,7 +36,28 @@
|
|
|
|
<groupId>org.slf4j</groupId>
|
|
|
|
<artifactId>slf4j-simple</artifactId>
|
|
|
|
</dependency>
|
|
|
|
-
|
2024-10-06 19:54:10 +00:00
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.powermock</groupId>
|
|
|
|
+ <artifactId>powermock-reflect</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.hamcrest</groupId>
|
|
|
|
+ <artifactId>hamcrest</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-compress</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-api</artifactId>
|
2025-03-31 08:06:45 +00:00
|
|
|
@@ -123,10 +144,6 @@
|
|
|
|
<artifactId>jansi</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.google.code.findbugs</groupId>
|
|
|
|
<artifactId>jsr305</artifactId>
|
|
|
|
@@ -170,11 +187,6 @@
|
2024-11-04 00:14:27 +00:00
|
|
|
<classifier>runtime</classifier>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.codehaus.plexus</groupId>
|
|
|
|
- <artifactId>plexus-xml</artifactId>
|
|
|
|
- <scope>test</scope>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>commons-io</groupId>
|
|
|
|
<artifactId>commons-io</artifactId>
|
2024-10-06 19:54:10 +00:00
|
|
|
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
|
2025-03-31 15:33:51 +00:00
|
|
|
index b783d73be..60bb2fec4 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- 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
|
|
|
|
@@ -81,6 +81,7 @@
|
|
|
|
import org.apache.maven.plugins.annotations.Parameter;
|
|
|
|
import org.apache.maven.project.MavenProject;
|
|
|
|
import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
|
|
|
|
+import org.apache.maven.shared.utils.io.FileUtils;
|
|
|
|
import org.apache.maven.surefire.api.booter.ProviderParameterNames;
|
|
|
|
import org.apache.maven.surefire.api.booter.Shutdown;
|
|
|
|
import org.apache.maven.surefire.api.cli.CommandLineOption;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -111,7 +112,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.surefire.providerapi.ProviderDetector;
|
|
|
|
import org.apache.maven.surefire.providerapi.ProviderInfo;
|
|
|
|
import org.apache.maven.surefire.providerapi.ProviderRequirements;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.FileUtils;
|
|
|
|
import org.apache.maven.toolchain.DefaultToolchain;
|
|
|
|
import org.apache.maven.toolchain.Toolchain;
|
|
|
|
import org.apache.maven.toolchain.ToolchainManager;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -131,12 +131,22 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import static java.util.Collections.emptyList;
|
|
|
|
import static java.util.Collections.singletonList;
|
|
|
|
import static java.util.Collections.singletonMap;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.COULD_NOT_RUN_DEFAULT_TESTS;
|
|
|
|
import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.COULD_NOT_RUN_SPECIFIED_TESTS;
|
|
|
|
import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.PluginFailureReason.NONE;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.isWithinVersionSpec;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.replaceThreadNumberPlaceholders;
|
|
|
|
import static org.apache.maven.plugin.surefire.util.DependencyScanner.filter;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isEmpty;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.split;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.EXCLUDE_JUNIT5_ENGINES_PROP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.INCLUDE_JUNIT5_ENGINES_PROP;
|
|
|
|
import static org.apache.maven.surefire.api.suite.RunResult.failure;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -147,16 +157,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import static org.apache.maven.surefire.booter.SystemUtils.isJava9AtLeast;
|
|
|
|
import static org.apache.maven.surefire.booter.SystemUtils.toJdkHomeFromJvmExec;
|
|
|
|
import static org.apache.maven.surefire.booter.SystemUtils.toJdkVersionFromReleaseFile;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.substringBeforeLast;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.capitalizeFirstLetter;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isEmpty;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.split;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Abstract base class for running tests using Surefire.
|
2025-03-31 15:33:51 +00:00
|
|
|
@@ -1874,7 +1874,6 @@ private StartupConfiguration newStartupConfigWithClasspath(
|
|
|
|
getApiArtifact(),
|
|
|
|
getSpiArtifact(),
|
|
|
|
getLoggerApiArtifact(),
|
|
|
|
- getSurefireSharedUtilsArtifact()
|
|
|
|
};
|
|
|
|
Set<Artifact> inProcArtifacts = retainInProcArtifactsUnique(providerArtifacts, additionalInProcArtifacts);
|
|
|
|
Classpath inProcClasspath = createInProcClasspath(providerClasspath, inProcArtifacts);
|
|
|
|
@@ -1997,7 +1996,6 @@ private StartupConfiguration newStartupConfigWithModularPath(
|
|
|
|
getApiArtifact(),
|
|
|
|
getSpiArtifact(),
|
|
|
|
getLoggerApiArtifact(),
|
|
|
|
- getSurefireSharedUtilsArtifact()
|
|
|
|
};
|
|
|
|
Set<Artifact> inProcArtifacts = retainInProcArtifactsUnique(providerArtifacts, additionalInProcArtifacts);
|
|
|
|
Classpath inProcClasspath = createInProcClasspath(providerClasspath, inProcArtifacts);
|
|
|
|
@@ -2041,10 +2039,6 @@ private Artifact getApiArtifact() {
|
|
|
|
return getPluginArtifactMap().get("org.apache.maven.surefire:surefire-api");
|
|
|
|
}
|
|
|
|
|
|
|
|
- private Artifact getSurefireSharedUtilsArtifact() {
|
|
|
|
- return getPluginArtifactMap().get("org.apache.maven.surefire:surefire-shared-utils");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private Artifact getLoggerApiArtifact() {
|
|
|
|
return getPluginArtifactMap().get("org.apache.maven.surefire:surefire-logger-api");
|
|
|
|
}
|
2024-10-06 19:54:10 +00:00
|
|
|
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
|
2025-03-31 07:54:45 +00:00
|
|
|
index cd805c7c7..ef11bab33 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- 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
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -42,10 +42,10 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.surefire.extensions.StatelessTestsetInfoFileReportEventListener;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.trimToNull;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.replaceForkThreadsInPath;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ConsoleReporter.BRIEF;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.trimToNull;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All the parameters used to construct reporters
|
2025-03-31 15:33:51 +00:00
|
|
|
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 46739e347..85dd3e99a 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
|
|
|
|
@@ -78,7 +78,6 @@ class SurefireDependencyResolver {
|
|
|
|
"surefire-junit-platform",
|
|
|
|
"surefire-api",
|
|
|
|
"surefire-logger-api",
|
|
|
|
- "surefire-shared-utils",
|
|
|
|
"common-java5",
|
|
|
|
"common-junit3",
|
|
|
|
"common-junit4",
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
|
2024-11-04 00:14:27 +00:00
|
|
|
index 6285506c7..ab0628d9f 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireHelper.java
|
|
|
|
@@ -38,6 +38,7 @@
|
|
|
|
import org.apache.maven.surefire.booter.SurefireBooterForkException;
|
|
|
|
|
|
|
|
import static java.util.Collections.unmodifiableList;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.surefire.api.booter.DumpErrorSingleton.DUMPSTREAM_FILE_EXT;
|
|
|
|
import static org.apache.maven.surefire.api.booter.DumpErrorSingleton.DUMP_FILE_EXT;
|
|
|
|
import static org.apache.maven.surefire.api.cli.CommandLineOption.LOGGING_LEVEL_DEBUG;
|
|
|
|
@@ -46,7 +47,6 @@
|
|
|
|
import static org.apache.maven.surefire.api.cli.CommandLineOption.LOGGING_LEVEL_WARN;
|
|
|
|
import static org.apache.maven.surefire.api.cli.CommandLineOption.SHOW_ERRORS;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.DumpFileUtils.newFormattedDateFileName;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper class for surefire plugins
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
|
|
|
|
index 6aeef18f0..5259aff5a 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
|
|
|
|
@@ -33,9 +33,9 @@
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.StringUtils;
|
|
|
|
import org.apache.maven.surefire.booter.Classpath;
|
|
|
|
import org.apache.maven.surefire.booter.KeyValueSource;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.StringUtils;
|
|
|
|
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
import static java.util.Map.Entry;
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
|
|
|
|
index d86910342..feb2b6025 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/TestClassPath.java
|
|
|
|
@@ -28,7 +28,7 @@
|
|
|
|
import org.apache.maven.surefire.booter.Classpath;
|
|
|
|
|
|
|
|
import static java.util.Collections.addAll;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.split;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.split;
|
|
|
|
|
|
|
|
final class TestClassPath {
|
|
|
|
private final Iterable<Artifact> artifacts;
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
|
|
|
|
index 16b4800da..3fff286d2 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java
|
|
|
|
@@ -32,7 +32,7 @@
|
|
|
|
import org.apache.maven.surefire.booter.SurefireBooterForkException;
|
|
|
|
import org.apache.maven.surefire.extensions.ForkNodeFactory;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.join;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.join;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
|
|
|
|
index d78f6807d..5c9056742 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java
|
|
|
|
@@ -31,13 +31,13 @@
|
|
|
|
import org.apache.maven.plugin.surefire.JdkAttributes;
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.Commandline;
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
+import org.apache.maven.shared.utils.cli.CommandLineException;
|
|
|
|
import org.apache.maven.surefire.api.util.internal.ImmutableMap;
|
|
|
|
import org.apache.maven.surefire.booter.AbstractPathConfiguration;
|
|
|
|
import org.apache.maven.surefire.booter.Classpath;
|
|
|
|
import org.apache.maven.surefire.booter.StartupConfiguration;
|
|
|
|
import org.apache.maven.surefire.booter.SurefireBooterForkException;
|
|
|
|
import org.apache.maven.surefire.extensions.ForkNodeFactory;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
|
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.replaceForkThreadsInPath;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.replaceThreadNumberPlaceholders;
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
|
|
|
|
index c612861eb..cf3278fb8 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
|
|
|
|
@@ -95,6 +95,8 @@
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.drawNumber;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.returnNumber;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream.TestLessInputStreamBuilder;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
import static org.apache.maven.surefire.api.cli.CommandLineOption.SHOW_ERRORS;
|
|
|
|
import static org.apache.maven.surefire.api.suite.RunResult.SUCCESS;
|
|
|
|
import static org.apache.maven.surefire.api.suite.RunResult.failure;
|
|
|
|
@@ -104,8 +106,6 @@
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.DaemonThreadFactory.newDaemonThreadFactory;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
import static org.apache.maven.surefire.booter.SystemPropertyManager.writePropertiesFile;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the fork or runs in-process.
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
|
|
|
|
index a13de8fb8..3ea47f1cf 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfiguration.java
|
|
|
|
@@ -38,6 +38,9 @@
|
|
|
|
import java.util.jar.Manifest;
|
|
|
|
import java.util.zip.Deflater;
|
|
|
|
|
|
|
|
+import org.apache.commons.compress.archivers.zip.Zip64Mode;
|
|
|
|
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
|
|
|
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.Commandline;
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton;
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
@@ -46,17 +49,14 @@
|
|
|
|
import org.apache.maven.surefire.booter.StartupConfiguration;
|
|
|
|
import org.apache.maven.surefire.booter.SurefireBooterForkException;
|
|
|
|
import org.apache.maven.surefire.extensions.ForkNodeFactory;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.Zip64Mode;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveEntry;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveOutputStream;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
import static java.nio.file.Files.isDirectory;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.ClasspathElementUri.absolute;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.ClasspathElementUri.relative;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
|
|
|
|
index 5a2576117..ef13fdb8d 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java
|
|
|
|
@@ -45,8 +45,8 @@
|
|
|
|
|
|
|
|
import static java.io.File.pathSeparatorChar;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.replace;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.replace;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/Commandline.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/Commandline.java
|
|
|
|
index 651e80ca3..4377d5c40 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/Commandline.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/Commandline.java
|
|
|
|
@@ -24,16 +24,16 @@
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.concurrent.ConcurrentLinkedDeque;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.CommandLineUtils;
|
|
|
|
+import org.apache.maven.shared.utils.cli.CommandLineUtils;
|
|
|
|
|
|
|
|
import static java.util.Collections.addAll;
|
|
|
|
|
|
|
|
/**
|
|
|
|
- * A {@link org.apache.maven.surefire.shared.utils.cli.Commandline} implementation.
|
|
|
|
+ * A {@link org.apache.maven.shared.utils.cli.Commandline} implementation.
|
|
|
|
*
|
|
|
|
* @author Andreas Gudian
|
|
|
|
*/
|
|
|
|
-public class Commandline extends org.apache.maven.surefire.shared.utils.cli.Commandline {
|
|
|
|
+public class Commandline extends org.apache.maven.shared.utils.cli.Commandline {
|
|
|
|
private final Collection<String> excludedEnvironmentVariables;
|
|
|
|
private final Set<String> addedEnvironmentVariables;
|
|
|
|
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
|
|
|
|
index c58d3ee16..03d4b8f41 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
|
|
|
|
@@ -55,13 +55,13 @@
|
|
|
|
import static java.nio.channels.AsynchronousChannelGroup.withThreadPool;
|
|
|
|
import static java.nio.channels.AsynchronousServerSocketChannel.open;
|
|
|
|
import static java.nio.charset.StandardCharsets.US_ASCII;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isBlank;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.Channels.newChannel;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.Channels.newInputStream;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.Channels.newOutputStream;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.DaemonThreadFactory.newDaemonThreadFactory;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The TCP/IP server accepting only one client connection. The forked JVM connects to the server using the
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
|
|
|
|
index f6645e6ca..325b49719 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleReporter.java
|
|
|
|
@@ -22,13 +22,13 @@
|
|
|
|
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.Level;
|
|
|
|
+import org.apache.maven.shared.utils.logging.MessageBuilder;
|
|
|
|
import org.apache.maven.surefire.api.report.TestSetReportEntry;
|
|
|
|
import org.apache.maven.surefire.extensions.StatelessTestsetInfoConsoleReportEventListener;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
|
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.TestSetStats.concatenateWithTestGroup;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for console reporters.
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index f95c061ab..e738088a4 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
|
|
|
|
@@ -31,6 +31,7 @@
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.Level;
|
|
|
|
import org.apache.maven.plugin.surefire.runorder.StatisticsReporter;
|
|
|
|
+import org.apache.maven.shared.utils.logging.MessageBuilder;
|
|
|
|
import org.apache.maven.surefire.api.report.ReporterFactory;
|
|
|
|
import org.apache.maven.surefire.api.report.StackTraceWriter;
|
|
|
|
import org.apache.maven.surefire.api.report.TestOutputReportEntry;
|
|
|
|
@@ -41,7 +42,6 @@
|
|
|
|
import org.apache.maven.surefire.extensions.StatelessTestsetInfoConsoleReportEventListener;
|
|
|
|
import org.apache.maven.surefire.extensions.StatelessTestsetInfoFileReportEventListener;
|
|
|
|
import org.apache.maven.surefire.report.RunStatistics;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
|
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN;
|
|
|
|
@@ -54,8 +54,8 @@
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.FAILURE;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS;
|
|
|
|
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.ObjectUtils.useNonNull;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides reporting modules on the plugin side.
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
|
|
|
|
index dfafeb531..8f2c137b7 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporter.java
|
|
|
|
@@ -31,7 +31,7 @@
|
|
|
|
import org.apache.maven.surefire.extensions.StatelessTestsetInfoFileReportEventListener;
|
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for file reporters.
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
|
|
|
|
index fb54edaeb..aebd48e01 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/FileReporterUtils.java
|
|
|
|
@@ -18,7 +18,7 @@
|
|
|
|
*/
|
|
|
|
package org.apache.maven.plugin.surefire.report;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utils class for file-based reporters
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index d658737ce..d46779f71 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
|
|
|
|
@@ -36,18 +36,18 @@
|
|
|
|
import java.util.concurrent.ConcurrentLinkedDeque;
|
|
|
|
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton;
|
|
|
|
+import org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter;
|
|
|
|
+import org.apache.maven.shared.utils.xml.XMLWriter;
|
|
|
|
import org.apache.maven.surefire.api.report.SafeThrowable;
|
|
|
|
import org.apache.maven.surefire.extensions.StatelessReportEventListener;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.xml.PrettyPrintXMLWriter;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.xml.XMLWriter;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.SKIPPED;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
// CHECKSTYLE_OFF: LineLength
|
|
|
|
/**
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
|
|
|
|
index 1431d8fde..e29e4275d 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetStats.java
|
|
|
|
@@ -24,11 +24,11 @@
|
|
|
|
import java.util.Queue;
|
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.logging.MessageBuilder;
|
|
|
|
import org.apache.maven.surefire.api.report.ReportEntry;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.logging.MessageBuilder;
|
|
|
|
|
|
|
|
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
import static org.apache.maven.surefire.api.report.CategorizedReportEntry.GROUP_PREFIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maintains per-thread test result state. Not thread safe.
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index c443d27cb..1b8657892 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java
|
|
|
|
@@ -31,8 +31,8 @@
|
|
|
|
import org.apache.maven.surefire.api.report.TestSetReportEntry;
|
|
|
|
|
|
|
|
import static java.util.Collections.unmodifiableMap;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kristian Rosenvold
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/FileScanner.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/FileScanner.java
|
|
|
|
index 48d72f230..a525edbed 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/FileScanner.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/FileScanner.java
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
|
|
import org.apache.maven.surefire.api.testset.TestFilter;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
final class FileScanner {
|
|
|
|
private final File basedir;
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
|
|
|
|
index 7541db72c..004dce86f 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/ScannerUtil.java
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.lang3.StringUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
final class ScannerUtil {
|
|
|
|
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
|
|
|
|
index 8246180dc..94aced9ee 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.SelectorUtils;
|
|
|
|
+import org.apache.maven.shared.utils.io.SelectorUtils;
|
|
|
|
|
|
|
|
import static org.apache.maven.plugin.surefire.util.ScannerUtil.convertSlashToSystemFileSeparator;
|
|
|
|
|
|
|
|
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/surefire/stream/EventDecoder.java b/maven-surefire-common/src/main/java/org/apache/maven/surefire/stream/EventDecoder.java
|
|
|
|
index 0bfc1e26b..f03a83d7a 100644
|
|
|
|
--- a/maven-surefire-common/src/main/java/org/apache/maven/surefire/stream/EventDecoder.java
|
|
|
|
+++ b/maven-surefire-common/src/main/java/org/apache/maven/surefire/stream/EventDecoder.java
|
|
|
|
@@ -64,6 +64,7 @@
|
|
|
|
import org.apache.maven.surefire.api.stream.SegmentType;
|
|
|
|
|
|
|
|
import static java.util.Collections.emptyMap;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Constants.MAGIC_NUMBER_FOR_EVENTS_BYTES;
|
|
|
|
import static org.apache.maven.surefire.api.report.CategorizedReportEntry.reportEntry;
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.DATA_INTEGER;
|
|
|
|
@@ -72,7 +73,6 @@
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.RUN_MODE;
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.STRING_ENCODING;
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.TEST_RUN_ID;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2025-03-31 15:33:51 +00:00
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
|
|
|
|
index 39007de0d..4fa30a81c 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
|
|
|
|
@@ -199,16 +199,6 @@ public void shouldHaveStartupConfigForModularClasspath() throws Exception {
|
|
|
|
"org.apache.maven.surefire", "surefire-booter", createFromVersion("1"), "runtime", "jar", "", handler);
|
|
|
|
booter.setFile(mockFile("surefire-booter.jar"));
|
|
|
|
|
|
|
|
- Artifact utils = new DefaultArtifact(
|
|
|
|
- "org.apache.maven.surefire",
|
|
|
|
- "surefire-shared-utils",
|
|
|
|
- createFromVersion("1"),
|
|
|
|
- "runtime",
|
|
|
|
- "jar",
|
|
|
|
- "",
|
|
|
|
- handler);
|
|
|
|
- utils.setFile(mockFile("surefire-shared-utils.jar"));
|
|
|
|
-
|
|
|
|
Map<String, Artifact> artifacts = new HashMap<>();
|
|
|
|
artifacts.put("org.apache.maven.surefire:maven-surefire-common", common);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-extensions-api", ext);
|
|
|
|
@@ -216,7 +206,6 @@ public void shouldHaveStartupConfigForModularClasspath() throws Exception {
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-logger-api", loggerApi);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-extensions-spi", spi);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-booter", booter);
|
|
|
|
- artifacts.put("org.apache.maven.surefire:surefire-shared-utils", utils);
|
|
|
|
when(mojo.getPluginArtifactMap()).thenReturn(artifacts);
|
|
|
|
|
|
|
|
ProviderInfo providerInfo = mock(ProviderInfo.class);
|
|
|
|
@@ -259,8 +248,8 @@ public void shouldHaveStartupConfigForModularClasspath() throws Exception {
|
|
|
|
"test(compact) classpath: non-modular.jar junit.jar hamcrest.jar",
|
|
|
|
"test(compact) modulepath: modular.jar classes",
|
|
|
|
"provider(compact) classpath: surefire-provider.jar",
|
|
|
|
- "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar",
|
|
|
|
- "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar");
|
|
|
|
+ "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar",
|
|
|
|
+ "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar");
|
|
|
|
|
|
|
|
assertThat(conf).isNotNull();
|
|
|
|
assertThat(conf.isShadefire()).isFalse();
|
|
|
|
@@ -369,16 +358,6 @@ public void shouldHaveStartupConfigForModularClasspathAndTestDescriptor() throws
|
|
|
|
"org.apache.maven.surefire", "surefire-booter", createFromVersion("1"), "runtime", "jar", "", handler);
|
|
|
|
booter.setFile(mockFile("surefire-booter.jar"));
|
|
|
|
|
|
|
|
- Artifact utils = new DefaultArtifact(
|
|
|
|
- "org.apache.maven.surefire",
|
|
|
|
- "surefire-shared-utils",
|
|
|
|
- createFromVersion("1"),
|
|
|
|
- "runtime",
|
|
|
|
- "jar",
|
|
|
|
- "",
|
|
|
|
- handler);
|
|
|
|
- utils.setFile(mockFile("surefire-shared-utils.jar"));
|
|
|
|
-
|
|
|
|
Map<String, Artifact> artifacts = new HashMap<>();
|
|
|
|
artifacts.put("org.apache.maven.surefire:maven-surefire-common", common);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-extensions-api", ext);
|
|
|
|
@@ -386,7 +365,6 @@ public void shouldHaveStartupConfigForModularClasspathAndTestDescriptor() throws
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-logger-api", loggerApi);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-extensions-spi", spi);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-booter", booter);
|
|
|
|
- artifacts.put("org.apache.maven.surefire:surefire-shared-utils", utils);
|
|
|
|
when(mojo.getPluginArtifactMap()).thenReturn(artifacts);
|
|
|
|
|
|
|
|
ProviderInfo providerInfo = mock(ProviderInfo.class);
|
|
|
|
@@ -417,8 +395,8 @@ public void shouldHaveStartupConfigForModularClasspathAndTestDescriptor() throws
|
|
|
|
"test(compact) classpath:",
|
|
|
|
"test(compact) modulepath: test-classes classes modular.jar non-modular.jar junit.jar hamcrest.jar",
|
|
|
|
"provider(compact) classpath: surefire-provider.jar",
|
|
|
|
- "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar",
|
|
|
|
- "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar");
|
|
|
|
+ "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar",
|
|
|
|
+ "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar");
|
|
|
|
|
|
|
|
assertThat(conf).isNotNull();
|
|
|
|
assertThat(conf.isShadefire()).isFalse();
|
2024-10-06 19:54:10 +00:00
|
|
|
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
|
2025-03-31 15:33:51 +00:00
|
|
|
index c2967b534..eccf65741 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- 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
|
|
|
|
@@ -91,12 +91,12 @@
|
|
|
|
import static java.util.Collections.emptyMap;
|
|
|
|
import static java.util.Collections.singleton;
|
|
|
|
import static java.util.Collections.singletonList;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_9;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.artifact.ArtifactUtils.artifactMapByVersionlessId;
|
|
|
|
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
|
|
|
|
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_9;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.codehaus.plexus.languages.java.jpms.ModuleNameSource.MODULEDESCRIPTOR;
|
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
2025-03-31 15:33:51 +00:00
|
|
|
@@ -478,16 +478,6 @@ public void shouldHaveStartupConfigForNonModularClasspath() throws Exception {
|
|
|
|
"org.apache.maven.surefire", "surefire-booter", createFromVersion("1"), "runtime", "jar", "", handler);
|
|
|
|
booter.setFile(mockFile("surefire-booter.jar"));
|
|
|
|
|
|
|
|
- Artifact utils = new DefaultArtifact(
|
|
|
|
- "org.apache.maven.surefire",
|
|
|
|
- "surefire-shared-utils",
|
|
|
|
- createFromVersion("1"),
|
|
|
|
- "runtime",
|
|
|
|
- "jar",
|
|
|
|
- "",
|
|
|
|
- handler);
|
|
|
|
- utils.setFile(mockFile("surefire-shared-utils.jar"));
|
|
|
|
-
|
|
|
|
Map<String, Artifact> providerArtifactsMap = new HashMap<>();
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:maven-surefire-common", common);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-extensions-api", ext);
|
|
|
|
@@ -495,7 +485,6 @@ public void shouldHaveStartupConfigForNonModularClasspath() throws Exception {
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-logger-api", loggerApi);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-extensions-spi", spi);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-booter", booter);
|
|
|
|
- providerArtifactsMap.put("org.apache.maven.surefire:surefire-shared-utils", utils);
|
|
|
|
|
|
|
|
when(mojo.getPluginArtifactMap()).thenReturn(providerArtifactsMap);
|
|
|
|
|
|
|
|
@@ -547,8 +536,8 @@ public void shouldHaveStartupConfigForNonModularClasspath() throws Exception {
|
|
|
|
"provider classpath: surefire-provider.jar",
|
|
|
|
"test(compact) classpath: test-classes classes junit.jar hamcrest.jar",
|
|
|
|
"provider(compact) classpath: surefire-provider.jar",
|
|
|
|
- "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar",
|
|
|
|
- "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar surefire-shared-utils.jar");
|
|
|
|
+ "in-process classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar",
|
|
|
|
+ "in-process(compact) classpath: surefire-provider.jar maven-surefire-common.jar surefire-booter.jar surefire-extensions-api.jar surefire-api.jar surefire-extensions-spi.jar surefire-logger-api.jar");
|
|
|
|
|
|
|
|
assertThat(conf.getClassLoaderConfiguration()).isSameAs(classLoaderConfiguration);
|
|
|
|
|
|
|
|
@@ -660,16 +649,6 @@ private StartupConfiguration startupConfigurationForProvider(ProviderInfo provid
|
|
|
|
"org.apache.maven.surefire", "surefire-booter", createFromVersion("1"), "runtime", "jar", "", handler);
|
|
|
|
booter.setFile(mockFile("surefire-booter.jar"));
|
|
|
|
|
|
|
|
- Artifact utils = new DefaultArtifact(
|
|
|
|
- "org.apache.maven.surefire",
|
|
|
|
- "surefire-shared-utils",
|
|
|
|
- createFromVersion("1"),
|
|
|
|
- "runtime",
|
|
|
|
- "jar",
|
|
|
|
- "",
|
|
|
|
- handler);
|
|
|
|
- utils.setFile(mockFile("surefire-shared-utils.jar"));
|
|
|
|
-
|
|
|
|
Map<String, Artifact> providerArtifactsMap = new HashMap<>();
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:maven-surefire-common", common);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-extensions-api", ext);
|
|
|
|
@@ -677,7 +656,6 @@ private StartupConfiguration startupConfigurationForProvider(ProviderInfo provid
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-logger-api", loggerApi);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-extensions-spi", spi);
|
|
|
|
providerArtifactsMap.put("org.apache.maven.surefire:surefire-booter", booter);
|
|
|
|
- providerArtifactsMap.put("org.apache.maven.surefire:surefire-shared-utils", utils);
|
|
|
|
|
|
|
|
when(mojo.getPluginArtifactMap()).thenReturn(providerArtifactsMap);
|
|
|
|
|
|
|
|
@@ -737,7 +715,6 @@ public void shouldCreateStartupConfigWithModularPath() throws Exception {
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-logger-api", dummyArtifact);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-extensions-spi", dummyArtifact);
|
|
|
|
artifacts.put("org.apache.maven.surefire:surefire-booter", dummyArtifact);
|
|
|
|
- artifacts.put("org.apache.maven.surefire:surefire-shared-utils", dummyArtifact);
|
|
|
|
mojo.setPluginArtifactMap(artifacts);
|
|
|
|
|
|
|
|
ResolvePathResult resolvePathResult = mock(ResolvePathResult.class);
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index a0d658946..ae2a3ba91 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
|
|
|
|
@@ -37,9 +37,9 @@
|
|
|
|
|
|
|
|
import static java.util.Collections.addAll;
|
|
|
|
import static java.util.Collections.singleton;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath;
|
|
|
|
import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.hamcrest.Matchers.containsString;
|
|
|
|
import static org.junit.Assume.assumeTrue;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
|
|
|
|
index c6d7330ca..de4bc121c 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
|
|
|
|
@@ -52,10 +52,10 @@
|
|
|
|
import static java.nio.file.Files.readAllBytes;
|
|
|
|
import static java.util.Collections.singletonList;
|
|
|
|
import static org.apache.commons.io.FileUtils.getTempDirectory;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
import static org.apache.maven.surefire.booter.Classpath.emptyClasspath;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessCheckerType.ALL;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
@@ -137,8 +137,7 @@ protected void resolveClasspath(
|
|
|
|
ClassLoaderConfiguration clc = new ClassLoaderConfiguration(true, true);
|
|
|
|
StartupConfiguration startup = new StartupConfiguration("cls", cpConfig, clc, ALL, providerJpmsArgs);
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cli =
|
|
|
|
- config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cli = config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
|
|
|
|
assertThat(cli.getEnvironmentVariables())
|
|
|
|
.contains("key1=val1", "key2=val2", "key3=val3")
|
|
|
|
@@ -191,7 +190,7 @@ protected void resolveClasspath(
|
|
|
|
ClassLoaderConfiguration clc = new ClassLoaderConfiguration(true, true);
|
|
|
|
StartupConfiguration startup = new StartupConfiguration("cls", cpConfig, clc, ALL, providerJpmsArgs);
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cliFork1 =
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cliFork1 =
|
|
|
|
config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
|
|
|
|
assertThat(cliFork1.getEnvironmentVariables())
|
|
|
|
@@ -199,7 +198,7 @@ protected void resolveClasspath(
|
|
|
|
.doesNotContain("PATH=")
|
|
|
|
.doesNotHaveDuplicates();
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cliFork2 =
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cliFork2 =
|
|
|
|
config.createCommandLine(startup, 2, getTempDirectory());
|
|
|
|
|
|
|
|
assertThat(cliFork2.getEnvironmentVariables())
|
|
|
|
@@ -241,8 +240,7 @@ public void testCliArgs() throws Exception {
|
|
|
|
ClassLoaderConfiguration clc = new ClassLoaderConfiguration(true, true);
|
|
|
|
StartupConfiguration startup = new StartupConfiguration("cls", cpConfig, clc, ALL, providerJpmsArgs);
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cli =
|
|
|
|
- config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cli = config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
String cliAsString = cli.toString();
|
|
|
|
|
|
|
|
assertThat(cliAsString).contains("arg1");
|
|
|
|
@@ -316,8 +314,7 @@ protected void resolveClasspath(
|
|
|
|
|
|
|
|
assertThat(startup.isShadefire()).isFalse();
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cli =
|
|
|
|
- config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cli = config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
|
|
|
|
assertThat(cli.toString()).contains("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005");
|
|
|
|
}
|
|
|
|
@@ -336,8 +333,7 @@ public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructMa
|
|
|
|
StartupConfiguration startup =
|
|
|
|
new StartupConfiguration("", cpConfig, clc, ALL, Collections.<String[]>emptyList());
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline cli =
|
|
|
|
- config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline cli = config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
|
|
|
|
String line = join(" ", cli.getCommandline());
|
|
|
|
assertTrue(line.contains("-jar"));
|
|
|
|
@@ -356,7 +352,7 @@ public void testArglineWithNewline() throws IOException, SurefireBooterForkExcep
|
|
|
|
StartupConfiguration startup =
|
|
|
|
new StartupConfiguration("", cpConfig, clc, ALL, Collections.<String[]>emptyList());
|
|
|
|
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline commandLine =
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline commandLine =
|
|
|
|
config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
assertThat(commandLine.toString()).contains(IS_OS_WINDOWS ? "abc def" : "'abc' 'def'");
|
|
|
|
}
|
|
|
|
@@ -372,7 +368,7 @@ public void testCurrentWorkingDirectoryPropagationIncludingForkNumberExpansion()
|
|
|
|
StartupConfiguration startup =
|
|
|
|
new StartupConfiguration("", cpConfig, clc, ALL, Collections.<String[]>emptyList());
|
|
|
|
ForkConfiguration config = getForkConfiguration(cwd.getCanonicalFile());
|
|
|
|
- org.apache.maven.surefire.shared.utils.cli.Commandline commandLine =
|
|
|
|
+ org.apache.maven.shared.utils.cli.Commandline commandLine =
|
|
|
|
config.createCommandLine(startup, 1, getTempDirectory());
|
|
|
|
|
|
|
|
File forkDirectory = new File(basedir, "fork_1");
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index 6a774ace8..a315782e8 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java
|
|
|
|
@@ -29,6 +29,9 @@
|
|
|
|
import java.util.jar.Manifest;
|
|
|
|
import java.util.zip.Deflater;
|
|
|
|
|
|
|
|
+import org.apache.commons.compress.archivers.zip.Zip64Mode;
|
|
|
|
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
|
|
|
+import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
|
|
|
import org.apache.maven.plugin.surefire.StartupReportConfiguration;
|
|
|
|
import org.apache.maven.plugin.surefire.SurefireProperties;
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractCommandReader;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -54,9 +57,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.surefire.booter.StartupConfiguration;
|
|
|
|
import org.apache.maven.surefire.booter.SurefireBooterForkException;
|
|
|
|
import org.apache.maven.surefire.extensions.ForkNodeFactory;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.Zip64Mode;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveEntry;
|
|
|
|
-import org.apache.maven.surefire.shared.compress.archivers.zip.ZipArchiveOutputStream;
|
|
|
|
import org.junit.AfterClass;
|
|
|
|
import org.junit.BeforeClass;
|
|
|
|
import org.junit.Rule;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
|
|
|
|
index 9a9bf430f..6c62389ff 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
|
|
|
|
@@ -40,11 +40,11 @@
|
|
|
|
import org.powermock.modules.junit4.PowerMockRunnerDelegate;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.escapeUri;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.relativize;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.toAbsoluteUri;
|
|
|
|
import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.toClasspathElementUri;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.assertj.core.util.Files.delete;
|
|
|
|
import static org.assertj.core.util.Files.newTemporaryFolder;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
|
|
|
|
index fbf3e54fd..addf0fcdd 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java
|
|
|
|
@@ -43,8 +43,8 @@
|
|
|
|
import static java.nio.file.Files.readAllLines;
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
import static java.util.Collections.singleton;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.replace;
|
|
|
|
import static org.apache.maven.surefire.booter.Classpath.emptyClasspath;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.replace;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/CommandlineTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/CommandlineTest.java
|
|
|
|
index 2ebcd3e85..e89f4dc85 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/CommandlineTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/CommandlineTest.java
|
|
|
|
@@ -18,11 +18,11 @@
|
|
|
|
*/
|
|
|
|
package org.apache.maven.plugin.surefire.booterclient.lazytestprovider;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
|
|
|
|
+import org.apache.maven.shared.utils.cli.CommandLineException;
|
|
|
|
import org.assertj.core.api.Condition;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
/**
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index 86c23c82a..ee4eef59d 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -32,6 +32,7 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter;
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
import org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType;
|
|
|
|
+import org.apache.maven.shared.utils.logging.MessageUtils;
|
2025-03-31 07:54:45 +00:00
|
|
|
import org.apache.maven.surefire.api.report.ReporterFactoryOptions;
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.surefire.api.report.SafeThrowable;
|
|
|
|
import org.apache.maven.surefire.api.report.StackTraceWriter;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -39,7 +40,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import org.apache.maven.surefire.api.report.TestReportListener;
|
|
|
|
import org.apache.maven.surefire.api.suite.RunResult;
|
|
|
|
import org.apache.maven.surefire.report.RunStatistics;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.logging.MessageUtils;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
|
|
|
|
index 362facb15..5501f259c 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
|
|
|
|
@@ -34,22 +34,22 @@
|
|
|
|
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter;
|
|
|
|
+import org.apache.maven.shared.utils.xml.Xpp3Dom;
|
|
|
|
+import org.apache.maven.shared.utils.xml.Xpp3DomBuilder;
|
|
|
|
import org.apache.maven.surefire.api.report.ReportEntry;
|
|
|
|
import org.apache.maven.surefire.api.report.SimpleReportEntry;
|
|
|
|
import org.apache.maven.surefire.api.report.StackTraceWriter;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.xml.Xpp3Dom;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.xml.Xpp3DomBuilder;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
|
|
import static java.nio.file.Files.readAllLines;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.SKIPPED;
|
|
|
|
import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isEmpty;
|
|
|
|
import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN;
|
|
|
|
import static org.apache.maven.surefire.api.report.RunMode.RERUN_TEST_AFTER_FAILURE;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.ObjectUtils.systemProps;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isEmpty;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.mockito.Mockito.doThrow;
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
|
|
|
|
index f7cab66e7..b93e92c57 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java
|
|
|
|
@@ -25,7 +25,7 @@
|
|
|
|
import org.powermock.core.classloader.annotations.PowerMockIgnore;
|
|
|
|
import org.powermock.modules.junit4.PowerMockRunner;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.mockito.Mockito.atLeastOnce;
|
|
|
|
import static org.mockito.Mockito.times;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
|
|
|
|
index 0c2a98a50..66a9cc144 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java
|
|
|
|
@@ -30,8 +30,8 @@
|
|
|
|
import org.apache.maven.plugin.surefire.report.FileReporter;
|
|
|
|
import org.apache.maven.plugin.surefire.report.TestSetStats;
|
|
|
|
import org.apache.maven.plugin.surefire.report.WrappedReportEntry;
|
|
|
|
+import org.apache.maven.shared.utils.logging.MessageUtils;
|
|
|
|
import org.apache.maven.surefire.api.report.TestSetReportEntry;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.logging.MessageUtils;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.mockito.ArgumentCaptor;
|
|
|
|
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
|
|
|
|
index ca9382fb5..9f671e5be 100644
|
|
|
|
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
|
|
|
|
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
|
|
|
|
@@ -27,10 +27,10 @@
|
|
|
|
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter;
|
|
|
|
+import org.apache.maven.shared.utils.io.FileUtils;
|
|
|
|
import org.apache.maven.surefire.api.report.SimpleReportEntry;
|
|
|
|
import org.apache.maven.surefire.api.report.TestOutputReportEntry;
|
|
|
|
import org.apache.maven.surefire.api.report.TestSetReportEntry;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.FileUtils;
|
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.US_ASCII;
|
|
|
|
import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN;
|
|
|
|
diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 1e1f21e94..4318ad92c 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/maven-surefire-report-plugin/pom.xml
|
|
|
|
+++ b/maven-surefire-report-plugin/pom.xml
|
2024-11-04 00:14:27 +00:00
|
|
|
@@ -50,6 +50,23 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
</properties>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.hamcrest</groupId>
|
|
|
|
+ <artifactId>hamcrest</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.doxia</groupId>
|
|
|
|
+ <artifactId>doxia-module-xhtml5</artifactId>
|
|
|
|
+ <version>2.0.0-M12</version>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.doxia</groupId>
|
|
|
|
+ <artifactId>doxia-integration-tools</artifactId>
|
|
|
|
+ <version>2.0.0-M19</version>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-logger-api</artifactId>
|
2024-11-04 00:14:27 +00:00
|
|
|
@@ -116,10 +133,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<artifactId>maven-reporting-impl</artifactId>
|
2024-11-04 00:14:27 +00:00
|
|
|
<version>4.0.0</version>
|
2024-10-06 19:54:10 +00:00
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.codehaus.plexus</groupId>
|
|
|
|
- <artifactId>plexus-xml</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.codehaus.plexus</groupId>
|
|
|
|
<artifactId>plexus-i18n</artifactId>
|
|
|
|
diff --git a/pom.xml b/pom.xml
|
2025-03-31 15:33:51 +00:00
|
|
|
index 2737001ad..16e1fd4f4 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/pom.xml
|
|
|
|
+++ b/pom.xml
|
|
|
|
@@ -48,7 +48,6 @@
|
|
|
|
</contributors>
|
|
|
|
|
|
|
|
<modules>
|
|
|
|
- <module>surefire-shared-utils</module>
|
|
|
|
<module>surefire-logger-api</module>
|
|
|
|
<module>surefire-api</module>
|
|
|
|
<module>surefire-extensions-api</module>
|
2025-03-31 15:33:51 +00:00
|
|
|
@@ -290,11 +289,6 @@
|
|
|
|
<version>${jacocoVersion}</version>
|
|
|
|
<classifier>runtime</classifier>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- <version>${project.version}</version>
|
|
|
|
- </dependency>
|
|
|
|
</dependencies>
|
|
|
|
</dependencyManagement>
|
|
|
|
|
|
|
|
@@ -474,17 +468,6 @@
|
|
|
|
</reporting>
|
|
|
|
|
|
|
|
<profiles>
|
|
|
|
- <profile>
|
|
|
|
- <!-- First, install the project without tests -> mvn install -DskipTests
|
|
|
|
- This is a workaround for IntelliJ IDEA, see https://youtrack.jetbrains.com/issue/IDEA-148573
|
|
|
|
- IDEA is able to recognize external artifacts with classifiers. But IDEA expects modules and their artifacts
|
|
|
|
- without classifier. If the version differs from project, the idea would understand it as external artifact.
|
|
|
|
- -->
|
|
|
|
- <id>ide-development</id>
|
|
|
|
- <properties>
|
|
|
|
- <surefire-shared-utils.version>3-SNAPSHOT</surefire-shared-utils.version>
|
|
|
|
- </properties>
|
|
|
|
- </profile>
|
|
|
|
<profile>
|
|
|
|
<id>jdk9+</id>
|
|
|
|
<activation>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 68fbf7e10..ab5252f7a 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-api/pom.xml
|
|
|
|
+++ b/surefire-api/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -33,13 +33,22 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-logger-api</artifactId>
|
|
|
|
- <version>${project.version}</version>
|
|
|
|
+ <groupId>org.hamcrest</groupId>
|
|
|
|
+ <artifactId>hamcrest</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
+ <artifactId>surefire-logger-api</artifactId>
|
|
|
|
+ <version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.google.code.findbugs</groupId>
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/booter/Command.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/booter/Command.java
|
|
|
|
index df86fee54..9c30bdd8f 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/booter/Command.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/booter/Command.java
|
|
|
|
@@ -21,7 +21,7 @@
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import static java.util.Objects.requireNonNull;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Encapsulates data and command sent from master to forked process.
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/filter/SpecificTestClassFilter.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/filter/SpecificTestClassFilter.java
|
|
|
|
index 5efc91c17..7027b8a79 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/filter/SpecificTestClassFilter.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/filter/SpecificTestClassFilter.java
|
|
|
|
@@ -22,8 +22,8 @@
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.io.SelectorUtils;
|
|
|
|
import org.apache.maven.surefire.api.util.ScannerFilter;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.SelectorUtils;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Filter for test class files
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/CategorizedReportEntry.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/CategorizedReportEntry.java
|
|
|
|
index 4dc6d7f2a..69ae007e3 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/CategorizedReportEntry.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/CategorizedReportEntry.java
|
|
|
|
@@ -25,7 +25,7 @@
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kristian Rosenvold
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java
|
|
|
|
index 21466f41b..219f9bd6f 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
|
|
import org.apache.maven.surefire.api.util.internal.StringUtils;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Write the trace out for a POJO test. Java 1.5 compatible.
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoder.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoder.java
|
|
|
|
index 400f74f6c..744a9c7d5 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoder.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoder.java
|
|
|
|
@@ -43,10 +43,10 @@
|
|
|
|
import static java.nio.charset.CodingErrorAction.REPLACE;
|
|
|
|
import static java.nio.charset.StandardCharsets.US_ASCII;
|
|
|
|
import static java.util.Arrays.copyOf;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isBlank;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Constants.DEFAULT_STREAM_ENCODING;
|
|
|
|
import static org.apache.maven.surefire.api.stream.AbstractStreamDecoder.StreamReadStatus.OVERFLOW;
|
|
|
|
import static org.apache.maven.surefire.api.stream.AbstractStreamDecoder.StreamReadStatus.UNDERFLOW;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param <M> message object
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/ResolvedTest.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/ResolvedTest.java
|
|
|
|
index 9e976c291..6168ea5db 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/ResolvedTest.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/ResolvedTest.java
|
|
|
|
@@ -20,16 +20,16 @@
|
|
|
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.StringUtils;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.MatchPatterns;
|
|
|
|
+import org.apache.maven.shared.utils.StringUtils;
|
|
|
|
+import org.apache.maven.shared.utils.io.MatchPatterns;
|
|
|
|
|
|
|
|
import static java.io.File.separatorChar;
|
|
|
|
import static java.util.regex.Pattern.compile;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.MatchPatterns.from;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.matchPath;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.io.MatchPatterns.from;
|
|
|
|
+import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
|
|
|
|
+import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
|
|
|
|
+import static org.apache.maven.shared.utils.io.SelectorUtils.matchPath;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Single pattern test filter resolved from multi pattern filter -Dtest=MyTest#test,AnotherTest#otherTest.
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/TestListResolver.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/TestListResolver.java
|
|
|
|
index ab8938dc2..3d213410d 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/TestListResolver.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/TestListResolver.java
|
|
|
|
@@ -26,13 +26,13 @@
|
|
|
|
|
|
|
|
import static java.util.Collections.singleton;
|
|
|
|
import static java.util.Collections.unmodifiableSet;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.split;
|
|
|
|
+import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
|
|
|
|
+import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
|
|
|
|
import static org.apache.maven.surefire.api.testset.ResolvedTest.Type.CLASS;
|
|
|
|
import static org.apache.maven.surefire.api.testset.ResolvedTest.Type.METHOD;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.split;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX;
|
|
|
|
|
|
|
|
// TODO In Surefire 3.0 see SUREFIRE-1309 and use normal fully qualified class name regex instead.
|
|
|
|
/**
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/DefaultDirectoryScanner.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/DefaultDirectoryScanner.java
|
|
|
|
index c4d4bb342..12a48e719 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/DefaultDirectoryScanner.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/DefaultDirectoryScanner.java
|
|
|
|
@@ -95,8 +95,8 @@ private static Class<?> loadClass(ClassLoader classLoader, String className) {
|
|
|
|
String[] collectTests() {
|
|
|
|
String[] tests = EMPTY_STRING_ARRAY;
|
|
|
|
if (basedir.exists()) {
|
|
|
|
- org.apache.maven.surefire.shared.utils.io.DirectoryScanner scanner =
|
|
|
|
- new org.apache.maven.surefire.shared.utils.io.DirectoryScanner();
|
|
|
|
+ org.apache.maven.shared.utils.io.DirectoryScanner scanner =
|
|
|
|
+ new org.apache.maven.shared.utils.io.DirectoryScanner();
|
|
|
|
|
|
|
|
scanner.setBasedir(basedir);
|
|
|
|
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ClassMethod.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ClassMethod.java
|
|
|
|
index a4436e702..b88fc6dcb 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ClassMethod.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ClassMethod.java
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data transfer object of class and method literals.
|
|
|
|
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
|
|
|
|
index 4dda97583..01d24d1e6 100644
|
|
|
|
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
|
|
|
|
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
|
|
|
|
@@ -21,8 +21,8 @@
|
|
|
|
import java.lang.management.ManagementFactory;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_17;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_17;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Similar to Java 7 java.util.Objects.
|
|
|
|
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java
|
|
|
|
index 9e1640b6a..1717b05c0 100644
|
|
|
|
--- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java
|
|
|
|
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java
|
|
|
|
@@ -20,8 +20,8 @@
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_17;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_17;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
/**
|
|
|
|
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 4a0c6c568..5d1c9cad8 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-booter/pom.xml
|
|
|
|
+++ b/surefire-booter/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -32,6 +32,29 @@
|
|
|
|
<description>API and Facilities used by forked tests running in JVM sub-process.</description>
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
<dependencies>
|
2025-03-31 07:54:45 +00:00
|
|
|
+ <dependency>
|
2024-10-06 19:54:10 +00:00
|
|
|
+ <groupId>org.powermock</groupId>
|
|
|
|
+ <artifactId>powermock-reflect</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.hamcrest</groupId>
|
|
|
|
+ <artifactId>hamcrest</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>commons-io</groupId>
|
|
|
|
+ <artifactId>commons-io</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
+ </dependency>
|
2024-10-06 19:54:10 +00:00
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
2025-03-31 07:54:45 +00:00
|
|
|
<artifactId>surefire-api</artifactId>
|
|
|
|
@@ -42,10 +65,6 @@
|
|
|
|
<artifactId>surefire-extensions-spi</artifactId>
|
2024-10-06 19:54:10 +00:00
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
2025-03-31 07:54:45 +00:00
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
2024-10-06 19:54:10 +00:00
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
- </dependency>
|
2024-10-06 19:54:10 +00:00
|
|
|
<dependency>
|
2025-03-31 07:54:45 +00:00
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-logger-api</artifactId>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
|
|
|
|
index b1dba3bb5..2166eda1d 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/CommandReader.java
|
|
|
|
@@ -48,14 +48,14 @@
|
|
|
|
import static java.lang.Thread.State.RUNNABLE;
|
|
|
|
import static java.lang.Thread.State.TERMINATED;
|
|
|
|
import static java.util.Objects.requireNonNull;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Command.toShutdown;
|
|
|
|
import static org.apache.maven.surefire.api.booter.MasterProcessCommand.BYE_ACK;
|
|
|
|
import static org.apache.maven.surefire.api.booter.MasterProcessCommand.NOOP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.MasterProcessCommand.SHUTDOWN;
|
|
|
|
import static org.apache.maven.surefire.api.booter.MasterProcessCommand.SKIP_SINCE_NEXT_TEST;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.DaemonThreadFactory.newDaemonThread;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reader of commands coming from plugin(master) process.
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
|
|
|
|
index 1bcdc8b09..0133fe51c 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
|
|
|
|
@@ -37,6 +37,7 @@
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
+import org.apache.maven.shared.utils.cli.ShutdownHookUtils;
|
|
|
|
import org.apache.maven.surefire.api.booter.BaseProviderFactory;
|
|
|
|
import org.apache.maven.surefire.api.booter.Command;
|
|
|
|
import org.apache.maven.surefire.api.booter.DumpErrorSingleton;
|
|
|
|
@@ -51,7 +52,6 @@
|
|
|
|
import org.apache.maven.surefire.api.testset.TestSetFailedException;
|
|
|
|
import org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelProcessorFactory;
|
|
|
|
import org.apache.maven.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils;
|
|
|
|
import org.apache.maven.surefire.spi.MasterProcessChannelProcessorFactory;
|
|
|
|
|
|
|
|
import static java.lang.Thread.currentThread;
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
|
|
|
|
index 2c836ea21..0f22e77ea 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
|
|
|
|
@@ -44,16 +44,16 @@
|
|
|
|
import static java.util.concurrent.TimeUnit.HOURS;
|
|
|
|
import static java.util.concurrent.TimeUnit.MINUTES;
|
|
|
|
import static java.util.regex.Pattern.compile;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_HP_UX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.StringUtils.NL;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.ERR_PROCESS_INFO;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.INVALID_PROCESS_INFO;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isNotBlank;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_HP_UX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_UNIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Recognizes PID of Plugin process and determines lifetime.
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessCheckerType.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessCheckerType.java
|
|
|
|
index 9b49055a4..911735fe8 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessCheckerType.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessCheckerType.java
|
|
|
|
@@ -18,7 +18,7 @@
|
|
|
|
*/
|
|
|
|
package org.apache.maven.surefire.booter;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
|
|
|
|
index 91cdb4f8c..059d1f808 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.StringUtils;
|
|
|
|
+import org.apache.maven.shared.utils.StringUtils;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kristian Rosenvold
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
|
|
|
|
index 56c5e4408..839fe32ab 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
import org.apache.maven.surefire.api.suite.RunResult;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Encapsulates exceptions thrown during Surefire forking.
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
|
|
|
|
index 3f7b4aa5b..35b90575c 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java
|
|
|
|
@@ -34,16 +34,16 @@
|
|
|
|
|
|
|
|
import static java.lang.Thread.currentThread;
|
|
|
|
import static java.util.Objects.requireNonNull;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_9;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isNumeric;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD;
|
|
|
|
import static org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodChain;
|
|
|
|
import static org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray;
|
|
|
|
import static org.apache.maven.surefire.api.util.ReflectionUtils.tryLoadClass;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_9;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isNumeric;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_FREE_BSD;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_NET_BSD;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_OPEN_BSD;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* JDK 9 support.
|
|
|
|
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/stream/CommandDecoder.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/stream/CommandDecoder.java
|
|
|
|
index 3a48ca92d..d46bb53fc 100644
|
|
|
|
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/stream/CommandDecoder.java
|
|
|
|
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/stream/CommandDecoder.java
|
|
|
|
@@ -37,6 +37,7 @@
|
|
|
|
import org.apache.maven.surefire.api.stream.MalformedChannelException;
|
|
|
|
import org.apache.maven.surefire.api.stream.SegmentType;
|
|
|
|
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Command.BYE_ACK;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Command.NOOP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.Command.SKIP_SINCE_NEXT_TEST;
|
|
|
|
@@ -48,7 +49,6 @@
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.DATA_STRING;
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.END_OF_FRAME;
|
|
|
|
import static org.apache.maven.surefire.api.stream.SegmentType.STRING_ENCODING;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java
|
|
|
|
index 0c5dff743..b5a8be1fb 100644
|
|
|
|
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java
|
|
|
|
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java
|
|
|
|
@@ -34,6 +34,7 @@
|
|
|
|
import java.util.concurrent.FutureTask;
|
|
|
|
|
|
|
|
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
|
|
|
|
+import org.apache.maven.shared.utils.cli.ShutdownHookUtils;
|
|
|
|
import org.apache.maven.surefire.api.booter.MasterProcessChannelDecoder;
|
|
|
|
import org.apache.maven.surefire.api.booter.MasterProcessChannelEncoder;
|
|
|
|
import org.apache.maven.surefire.api.fork.ForkNodeArguments;
|
|
|
|
@@ -43,7 +44,6 @@
|
|
|
|
import org.apache.maven.surefire.booter.spi.EventChannelEncoder;
|
|
|
|
import org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelProcessorFactory;
|
|
|
|
import org.apache.maven.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils;
|
|
|
|
import org.apache.maven.surefire.spi.MasterProcessChannelProcessorFactory;
|
|
|
|
import org.junit.Rule;
|
|
|
|
import org.junit.Test;
|
|
|
|
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/IsolatedClassLoaderTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/IsolatedClassLoaderTest.java
|
|
|
|
index ccc1c1f66..c01aa4d7c 100644
|
|
|
|
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/IsolatedClassLoaderTest.java
|
|
|
|
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/IsolatedClassLoaderTest.java
|
|
|
|
@@ -21,8 +21,8 @@
|
|
|
|
import java.io.File;
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.io.FileUtils;
|
|
|
|
import org.apache.maven.surefire.api.provider.AbstractProvider;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.FileUtils;
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
|
|
|
|
index 1bb96440c..37b3d1c4e 100644
|
|
|
|
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
|
|
|
|
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
|
|
|
|
@@ -28,7 +28,7 @@
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.FileUtils;
|
|
|
|
+import org.apache.maven.shared.utils.io.FileUtils;
|
|
|
|
import org.junit.After;
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.Test;
|
|
|
|
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
|
|
|
|
index 78f35716f..83417659b 100644
|
|
|
|
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
|
|
|
|
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
|
|
|
|
@@ -38,10 +38,10 @@
|
|
|
|
import static java.nio.charset.StandardCharsets.US_ASCII;
|
|
|
|
import static java.nio.file.Files.readAllBytes;
|
|
|
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo;
|
|
|
|
import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_UNIX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.hamcrest.CoreMatchers.is;
|
|
|
|
import static org.hamcrest.CoreMatchers.not;
|
|
|
|
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
|
|
|
|
index 6752ba75b..9e2277916 100644
|
|
|
|
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
|
|
|
|
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
|
|
|
|
@@ -31,12 +31,12 @@
|
|
|
|
import org.powermock.modules.junit4.PowerMockRunner;
|
|
|
|
|
|
|
|
import static java.io.File.separator;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_9;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_FREE_BSD;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_NET_BSD;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_OPEN_BSD;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_9;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.junit.Assume.assumeTrue;
|
|
|
|
import static org.mockito.Matchers.any;
|
|
|
|
diff --git a/surefire-extensions-api/pom.xml b/surefire-extensions-api/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 45a959160..b464ea738 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-extensions-api/pom.xml
|
|
|
|
+++ b/surefire-extensions-api/pom.xml
|
|
|
|
@@ -30,6 +30,15 @@
|
|
|
|
<name>Surefire Extensions API</name>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-api</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -47,10 +56,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<artifactId>jsr305</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
2025-03-31 07:54:45 +00:00
|
|
|
<groupId>org.junit.jupiter</groupId>
|
|
|
|
<artifactId>junit-jupiter-api</artifactId>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ConsoleOutputReporter.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ConsoleOutputReporter.java
|
|
|
|
index 5f32f9b78..2129e8589 100644
|
|
|
|
--- a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ConsoleOutputReporter.java
|
|
|
|
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ConsoleOutputReporter.java
|
|
|
|
@@ -21,7 +21,7 @@
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.PrintStream;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extension for logger.
|
|
|
|
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/StatelessReporter.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/StatelessReporter.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index da330c02e..aebe45f23 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/StatelessReporter.java
|
|
|
|
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/StatelessReporter.java
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
import org.apache.maven.surefire.api.report.TestSetReportEntry;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extension for stateless reporter.
|
|
|
|
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java
|
|
|
|
index 737fd5af1..9fa7ade79 100644
|
|
|
|
--- a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java
|
|
|
|
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/util/CommandlineExecutor.java
|
|
|
|
@@ -20,11 +20,11 @@
|
|
|
|
|
|
|
|
import java.io.Closeable;
|
|
|
|
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.CommandLineException;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.Commandline;
|
|
|
|
+import org.apache.maven.shared.utils.cli.CommandLineException;
|
|
|
|
+import org.apache.maven.shared.utils.cli.Commandline;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook;
|
|
|
|
+import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Programming model with this class:
|
|
|
|
diff --git a/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java b/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index d7d4946f9..8009dbf90 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java
|
|
|
|
+++ b/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java
|
|
|
|
@@ -21,17 +21,17 @@
|
|
|
|
import java.io.Closeable;
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.cli.Commandline;
|
|
|
|
import org.apache.maven.surefire.extensions.EventHandler;
|
|
|
|
import org.apache.maven.surefire.extensions.util.CommandlineExecutor;
|
|
|
|
import org.apache.maven.surefire.extensions.util.CommandlineStreams;
|
|
|
|
import org.apache.maven.surefire.extensions.util.CountdownCloseable;
|
|
|
|
import org.apache.maven.surefire.extensions.util.LineConsumerThread;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.cli.Commandline;
|
2025-03-31 07:54:45 +00:00
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.junit.jupiter.api.Test;
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
+import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.assertj.core.util.Files.delete;
|
|
|
|
import static org.mockito.ArgumentMatchers.contains;
|
|
|
|
diff --git a/surefire-grouper/pom.xml b/surefire-grouper/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 75b2d4806..beea322c2 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-grouper/pom.xml
|
|
|
|
+++ b/surefire-grouper/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -47,9 +47,9 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<build>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
|
|
- <groupId>org.javacc.plugin</groupId>
|
|
|
|
+ <groupId>org.codehaus.mojo</groupId>
|
|
|
|
<artifactId>javacc-maven-plugin</artifactId>
|
|
|
|
- <version>3.0.3</version>
|
|
|
|
+ <version>3.1.0</version>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>net.java.dev.javacc</groupId>
|
2024-11-04 00:14:27 +00:00
|
|
|
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 2f1ddd83e..b80682ece 100644
|
2024-11-04 00:14:27 +00:00
|
|
|
--- a/surefire-its/pom.xml
|
|
|
|
+++ b/surefire-its/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -60,21 +60,11 @@
|
2024-11-04 00:14:27 +00:00
|
|
|
<artifactId>hamcrest</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven</groupId>
|
|
|
|
- <artifactId>maven-settings</artifactId>
|
|
|
|
- <scope>test</scope>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.htmlunit</groupId>
|
|
|
|
<artifactId>htmlunit</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven</groupId>
|
|
|
|
- <artifactId>maven-artifact</artifactId>
|
|
|
|
- <scope>test</scope>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.shared</groupId>
|
|
|
|
<artifactId>maven-shared-utils</artifactId>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-providers/common-java5/pom.xml b/surefire-providers/common-java5/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 0d4ca40f4..8ec44b0c0 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/common-java5/pom.xml
|
|
|
|
+++ b/surefire-providers/common-java5/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -33,8 +33,8 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
2025-03-31 07:54:45 +00:00
|
|
|
<dependency>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
|
|
|
|
index e5c66dde8..171d267f1 100644
|
|
|
|
--- a/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
|
|
|
|
+++ b/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/report/SmartStackTraceParser.java
|
|
|
|
@@ -26,8 +26,8 @@
|
|
|
|
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
import static java.util.Collections.reverse;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.chompLast;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.chompLast;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotEmpty;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kristian Rosenvold
|
|
|
|
diff --git a/surefire-providers/common-junit4/pom.xml b/surefire-providers/common-junit4/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 663e0e4c3..8586a3f6c 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/common-junit4/pom.xml
|
|
|
|
+++ b/surefire-providers/common-junit4/pom.xml
|
|
|
|
@@ -32,6 +32,10 @@
|
|
|
|
<description>Shared JUnit4 Provider Code</description>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -43,10 +47,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<artifactId>surefire-logger-api</artifactId>
|
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>common-junit3</artifactId>
|
|
|
|
diff --git a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
|
|
|
|
index b0a74a4f7..26be9beac 100644
|
|
|
|
--- a/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
|
|
|
|
+++ b/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerFactory.java
|
|
|
|
@@ -24,7 +24,7 @@
|
|
|
|
import org.apache.maven.surefire.api.util.ReflectionUtils;
|
|
|
|
import org.junit.runner.notification.RunListener;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Kristian Rosenvold
|
|
|
|
diff --git a/surefire-providers/common-junit48/pom.xml b/surefire-providers/common-junit48/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index e12469612..331d9e804 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/common-junit48/pom.xml
|
|
|
|
+++ b/surefire-providers/common-junit48/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -32,16 +32,16 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<description>Shared JUnit48 Provider Code</description>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
|
|
|
<version>4.8.1</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>common-junit4</artifactId>
|
|
|
|
diff --git a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java
|
|
|
|
index 45d21b751..6cdd9c892 100644
|
|
|
|
--- a/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java
|
|
|
|
+++ b/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java
|
|
|
|
@@ -29,9 +29,9 @@
|
|
|
|
import org.junit.runner.Description;
|
|
|
|
import org.junit.runner.manipulation.Filter;
|
|
|
|
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isNotBlank;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.TESTNG_GROUPS_PROP;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isNotBlank;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Todd Lipcon
|
|
|
|
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
|
|
|
|
index ddb772ae6..679ef712a 100644
|
|
|
|
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
|
|
|
|
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
|
|
|
|
@@ -23,10 +23,10 @@
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collections;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.io.MatchPatterns;
|
|
|
|
import org.apache.maven.surefire.api.testset.ResolvedTest;
|
|
|
|
import org.apache.maven.surefire.api.testset.TestListResolver;
|
|
|
|
import org.apache.maven.surefire.common.junit48.tests.pt.PT;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.io.MatchPatterns;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.runner.Description;
|
|
|
|
import org.junit.runner.JUnitCore;
|
|
|
|
diff --git a/surefire-providers/surefire-junit-platform/pom.xml b/surefire-providers/surefire-junit-platform/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index c40f1ec07..b056e5627 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/surefire-junit-platform/pom.xml
|
|
|
|
+++ b/surefire-providers/surefire-junit-platform/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -78,13 +78,23 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>common-java5</artifactId>
|
|
|
|
- <version>${project.version}</version>
|
|
|
|
+ <groupId>org.opentest4j</groupId>
|
|
|
|
+ <artifactId>opentest4j</artifactId>
|
|
|
|
+ <version>1.2.0</version>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
+ <artifactId>common-java5</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
+ <version>${project.version}</version>
|
2024-10-06 19:54:10 +00:00
|
|
|
</dependency>
|
|
|
|
<dependency>
|
2025-03-31 07:54:45 +00:00
|
|
|
<groupId>org.junit.platform</groupId>
|
2024-10-06 19:54:10 +00:00
|
|
|
diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
|
2025-03-31 07:54:45 +00:00
|
|
|
index 416c38a38..683af9ec0 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
|
|
|
|
+++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
|
|
|
|
@@ -30,6 +30,7 @@
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.StringUtils;
|
|
|
|
import org.apache.maven.surefire.api.provider.AbstractProvider;
|
|
|
|
import org.apache.maven.surefire.api.provider.ProviderParameters;
|
|
|
|
import org.apache.maven.surefire.api.report.ReporterException;
|
|
|
|
@@ -39,7 +40,6 @@
|
|
|
|
import org.apache.maven.surefire.api.util.ScanResult;
|
|
|
|
import org.apache.maven.surefire.api.util.SurefireReflectionException;
|
|
|
|
import org.apache.maven.surefire.api.util.TestsToRun;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.StringUtils;
|
|
|
|
import org.junit.platform.engine.DiscoverySelector;
|
|
|
|
import org.junit.platform.engine.Filter;
|
|
|
|
import org.junit.platform.launcher.EngineFilter;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -56,6 +56,7 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import static java.util.Optional.of;
|
|
|
|
import static java.util.logging.Level.WARNING;
|
|
|
|
import static java.util.stream.Collectors.toList;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.EXCLUDE_JUNIT5_ENGINES_PROP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.INCLUDE_JUNIT5_ENGINES_PROP;
|
|
|
|
import static org.apache.maven.surefire.api.booter.ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP;
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -65,7 +66,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
import static org.apache.maven.surefire.api.report.RunMode.RERUN_TEST_AFTER_FAILURE;
|
|
|
|
import static org.apache.maven.surefire.api.testset.TestListResolver.optionallyWildcardFilter;
|
|
|
|
import static org.apache.maven.surefire.api.util.TestsToRun.fromClass;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;
|
|
|
|
import static org.junit.platform.engine.discovery.DiscoverySelectors.selectUniqueId;
|
|
|
|
import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request;
|
|
|
|
diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
|
2024-11-04 00:14:27 +00:00
|
|
|
index 7ae8cc79d..094aaafe8 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
|
|
|
|
+++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
|
|
|
|
@@ -49,8 +49,8 @@
|
|
|
|
import static java.util.Collections.emptyMap;
|
|
|
|
import static java.util.stream.Collectors.joining;
|
|
|
|
import static java.util.stream.Collectors.toList;
|
|
|
|
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|
|
|
import static org.apache.maven.surefire.api.util.internal.ObjectUtils.systemProps;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.StringUtils.isNotBlank;
|
|
|
|
import static org.junit.platform.engine.TestExecutionResult.Status.FAILED;
|
|
|
|
|
|
|
|
/**
|
|
|
|
diff --git a/surefire-providers/surefire-junit3/pom.xml b/surefire-providers/surefire-junit3/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 0db3383ed..51bd1d591 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/surefire-junit3/pom.xml
|
|
|
|
+++ b/surefire-providers/surefire-junit3/pom.xml
|
|
|
|
@@ -32,6 +32,11 @@
|
|
|
|
<description>Surefire JUnit3 Runner</description>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.commons</groupId>
|
|
|
|
+ <artifactId>commons-lang3</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -48,11 +53,6 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<artifactId>common-java5</artifactId>
|
|
|
|
<version>${project.version}</version>
|
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- <scope>test</scope>
|
|
|
|
- </dependency>
|
|
|
|
</dependencies>
|
|
|
|
|
|
|
|
<build>
|
|
|
|
diff --git a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
|
|
|
|
index 35979a1ec..1824cb983 100644
|
|
|
|
--- a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
|
|
|
|
+++ b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
|
|
|
|
@@ -35,8 +35,8 @@
|
|
|
|
import org.apache.maven.surefire.api.testset.TestSetFailedException;
|
|
|
|
import org.apache.maven.surefire.common.junit3.JUnit3Reflector;
|
|
|
|
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_17;
|
|
|
|
-import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_17;
|
|
|
|
+import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index df68dc121..e6062580c 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-providers/surefire-testng/pom.xml
|
|
|
|
+++ b/surefire-providers/surefire-testng/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -32,6 +32,10 @@
|
2024-10-06 19:54:10 +00:00
|
|
|
<description>Surefire TestNG Runner</description>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.apache.maven.shared</groupId>
|
|
|
|
+ <artifactId>maven-shared-utils</artifactId>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -43,10 +47,6 @@
|
|
|
|
<artifactId>assertj-core</artifactId>
|
|
|
|
<scope>test</scope>
|
2024-10-06 19:54:10 +00:00
|
|
|
</dependency>
|
|
|
|
- <dependency>
|
|
|
|
- <groupId>org.apache.maven.surefire</groupId>
|
|
|
|
- <artifactId>surefire-shared-utils</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>common-java5</artifactId>
|
|
|
|
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
|
|
|
|
index 871ed9f49..f4a2a9494 100644
|
|
|
|
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
|
|
|
|
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
|
|
|
|
@@ -32,7 +32,7 @@
|
|
|
|
import org.apache.maven.surefire.api.util.TestsToRun;
|
|
|
|
|
|
|
|
import static java.util.Collections.singleton;
|
|
|
|
-import static org.apache.maven.surefire.shared.utils.StringUtils.isBlank;
|
|
|
|
+import static org.apache.maven.shared.utils.StringUtils.isBlank;
|
|
|
|
import static org.apache.maven.surefire.testng.TestNGExecutor.run;
|
|
|
|
|
|
|
|
/**
|
|
|
|
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
|
|
|
|
index 96e7170b9..e3662f43e 100644
|
|
|
|
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
|
|
|
|
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
|
|
|
|
@@ -28,12 +28,12 @@
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
+import org.apache.maven.shared.utils.StringUtils;
|
|
|
|
import org.apache.maven.surefire.api.booter.ProviderParameterNames;
|
|
|
|
import org.apache.maven.surefire.api.cli.CommandLineOption;
|
|
|
|
import org.apache.maven.surefire.api.report.RunListener;
|
|
|
|
import org.apache.maven.surefire.api.testset.TestListResolver;
|
|
|
|
import org.apache.maven.surefire.api.testset.TestSetFailedException;
|
|
|
|
-import org.apache.maven.surefire.shared.utils.StringUtils;
|
|
|
|
import org.apache.maven.surefire.testng.conf.Configurator;
|
|
|
|
import org.apache.maven.surefire.testng.utils.FailFastEventsSingleton;
|
|
|
|
import org.apache.maven.surefire.testng.utils.FailFastListener;
|
|
|
|
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
index 132a1e312..5a7348235 100644
|
2024-10-06 19:54:10 +00:00
|
|
|
--- a/surefire-report-parser/pom.xml
|
|
|
|
+++ b/surefire-report-parser/pom.xml
|
2025-03-31 07:54:45 +00:00
|
|
|
@@ -42,6 +42,11 @@
|
|
|
|
<artifactId>maven-shared-utils</artifactId>
|
|
|
|
</dependency>
|
2024-10-06 19:54:10 +00:00
|
|
|
|
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>org.hamcrest</groupId>
|
|
|
|
+ <artifactId>hamcrest</artifactId>
|
|
|
|
+ <scope>test</scope>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
2025-03-31 07:54:45 +00:00
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
2025-03-31 15:33:51 +00:00
|
|
|
diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml
|
|
|
|
index 73dca095b..2178f2716 100644
|
|
|
|
--- a/surefire-shadefire/pom.xml
|
|
|
|
+++ b/surefire-shadefire/pom.xml
|
|
|
|
@@ -75,7 +75,6 @@
|
|
|
|
<configuration>
|
|
|
|
<artifactSet>
|
|
|
|
<includes>
|
|
|
|
- <include>org.apache.maven.surefire:surefire-shared-utils</include>
|
|
|
|
<include>org.apache.maven.surefire:surefire-logger-api</include>
|
|
|
|
<include>org.apache.maven.surefire:surefire-api</include>
|
|
|
|
<include>org.apache.maven.surefire:surefire-extensions-spi</include>
|
2024-10-06 19:54:10 +00:00
|
|
|
--
|
2025-03-31 07:54:45 +00:00
|
|
|
2.49.0
|
2024-10-06 19:54:10 +00:00
|
|
|
|