\n"
+ "\n"
- + " | \n"
+ + " | \n"
+ "test |
\n"
+ "\n"
- + "- | \n"
+ + "- | \n"
+ "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: msg |
\n"
+ "\n"
- + "- | \n"
+ + "- | \n"
+ "\n"
+ " surefire.MyTest:13 |
")));
}
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportTest.java
index 3da193a92d..df12fbedca 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportTest.java
@@ -19,16 +19,19 @@
package org.apache.maven.plugins.surefire.report;
import java.io.File;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.util.Locale;
+import java.util.Collections;
+import java.util.List;
+import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.LegacySupport;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.ArtifactStubFactory;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.plugins.surefire.report.stubs.DependencyArtifactStubFactory;
+import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.io.FileUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
@@ -45,28 +48,20 @@
public class SurefireReportTest extends AbstractMojoTestCase {
private ArtifactStubFactory artifactStubFactory;
- // Can be removed with Doxia 2.0.0
- private Locale origLocale;
-
@Override
protected void setUp() throws Exception {
super.setUp();
artifactStubFactory = new DependencyArtifactStubFactory(getTestFile("target"), true, false);
artifactStubFactory.getWorkingDir().mkdirs();
-
- origLocale = Locale.getDefault();
- Locale.setDefault(Locale.ROOT);
}
- @Override
- protected void tearDown() throws Exception {
- Locale.setDefault(origLocale);
- super.tearDown();
+ protected File getPluginXmlFile(String projectDirName) {
+ return new File(getBasedir(), "src/test/resources/unit/" + projectDirName + "/plugin-config.xml");
}
protected SurefireReport createReportMojo(File pluginXmlFile) throws Exception {
SurefireReport mojo = (SurefireReport) lookupMojo("report", pluginXmlFile);
- assertNotNull("Mojo found.", mojo);
+ assertNotNull("Mojo not found.", mojo);
LegacySupport legacySupport = lookup(LegacySupport.class);
legacySupport.setSession(newMavenSession(new MavenProjectStub()));
@@ -75,13 +70,22 @@ protected SurefireReport createReportMojo(File pluginXmlFile) throws Exception {
repoSession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(repoSession, new LocalRepository(artifactStubFactory.getWorkingDir())));
- // setVariableValueToObject( mojo, "session", legacySupport.getSession() );
- setVariableValueToObject(mojo, "remoteRepositories", mojo.getProject().getRemoteArtifactRepositories());
+ List