You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kr...@apache.org on 2012/11/05 20:25:43 UTC
git commit: o Migrated to m-s-u
Updated Branches:
refs/heads/master 60448b1fa -> a796ecc57
o Migrated to m-s-u
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/a796ecc5
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/a796ecc5
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/a796ecc5
Branch: refs/heads/master
Commit: a796ecc5740d9434864983f9ac61e2c284edc8a3
Parents: 60448b1
Author: Kristian Rosenvold <kr...@apache.org>
Authored: Mon Nov 5 20:11:21 2012 +0100
Committer: Kristian Rosenvold <kr...@apache.org>
Committed: Mon Nov 5 20:14:42 2012 +0100
----------------------------------------------------------------------
maven-failsafe-plugin/pom.xml | 31 +
.../maven/plugin/failsafe/IntegrationTestMojo.java | 7 +-
.../apache/maven/plugin/failsafe/VerifyMojo.java | 6 +-
maven-surefire-common/pom.xml | 14 +-
.../plugin/surefire/AbstractSurefireMojo.java | 4 +-
.../surefire/booterclient/ForkConfiguration.java | 7 +-
.../plugin/surefire/booterclient/ForkStarter.java | 8 +-
.../surefire/booterclient/output/ForkClient.java | 4 +-
.../output/ThreadedStreamConsumer.java | 2 +-
.../surefire/report/PrettyPrintXMLWriter.java | 12 +-
.../surefire/report/StatelessXmlReporter.java | 6 +-
.../plugin/surefire/util/SpecificFileFilter.java | 2 +-
.../booterclient/ForkConfigurationTest.java | 5 +-
.../maven/plugin/surefire/SurefirePlugin.java | 2 +-
maven-surefire-report-plugin/pom.xml | 5 +-
.../report/AbstractSurefireReportMojo.java | 5 +-
.../surefire/report/SurefireReportParser.java | 27 +-
.../surefire/report/TestSuiteXmlParser.java | 548 ++++++++-------
.../surefire/report/SurefireReportMojoTest.java | 4 +-
.../surefire/report/TestSuiteXmlParserTest.java | 49 ++
pom.xml | 5 +
surefire-api/pom.xml | 12 +-
.../maven/surefire/SpecificTestClassFilter.java | 2 +-
.../surefire/util/DefaultDirectoryScanner.java | 2 +-
surefire-integration-tests/pom.xml | 5 +-
.../surefire/its/fixture/SurefireReportParser.java | 4 +-
surefire-providers/common-junit4/pom.xml | 7 +-
surefire-providers/common-junit48/pom.xml | 8 +-
.../surefire/common/junit48/FilterFactory.java | 2 +-
surefire-providers/surefire-junit4/pom.xml | 10 +-
.../maven/surefire/junit4/JUnit4Provider.java | 2 +-
surefire-providers/surefire-testng-utils/pom.xml | 14 +-
.../surefire/testng/utils/MethodSelector.java | 2 +-
surefire-setup-integration-tests/pom.xml | 5 -
.../maven/surefire/its/StagedLocalRepoHelper.java | 4 +-
surefire-shadefire/pom.xml | 9 -
36 files changed, 472 insertions(+), 369 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-failsafe-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index d627194..bb32791 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -142,6 +142,10 @@
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
@@ -278,6 +282,33 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <minimizeJar>true</minimizeJar>
+ <artifactSet>
+ <includes>
+ <include>org.apache.maven.shared:maven-shared-utils</include>
+ </includes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+ <pattern>org.apache.maven.shared</pattern>
+ <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
index 094adde..f06fb6e 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
@@ -38,16 +38,17 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.surefire.booter.ProviderConfiguration;
import org.apache.maven.surefire.failsafe.model.FailsafeSummary;
import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Reader;
import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Writer;
import org.apache.maven.surefire.suite.RunResult;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.shared.utils.ReaderFactory;
+
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import static org.codehaus.plexus.util.IOUtil.close;
+import static org.apache.maven.shared.utils.io.IOUtil.close;
/**
* Run integration tests using Surefire.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
----------------------------------------------------------------------
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
index d7c3eea..52a4d52 100644
--- 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
@@ -33,11 +33,11 @@ import org.apache.maven.plugin.surefire.SurefireReportParameters;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.surefire.failsafe.model.FailsafeSummary;
import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Reader;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.shared.utils.io.IOUtil;
+import org.apache.maven.shared.utils.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/pom.xml
----------------------------------------------------------------------
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
index 8cf44bb..bdcc14c 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -18,7 +18,8 @@
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -51,8 +52,8 @@
<artifactId>surefire-booter</artifactId>
</dependency>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -119,13 +120,14 @@
<minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
- <include>org.codehaus.plexus:plexus-utils</include>
+ <include>org.apache.maven.shared:maven-shared-utils</include>
+ <include>org.apache.maven.shared:maven-common-artifact-filters</include>
</includes>
</artifactSet>
<relocations>
<relocation>
- <pattern>org.codehaus.plexus.util.xml</pattern>
- <shadedPattern>org.apache.maven.plugin.surefire.report.plexus.util.xml</shadedPattern>
+ <pattern>org.apache.maven.shared</pattern>
+ <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
</relocation>
</relocations>
</configuration>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 9e0566a..f5dfe26 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -47,6 +47,8 @@ import org.apache.maven.plugins.annotations.Component;
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.StringUtils;
+import org.apache.maven.shared.utils.io.FileUtils;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.Classpath;
import org.apache.maven.surefire.booter.ClasspathConfiguration;
@@ -66,8 +68,6 @@ import org.apache.maven.surefire.util.NestedRuntimeException;
import org.apache.maven.surefire.util.RunOrder;
import org.apache.maven.toolchain.Toolchain;
import org.apache.maven.toolchain.ToolchainManager;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
import java.io.File;
import java.io.IOException;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
index e24dbd4..451af02 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkConfiguration.java
@@ -22,20 +22,19 @@ package org.apache.maven.plugin.surefire.booterclient;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import java.util.jar.Manifest;
import org.apache.maven.plugin.surefire.util.Relocator;
+import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.cli.Commandline;
import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
import org.apache.maven.surefire.booter.Classpath;
import org.apache.maven.surefire.booter.ForkedBooter;
import org.apache.maven.surefire.booter.SurefireBooterForkException;
import org.apache.maven.surefire.util.UrlUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.cli.Commandline;
/**
* Configuration for forking tests.
@@ -92,7 +91,7 @@ public class ForkConfiguration
return bootClasspathConfiguration;
}
- public static String getEffectiveForkMode(String forkMode)
+ public static String getEffectiveForkMode( String forkMode )
{
if ( "pertest".equalsIgnoreCase( forkMode ) )
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
----------------------------------------------------------------------
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 919558e..8a1c221 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
@@ -51,10 +51,10 @@ import org.apache.maven.surefire.providerapi.SurefireProvider;
import org.apache.maven.surefire.report.RunStatistics;
import org.apache.maven.surefire.suite.RunResult;
import org.apache.maven.surefire.util.DefaultScanResult;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.CommandLineTimeOutException;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-import org.codehaus.plexus.util.cli.Commandline;
+import org.apache.maven.shared.utils.cli.CommandLineException;
+import org.apache.maven.shared.utils.cli.CommandLineTimeOutException;
+import org.apache.maven.shared.utils.cli.CommandLineUtils;
+import org.apache.maven.shared.utils.cli.Commandline;
/**
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
index b66a3d4..6b99083 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClient.java
@@ -28,8 +28,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
-
import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
+import org.apache.maven.shared.utils.cli.StreamConsumer;
import org.apache.maven.surefire.booter.ForkingRunListener;
import org.apache.maven.surefire.report.CategorizedReportEntry;
import org.apache.maven.surefire.report.ConsoleLogger;
@@ -37,11 +37,9 @@ import org.apache.maven.surefire.report.ConsoleOutputReceiver;
import org.apache.maven.surefire.report.ReportEntry;
import org.apache.maven.surefire.report.ReporterException;
import org.apache.maven.surefire.report.RunListener;
-import org.apache.maven.surefire.report.SimpleReportEntry;
import org.apache.maven.surefire.report.StackTraceWriter;
import org.apache.maven.surefire.util.NestedRuntimeException;
import org.apache.maven.surefire.util.internal.StringUtils;
-import org.codehaus.plexus.util.cli.StreamConsumer;
/**
* Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
index 6903dbc..c2c1519 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
@@ -21,7 +21,7 @@ package org.apache.maven.plugin.surefire.booterclient.output;
import org.apache.maven.plugin.surefire.util.internal.BlockingQueue;
import org.apache.maven.plugin.surefire.util.internal.Java15BlockingQueue;
-import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.apache.maven.shared.utils.cli.StreamConsumer;
/**
* Knows how to reconstruct *all* the state transmitted over stdout by the forked process.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
index 256795b..e4021c5 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/PrettyPrintXMLWriter.java
@@ -19,9 +19,11 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
+import org.apache.maven.shared.utils.xml.XMLWriter;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
import java.io.PrintWriter;
import java.util.LinkedList;
-import org.codehaus.plexus.util.xml.XMLWriter;
public class PrettyPrintXMLWriter
implements XMLWriter
@@ -65,6 +67,14 @@ public class PrettyPrintXMLWriter
}
}
+ public void setEncoding(String encoding) {
+ throw new NotImplementedException();
+ }
+
+ public void setDocType(String docType) {
+ throw new NotImplementedException();
+ }
+
private PrettyPrintXMLWriter( PrintWriter writer, String encoding, String doctype )
{
this( writer, " ", encoding, doctype );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java
----------------------------------------------------------------------
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
index ae9d039..8ec63c5 100644
--- 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
@@ -19,12 +19,12 @@ package org.apache.maven.plugin.surefire.report;
* under the License.
*/
+import org.apache.maven.shared.utils.xml.Xpp3Dom;
+import org.apache.maven.shared.utils.xml.Xpp3DomWriter;
import org.apache.maven.surefire.report.ReportEntry;
import org.apache.maven.surefire.report.ReporterException;
import org.apache.maven.surefire.report.SafeThrowable;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.codehaus.plexus.util.xml.Xpp3DomWriter;
+import org.apache.maven.shared.utils.io.IOUtil;
import java.io.BufferedWriter;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/util/SpecificFileFilter.java
----------------------------------------------------------------------
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 4ae1a69..0309ed8 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
@@ -22,7 +22,7 @@ package org.apache.maven.plugin.surefire.util;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import org.codehaus.plexus.util.SelectorUtils;
+import org.apache.maven.shared.utils.io.SelectorUtils;
public class SpecificFileFilter
{
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
----------------------------------------------------------------------
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 7a2f794..ce44f23 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
@@ -22,10 +22,11 @@ package org.apache.maven.plugin.surefire.booterclient;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
+
+import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.surefire.booter.Classpath;
import org.apache.maven.surefire.booter.SurefireBooterForkException;
-import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.cli.Commandline;
+import org.apache.maven.shared.utils.cli.Commandline;
import junit.framework.TestCase;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
index 9a1d318..9f90b52 100644
--- a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
+++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
@@ -28,7 +28,7 @@ import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.surefire.suite.RunResult;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.surefire.util.internal.StringUtils;
/**
* Run tests using Surefire.
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml
index f0dc3eb..9627417 100644
--- a/maven-surefire-report-plugin/pom.xml
+++ b/maven-surefire-report-plugin/pom.xml
@@ -116,7 +116,10 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
<!-- test -->
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java
index a4429c3..590f8c7 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/AbstractSurefireReportMojo.java
@@ -30,14 +30,13 @@ import org.apache.maven.model.ReportPlugin;
import org.apache.maven.project.MavenProject;
import org.apache.maven.reporting.AbstractMavenReport;
import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.util.PathTool;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.shared.utils.PathTool;
+import org.apache.maven.shared.utils.StringUtils;
/**
* Abstract base class for reporting test results using Surefire.
*
* @author Stephen Connolly
- *
*/
public abstract class AbstractSurefireReportMojo
extends AbstractMavenReport
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
index e8adbd5..9d2e94e 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/SurefireReportParser.java
@@ -31,8 +31,8 @@ import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.io.DirectoryScanner;
import javax.xml.parsers.ParserConfigurationException;
@@ -230,29 +230,20 @@ public class SurefireReportParser
return numberFormat.format( percentage );
}
- public List<ReportTestCase> getFailureDetails( List testSuitesList )
+ public List<ReportTestCase> getFailureDetails( List<ReportTestSuite> testSuitesList )
{
- ListIterator iter = testSuitesList.listIterator();
-
List<ReportTestCase> failureDetailList = new ArrayList<ReportTestCase>();
- while ( iter.hasNext() )
+ for (ReportTestSuite suite : testSuitesList)
{
- ReportTestSuite suite = (ReportTestSuite) iter.next();
-
- List testCaseList = suite.getTestCases();
+ List<ReportTestCase> testCaseList = suite.getTestCases();
if ( testCaseList != null )
{
- ListIterator caseIter = testCaseList.listIterator();
-
- while ( caseIter.hasNext() )
- {
- ReportTestCase tCase = (ReportTestCase) caseIter.next();
+ for (ReportTestCase tCase : testCaseList) {
- if ( tCase.getFailure() != null )
- {
- failureDetailList.add( tCase );
+ if (tCase.getFailure() != null) {
+ failureDetailList.add(tCase);
}
}
}
@@ -281,7 +272,7 @@ public class SurefireReportParser
scanner.setIncludes( StringUtils.split( includes, "," ) );
- scanner.setExcludes( StringUtils.split( excludes, "," ) );
+ scanner.setExcludes( StringUtils.split(excludes, ",") );
scanner.scan();
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
index 86a5244..8ccef56 100644
--- a/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java
@@ -1,265 +1,283 @@
-package org.apache.maven.plugins.surefire.report;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.text.NumberFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- *
- */
-public class TestSuiteXmlParser
- extends DefaultHandler
-{
- private ReportTestSuite defaultSuite;
-
- private ReportTestSuite currentSuite;
-
- private Map<String, ReportTestSuite> classesToSuites;
-
- private final NumberFormat numberFormat = NumberFormat.getInstance( Locale.ENGLISH );
-
- /**
- * @noinspection StringBufferField
- */
- private StringBuffer currentElement;
-
- private ReportTestCase testCase;
-
- public Collection<ReportTestSuite> parse( String xmlPath )
- throws ParserConfigurationException, SAXException, IOException
- {
- SAXParserFactory factory = SAXParserFactory.newInstance();
-
- SAXParser saxParser = factory.newSAXParser();
-
- classesToSuites = new HashMap<String, ReportTestSuite>();
-
- saxParser.parse( new File( xmlPath ), this );
-
- if ( currentSuite != defaultSuite )
- { // omit the defaultSuite if it's empty and there are alternatives
- if ( defaultSuite.getNumberOfTests() == 0 )
- {
- classesToSuites.remove( defaultSuite.getFullClassName() );
- }
- }
-
- return classesToSuites.values();
- }
-
- /**
- * {@inheritDoc}
- */
- public void startElement( String uri, String localName, String qName, Attributes attributes )
- throws SAXException
- {
- try
- {
- if ( "testsuite".equals( qName ) )
- {
- currentSuite = defaultSuite = new ReportTestSuite();
-
- try
- {
- Number time = numberFormat.parse( attributes.getValue( "time" ) );
-
- defaultSuite.setTimeElapsed( time.floatValue() );
- }
- catch ( NullPointerException npe )
- {
- System.err.println( "WARNING: no time attribute found on testsuite element" );
- }
-
- //check if group attribute is existing
- if ( attributes.getValue( "group" ) != null && !"".equals( attributes.getValue( "group" ) ) )
- {
- String packageName = attributes.getValue( "group" );
- String name = attributes.getValue( "name" );
-
- defaultSuite.setFullClassName( packageName + "." + name );
- }
- else
- {
- String fullClassName = attributes.getValue( "name" );
- defaultSuite.setFullClassName( fullClassName );
- }
-
- classesToSuites.put( defaultSuite.getFullClassName(), defaultSuite );
- }
- else if ( "testcase".equals( qName ) )
- {
- currentElement = new StringBuffer();
-
- testCase = new ReportTestCase();
-
- testCase.setName( attributes.getValue( "name" ) );
-
- String fullClassName = attributes.getValue( "classname" );
-
- // if the testcase declares its own classname, it may need to belong to its own suite
- if ( fullClassName != null )
- {
- currentSuite = (ReportTestSuite) classesToSuites.get( fullClassName );
- if ( currentSuite == null )
- {
- currentSuite = new ReportTestSuite();
- currentSuite.setFullClassName( fullClassName );
- classesToSuites.put( fullClassName, currentSuite );
- }
- }
-
- testCase.setFullClassName( currentSuite.getFullClassName() );
- testCase.setClassName( currentSuite.getName() );
- testCase.setFullName( currentSuite.getFullClassName() + "." + testCase.getName() );
-
- String timeAsString = attributes.getValue( "time" );
-
- Number time = new Integer( 0 );
-
- if ( timeAsString != null )
- {
- time = numberFormat.parse( timeAsString );
- }
-
- testCase.setTime( time.floatValue() );
-
- if ( currentSuite != defaultSuite )
- {
- currentSuite.setTimeElapsed( time.floatValue() + currentSuite.getTimeElapsed() );
- }
- }
- else if ( "failure".equals( qName ) )
- {
- testCase.addFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
- currentSuite.setNumberOfFailures( 1 + currentSuite.getNumberOfFailures() );
- }
- else if ( "error".equals( qName ) )
- {
- testCase.addFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
- currentSuite.setNumberOfErrors( 1 + currentSuite.getNumberOfErrors() );
- }
- else if ( "skipped".equals( qName ) )
- {
- final String message = attributes.getValue( "message" );
- testCase.addFailure( message != null ? message : "skipped", "skipped" );
- currentSuite.setNumberOfSkipped( 1 + currentSuite.getNumberOfSkipped() );
- }
- }
- catch ( ParseException e )
- {
- throw new SAXException( e.getMessage(), e );
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void endElement( String uri, String localName, String qName )
- throws SAXException
- {
- if ( "testcase".equals( qName ) )
- {
- currentSuite.getTestCases().add( testCase );
- }
- else if ( "failure".equals( qName ) )
- {
- Map failure = testCase.getFailure();
-
- failure.put( "detail", parseCause( currentElement.toString() ) );
- }
- else if ( "error".equals( qName ) )
- {
- Map error = testCase.getFailure();
-
- error.put( "detail", parseCause( currentElement.toString() ) );
- }
- else if ( "time".equals( qName ) )
- {
- try
- {
- Number time = numberFormat.parse( currentElement.toString() );
- defaultSuite.setTimeElapsed( time.floatValue() );
- }
- catch ( ParseException e )
- {
- throw new SAXException( e.getMessage(), e );
- }
- }
- // TODO extract real skipped reasons
- }
-
- /**
- * {@inheritDoc}
- */
- public void characters( char[] ch, int start, int length )
- throws SAXException
- {
- String s = new String( ch, start, length );
-
- if ( !"".equals( s.trim() ) )
- {
- currentElement.append( s );
- }
- }
-
- private List parseCause( String detail )
- {
- String fullName = testCase.getFullName();
- String name = fullName.substring( fullName.lastIndexOf( "." ) + 1 );
- return parseCause( detail, name );
- }
-
- private List parseCause( String detail, String compareTo )
- {
- StringTokenizer stringTokenizer = new StringTokenizer( detail, "\n" );
- List parsedDetail = new ArrayList( stringTokenizer.countTokens() );
-
- while ( stringTokenizer.hasMoreTokens() )
- {
- String lineString = stringTokenizer.nextToken().trim();
- parsedDetail.add( lineString );
- if ( lineString.indexOf( compareTo ) >= 0 )
- {
- break;
- }
- }
-
- return parsedDetail;
- }
-
-}
+package org.apache.maven.plugins.surefire.report;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ *
+ */
+public class TestSuiteXmlParser
+ extends DefaultHandler
+{
+ private ReportTestSuite defaultSuite;
+
+ private ReportTestSuite currentSuite;
+
+ private Map<String, ReportTestSuite> classesToSuites;
+
+ private final NumberFormat numberFormat = NumberFormat.getInstance( Locale.ENGLISH );
+
+ /**
+ * @noinspection StringBufferField
+ */
+ private StringBuffer currentElement;
+
+ private ReportTestCase testCase;
+
+ public Collection<ReportTestSuite> parse( String xmlPath )
+ throws ParserConfigurationException, SAXException, IOException
+ {
+
+ File f = new File(xmlPath);
+
+ FileInputStream fileInputStream = new FileInputStream(f);
+
+ try {
+ return parse(fileInputStream);
+ } finally
+ {
+ fileInputStream.close();
+ }
+ }
+
+ public Collection<ReportTestSuite> parse( InputStream stream )
+ throws ParserConfigurationException, SAXException, IOException
+ {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+
+ SAXParser saxParser = factory.newSAXParser();
+
+ classesToSuites = new HashMap<String, ReportTestSuite>();
+
+ saxParser.parse( stream, this );
+
+ if ( currentSuite != defaultSuite )
+ { // omit the defaultSuite if it's empty and there are alternatives
+ if ( defaultSuite.getNumberOfTests() == 0 )
+ {
+ classesToSuites.remove( defaultSuite.getFullClassName() );
+ }
+ }
+
+ return classesToSuites.values();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void startElement( String uri, String localName, String qName, Attributes attributes )
+ throws SAXException
+ {
+ try
+ {
+ if ( "testsuite".equals( qName ) )
+ {
+ currentSuite = defaultSuite = new ReportTestSuite();
+
+ try
+ {
+ Number time = numberFormat.parse( attributes.getValue( "time" ) );
+
+ defaultSuite.setTimeElapsed( time.floatValue() );
+ }
+ catch ( NullPointerException npe )
+ {
+ System.err.println( "WARNING: no time attribute found on testsuite element" );
+ }
+
+ //check if group attribute is existing
+ if ( attributes.getValue( "group" ) != null && !"".equals( attributes.getValue( "group" ) ) )
+ {
+ String packageName = attributes.getValue( "group" );
+ String name = attributes.getValue( "name" );
+
+ defaultSuite.setFullClassName( packageName + "." + name );
+ }
+ else
+ {
+ String fullClassName = attributes.getValue( "name" );
+ defaultSuite.setFullClassName( fullClassName );
+ }
+
+ classesToSuites.put( defaultSuite.getFullClassName(), defaultSuite );
+ }
+ else if ( "testcase".equals( qName ) )
+ {
+ currentElement = new StringBuffer();
+
+ testCase = new ReportTestCase();
+
+ testCase.setName( attributes.getValue( "name" ) );
+
+ String fullClassName = attributes.getValue( "classname" );
+
+ // if the testcase declares its own classname, it may need to belong to its own suite
+ if ( fullClassName != null )
+ {
+ currentSuite = (ReportTestSuite) classesToSuites.get( fullClassName );
+ if ( currentSuite == null )
+ {
+ currentSuite = new ReportTestSuite();
+ currentSuite.setFullClassName( fullClassName );
+ classesToSuites.put( fullClassName, currentSuite );
+ }
+ }
+
+ testCase.setFullClassName( currentSuite.getFullClassName() );
+ testCase.setClassName( currentSuite.getName() );
+ testCase.setFullName( currentSuite.getFullClassName() + "." + testCase.getName() );
+
+ String timeAsString = attributes.getValue( "time" );
+
+ Number time = new Integer( 0 );
+
+ if ( timeAsString != null )
+ {
+ time = numberFormat.parse( timeAsString );
+ }
+
+ testCase.setTime( time.floatValue() );
+
+ if ( currentSuite != defaultSuite )
+ {
+ currentSuite.setTimeElapsed( time.floatValue() + currentSuite.getTimeElapsed() );
+ }
+ }
+ else if ( "failure".equals( qName ) )
+ {
+ testCase.addFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
+ currentSuite.setNumberOfFailures( 1 + currentSuite.getNumberOfFailures() );
+ }
+ else if ( "error".equals( qName ) )
+ {
+ testCase.addFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
+ currentSuite.setNumberOfErrors( 1 + currentSuite.getNumberOfErrors() );
+ }
+ else if ( "skipped".equals( qName ) )
+ {
+ final String message = attributes.getValue( "message" );
+ testCase.addFailure( message != null ? message : "skipped", "skipped" );
+ currentSuite.setNumberOfSkipped( 1 + currentSuite.getNumberOfSkipped() );
+ }
+ }
+ catch ( ParseException e )
+ {
+ throw new SAXException( e.getMessage(), e );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void endElement( String uri, String localName, String qName )
+ throws SAXException
+ {
+ if ( "testcase".equals( qName ) )
+ {
+ currentSuite.getTestCases().add( testCase );
+ }
+ else if ( "failure".equals( qName ) )
+ {
+ Map failure = testCase.getFailure();
+
+ failure.put( "detail", parseCause( currentElement.toString() ) );
+ }
+ else if ( "error".equals( qName ) )
+ {
+ Map error = testCase.getFailure();
+
+ error.put( "detail", parseCause( currentElement.toString() ) );
+ }
+ else if ( "time".equals( qName ) )
+ {
+ try
+ {
+ Number time = numberFormat.parse( currentElement.toString() );
+ defaultSuite.setTimeElapsed( time.floatValue() );
+ }
+ catch ( ParseException e )
+ {
+ throw new SAXException( e.getMessage(), e );
+ }
+ }
+ // TODO extract real skipped reasons
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void characters( char[] ch, int start, int length )
+ throws SAXException
+ {
+ String s = new String( ch, start, length );
+
+ if ( !"".equals( s.trim() ) )
+ {
+ currentElement.append( s );
+ }
+ }
+
+ private List parseCause( String detail )
+ {
+ String fullName = testCase.getFullName();
+ String name = fullName.substring( fullName.lastIndexOf( "." ) + 1 );
+ return parseCause( detail, name );
+ }
+
+ private List parseCause( String detail, String compareTo )
+ {
+ StringTokenizer stringTokenizer = new StringTokenizer( detail, "\n" );
+ List parsedDetail = new ArrayList( stringTokenizer.countTokens() );
+
+ while ( stringTokenizer.hasMoreTokens() )
+ {
+ String lineString = stringTokenizer.nextToken().trim();
+ parsedDetail.add( lineString );
+ if ( lineString.indexOf( compareTo ) >= 0 )
+ {
+ break;
+ }
+ }
+
+ return parsedDetail;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
index 7186a82..a4fca7f 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
@@ -32,8 +32,8 @@ import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.WriterFactory;
+import org.apache.maven.shared.utils.WriterFactory;
+import org.apache.maven.shared.utils.io.IOUtil;
/**
* @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
----------------------------------------------------------------------
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
new file mode 100644
index 0000000..b009570
--- /dev/null
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParserTest.java
@@ -0,0 +1,49 @@
+package org.apache.maven.plugins.surefire.report;
+
+import junit.framework.TestCase;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collection;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class TestSuiteXmlParserTest extends TestCase {
+ public void testParse() throws Exception {
+ TestSuiteXmlParser testSuiteXmlParser = new TestSuiteXmlParser();
+ String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
+ "<testsuite failures=\"4\" time=\"0.005\" errors=\"0\" skipped=\"0\" tests=\"4\" name=\"wellFormedXmlFailures.TestSurefire3\">\n" +
+ " <properties>\n" +
+ " <property name=\"java.runtime.name\" value=\"Java(TM) SE Runtime Environment\"/>\n" +
+ " <property name=\"sun.cpu.isalist\" value=\"amd64\"/>\n" +
+ " </properties>\n" +
+ " <testcase time=\"0.005\" classname=\"wellFormedXmlFailures.TestSurefire3\" name=\"testLower\">\n" +
+ " <failure message=\"<\" type=\"junit.framework.AssertionFailedError\"><![CDATA[junit.framework.AssertionFailedError: <\n" +
+ "\tat junit.framework.Assert.fail(Assert.java:47)\n" +
+ "\tat wellFormedXmlFailures.TestSurefire3.testLower(TestSurefire3.java:30)\n" +
+ "]]></failure>\n" +
+ " </testcase>\n" +
+ " <testcase time=\"0\" classname=\"wellFormedXmlFailures.TestSurefire3\" name=\"testU0000\">\n" +
+ " <failure message=\"&0#;\" type=\"junit.framework.AssertionFailedError\">junit.framework.AssertionFailedError: \n" +
+ "\tat junit.framework.Assert.fail(Assert.java:47)\n" +
+ "\tat wellFormedXmlFailures.TestSurefire3.testU0000(TestSurefire3.java:40)\n" +
+ "</failure>\n" +
+ " </testcase>\n" +
+ " <testcase time=\"0\" classname=\"wellFormedXmlFailures.TestSurefire3\" name=\"testGreater\">\n" +
+ " <failure message=\">\" type=\"junit.framework.AssertionFailedError\">junit.framework.AssertionFailedError: >\n" +
+ "\tat junit.framework.Assert.fail(Assert.java:47)\n" +
+ "\tat wellFormedXmlFailures.TestSurefire3.testGreater(TestSurefire3.java:35)\n" +
+ "</failure>\n" +
+ " </testcase>\n" +
+ " <testcase time=\"0\" classname=\"wellFormedXmlFailures.TestSurefire3\" name=\"testQuote\">\n" +
+ " <failure message=\""\" type=\"junit.framework.AssertionFailedError\">junit.framework.AssertionFailedError: \"\n" +
+ "\tat junit.framework.Assert.fail(Assert.java:47)\n" +
+ "\tat wellFormedXmlFailures.TestSurefire3.testQuote(TestSurefire3.java:25)\n" +
+ "</failure>\n" +
+ " </testcase>\n" +
+ "</testsuite>";
+ InputStream byteArrayIs = new ByteArrayInputStream(xml.getBytes());
+ Collection<ReportTestSuite> parse = testSuiteXmlParser.parse(byteArrayIs);
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c46762e..4c846ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,6 +219,11 @@
<version>3.0.8</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <version>0.1</version>
+ </dependency>
+ <dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.0.1</version>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-api/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
index b2f2b7e..caa5880 100644
--- a/surefire-api/pom.xml
+++ b/surefire-api/pom.xml
@@ -17,7 +17,8 @@
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -33,8 +34,8 @@
<dependencies>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
</dependency>
</dependencies>
@@ -71,6 +72,7 @@
<artifactSet>
<includes>
<include>org.codehaus.plexus:plexus-utils</include>
+ <include>org.apache.maven.shared:maven-shared-utils</include>
<include>commons-lang:commons-lang</include>
</includes>
</artifactSet>
@@ -80,6 +82,10 @@
<shadedPattern>org.apache.maven.surefire.shade.org.codehaus.plexus.util</shadedPattern>
</relocation>
<relocation>
+ <pattern>org.apache.maven.shared</pattern>
+ <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
+ </relocation>
+ <relocation>
<pattern>org.apache.commons.lang</pattern>
<shadedPattern>org.apache.maven.surefire.shade.org.apache.commons.lang</shadedPattern>
</relocation>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
index 715bc8d..659c7e4 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/SpecificTestClassFilter.java
@@ -22,7 +22,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.maven.surefire.util.ScannerFilter;
-import org.codehaus.plexus.util.SelectorUtils;
+import org.apache.maven.shared.utils.io.SelectorUtils;
public class SpecificTestClassFilter
implements ScannerFilter
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
index e6f7527..1dee53b 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/util/DefaultDirectoryScanner.java
@@ -113,7 +113,7 @@ public class DefaultDirectoryScanner
String[] tests = EMPTY_STRING_ARRAY;
if ( basedir.exists() )
{
- org.codehaus.plexus.util.DirectoryScanner scanner = new org.codehaus.plexus.util.DirectoryScanner();
+ org.apache.maven.shared.utils.io.DirectoryScanner scanner = new org.apache.maven.shared.utils.io.DirectoryScanner();
scanner.setBasedir( basedir );
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/pom.xml b/surefire-integration-tests/pom.xml
index a4de8ec..aafad67 100644
--- a/surefire-integration-tests/pom.xml
+++ b/surefire-integration-tests/pom.xml
@@ -74,7 +74,10 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireReportParser.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireReportParser.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireReportParser.java
index 430e4bd..d841b46 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireReportParser.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireReportParser.java
@@ -24,8 +24,8 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.io.DirectoryScanner;
import javax.xml.parsers.ParserConfigurationException;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/common-junit4/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit4/pom.xml b/surefire-providers/common-junit4/pom.xml
index 76674c6..471d088 100644
--- a/surefire-providers/common-junit4/pom.xml
+++ b/surefire-providers/common-junit4/pom.xml
@@ -17,7 +17,8 @@
~ under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -43,5 +44,9 @@
<artifactId>common-junit3</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/common-junit48/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/common-junit48/pom.xml b/surefire-providers/common-junit48/pom.xml
index 5fdea22..a9de567 100644
--- a/surefire-providers/common-junit48/pom.xml
+++ b/surefire-providers/common-junit48/pom.xml
@@ -44,13 +44,13 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-grouper</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java
----------------------------------------------------------------------
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 0ff9b2f..ed770f6 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
@@ -27,13 +27,13 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import org.apache.maven.shared.utils.io.SelectorUtils;
import org.apache.maven.surefire.booter.ProviderParameterNames;
import org.apache.maven.surefire.group.match.AndGroupMatcher;
import org.apache.maven.surefire.group.match.GroupMatcher;
import org.apache.maven.surefire.group.match.InverseGroupMatcher;
import org.apache.maven.surefire.group.parse.GroupMatcherParser;
import org.apache.maven.surefire.group.parse.ParseException;
-import org.codehaus.plexus.util.SelectorUtils;
import org.junit.experimental.categories.Category;
import org.junit.runner.Description;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/surefire-junit4/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit4/pom.xml b/surefire-providers/surefire-junit4/pom.xml
index b90fe3e..e97bbcc 100644
--- a/surefire-providers/surefire-junit4/pom.xml
+++ b/surefire-providers/surefire-junit4/pom.xml
@@ -43,10 +43,6 @@
<artifactId>common-junit4</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
</dependencies>
<build>
@@ -80,13 +76,13 @@
<includes>
<include>org.apache.maven.surefire:common-junit3</include>
<include>org.apache.maven.surefire:common-junit4</include>
- <include>org.codehaus.plexus:plexus-utils</include>
+ <include>org.apache.maven.shared:maven-shared-utils</include>
</includes>
</artifactSet>
<relocations>
<relocation>
- <pattern>org.codehaus.plexus.util</pattern>
- <shadedPattern>org.apache.maven.surefire.shade.org.codehaus.plexus.util</shadedPattern>
+ <pattern>org.apache.maven.shared</pattern>
+ <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
</relocation>
</relocations>
</configuration>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
index 3b3748b..28f127f 100644
--- a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
+++ b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
@@ -22,6 +22,7 @@ package org.apache.maven.surefire.junit4;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
+import org.apache.maven.shared.utils.io.SelectorUtils;
import org.apache.maven.surefire.common.junit4.JUnit4RunListener;
import org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory;
import org.apache.maven.surefire.common.junit4.JUnit4TestChecker;
@@ -41,7 +42,6 @@ import org.apache.maven.surefire.util.RunOrderCalculator;
import org.apache.maven.surefire.util.ScanResult;
import org.apache.maven.surefire.util.TestsToRun;
import org.apache.maven.surefire.util.internal.StringUtils;
-import org.codehaus.plexus.util.SelectorUtils;
import org.junit.runner.Request;
import org.junit.runner.Result;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/surefire-testng-utils/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/pom.xml b/surefire-providers/surefire-testng-utils/pom.xml
index ff8df0a..d874c00 100644
--- a/surefire-providers/surefire-testng-utils/pom.xml
+++ b/surefire-providers/surefire-testng-utils/pom.xml
@@ -38,10 +38,10 @@
<version>3.8.2</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-grouper</artifactId>
@@ -63,13 +63,13 @@
<minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
- <include>org.codehaus.plexus:plexus-utils</include>
+ <include>org.apache.maven.shared:maven-shared-utils</include>
</includes>
</artifactSet>
<relocations>
<relocation>
- <pattern>org.codehaus.plexus.util</pattern>
- <shadedPattern>org.apache.maven.surefire.shade.org.codehaus.plexus.util</shadedPattern>
+ <pattern>org.apache.maven.shared</pattern>
+ <shadedPattern>org.apache.maven.surefire.shade.org.apache.maven.shared</shadedPattern>
</relocation>
</relocations>
</configuration>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
index 5123cf2..3c06bca 100644
--- a/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
+++ b/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utils/MethodSelector.java
@@ -20,7 +20,7 @@ package org.apache.maven.surefire.testng.utils;
*/
import java.util.List;
-import org.codehaus.plexus.util.SelectorUtils;
+import org.apache.maven.shared.utils.io.SelectorUtils;
import org.testng.IMethodSelector;
import org.testng.IMethodSelectorContext;
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-setup-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-setup-integration-tests/pom.xml b/surefire-setup-integration-tests/pom.xml
index f9b422c..8b5789b 100644
--- a/surefire-setup-integration-tests/pom.xml
+++ b/surefire-setup-integration-tests/pom.xml
@@ -99,11 +99,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.8</version>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
----------------------------------------------------------------------
diff --git a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java b/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
index 33fc902..58ce57d 100644
--- a/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
+++ b/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/its/StagedLocalRepoHelper.java
@@ -30,8 +30,8 @@ import org.apache.maven.settings.RepositoryPolicy;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer;
-import org.codehaus.plexus.util.ReaderFactory;
-import org.codehaus.plexus.util.WriterFactory;
+import org.apache.maven.shared.utils.ReaderFactory;
+import org.apache.maven.shared.utils.WriterFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/a796ecc5/surefire-shadefire/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml
index 8d651c8..4482bbd 100644
--- a/surefire-shadefire/pom.xml
+++ b/surefire-shadefire/pom.xml
@@ -44,10 +44,6 @@
<dependencies>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit3</artifactId>
<version>${shadedVersion}</version>
@@ -83,15 +79,10 @@
<include>org.apache.maven.surefire:surefire-api</include>
<include>org.apache.maven.surefire:surefire-booter</include>
<include>org.apache.maven.surefire:surefire-junit3</include>
- <include>org.codehaus.plexus:plexus-utils</include>
</includes>
</artifactSet>
<relocations>
<relocation>
- <pattern>org.codehaus.plexus.util</pattern>
- <shadedPattern>org.apache.maven.shadefire.org.codehaus.plexus.util</shadedPattern>
- </relocation>
- <relocation>
<pattern>org.apache.maven.surefire</pattern>
<shadedPattern>org.apache.maven.surefire.shadefire</shadedPattern>
</relocation>