You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2016/01/17 23:11:56 UTC

[1/4] maven-surefire git commit: [SUREFIRE] AtomicInteger instead of volatile number with pre/post increment

Repository: maven-surefire
Updated Branches:
  refs/heads/3.0-rc1 f5b6a7bdf -> faed057e8


[SUREFIRE] AtomicInteger instead of volatile number with pre/post increment


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/cfb6177f
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/cfb6177f
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/cfb6177f

Branch: refs/heads/3.0-rc1
Commit: cfb6177f5279038f422fd8ea8569f01b35848a66
Parents: c43ff3e
Author: Tibor17 <ti...@lycos.com>
Authored: Fri Jan 15 16:36:20 2016 +0100
Committer: Tibor17 <ti...@lycos.com>
Committed: Fri Jan 15 16:36:20 2016 +0100

----------------------------------------------------------------------
 .../plugin/surefire/report/StatelessXmlReporterTest.java      | 6 +++---
 .../apache/maven/surefire/booter/ForkingReporterFactory.java  | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cfb6177f/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
----------------------------------------------------------------------
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 09fa1d1..e82515e 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
@@ -37,6 +37,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
 
 @SuppressWarnings( "ResultOfMethodCallIgnored" )
 public class StatelessXmlReporterTest
@@ -53,8 +54,7 @@ public class StatelessXmlReporterTest
     private final static String TEST_ONE = "aTestMethod";
     private final static String TEST_TWO = "bTestMethod";
     private final static String TEST_THREE = "cTestMethod";
-
-    private static volatile int folderPostfix;
+    private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger();
 
     @Override
     protected void setUp()
@@ -66,7 +66,7 @@ public class StatelessXmlReporterTest
         File basedir = new File( "." );
         File target = new File( basedir.getCanonicalFile(), "target" );
         target.mkdir();
-        String reportRelDir = getClass().getSimpleName() + "-" + ++folderPostfix;
+        String reportRelDir = getClass().getSimpleName() + "-" + FOLDER_POSTFIX.incrementAndGet();
         reportDir = new File( target, reportRelDir );
         reportDir.mkdir();
     }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cfb6177f/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
index 8108609..def345d 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingReporterFactory.java
@@ -20,6 +20,8 @@ package org.apache.maven.surefire.booter;
  */
 
 import java.io.PrintStream;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.maven.surefire.report.ReporterFactory;
 import org.apache.maven.surefire.report.RunListener;
 import org.apache.maven.surefire.suite.RunResult;
@@ -35,12 +37,11 @@ import org.apache.maven.surefire.suite.RunResult;
 public class ForkingReporterFactory
     implements ReporterFactory
 {
-
     private final boolean isTrimstackTrace;
 
     private final PrintStream originalSystemOut;
 
-    private volatile int testSetChannelId = 1;
+    private final AtomicInteger testSetChannelId = new AtomicInteger( 1 );
 
     public ForkingReporterFactory( boolean trimstackTrace, PrintStream originalSystemOut )
     {
@@ -50,7 +51,7 @@ public class ForkingReporterFactory
 
     public RunListener createReporter()
     {
-        return new ForkingRunListener( originalSystemOut, testSetChannelId++, isTrimstackTrace );
+        return new ForkingRunListener( originalSystemOut, testSetChannelId.getAndIncrement(), isTrimstackTrace );
     }
 
     public RunResult close()


[3/4] maven-surefire git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/maven-surefire into 3.0-rc1

Posted by ti...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/maven-surefire into 3.0-rc1


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/455a55b9
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/455a55b9
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/455a55b9

Branch: refs/heads/3.0-rc1
Commit: 455a55b9a4b0d1a3abec4c04b345bb7ebbbf0b15
Parents: f5b6a7b 71b0014
Author: Tibor17 <ti...@lycos.com>
Authored: Sun Jan 17 22:41:28 2016 +0100
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun Jan 17 22:41:28 2016 +0100

----------------------------------------------------------------------
 maven-failsafe-plugin/pom.xml                   | 20 ++++++++++++
 .../plugin/failsafe/IntegrationTestMojo.java    |  6 ++++
 .../plugin/surefire/AbstractSurefireMojo.java   |  5 ++-
 .../maven/plugin/surefire/CommonReflector.java  |  8 ++---
 .../surefire/StartupReportConfiguration.java    | 34 ++++++++++++++------
 .../surefire/report/DefaultReporterFactory.java |  8 +++--
 .../surefire/report/StatelessXmlReporter.java   | 19 +++++------
 .../report/DefaultReporterFactoryTest.java      |  2 +-
 .../report/StatelessXmlReporterTest.java        | 30 ++++++++---------
 .../maven/plugin/surefire/SurefirePlugin.java   |  6 ++++
 maven-surefire-plugin/src/site/apt/index.apt.vm |  3 +-
 .../surefire/booter/ForkingReporterFactory.java |  7 ++--
 12 files changed, 100 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/455a55b9/maven-failsafe-plugin/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/455a55b9/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------


[4/4] maven-surefire git commit: [SUREFIRE] preparation for 3.0

Posted by ti...@apache.org.
[SUREFIRE] preparation for 3.0


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/faed057e
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/faed057e
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/faed057e

Branch: refs/heads/3.0-rc1
Commit: faed057e82347ce1a1c5f559cabaff402a2f0287
Parents: 455a55b
Author: Tibor17 <ti...@lycos.com>
Authored: Sun Jan 17 23:11:41 2016 +0100
Committer: Tibor17 <ti...@lycos.com>
Committed: Sun Jan 17 23:11:41 2016 +0100

----------------------------------------------------------------------
 .../apache/maven/plugin/surefire/SurefireDependencyResolver.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/faed057e/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
----------------------------------------------------------------------
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 bd32478..cdaf634 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
@@ -118,7 +118,8 @@ public class SurefireDependencyResolver
         ArtifactResolutionRequest request = new ArtifactResolutionRequest()
                                                     .setArtifact( providerArtifact )
                                                     .setRemoteRepositories( remoteRepositories )
-                                                    .setLocalRepository( localRepository );
+                                                    .setLocalRepository( localRepository )
+                                                    .setResolveTransitively( true );
         if ( excludeArtifact != null )
         {
             String pattern = excludeArtifact.getGroupId() + ":" + excludeArtifact.getArtifactId();


[2/4] maven-surefire git commit: [SUREFIRE-1217] Differentiate XML schema for failsafe and surefire

Posted by ti...@apache.org.
[SUREFIRE-1217] Differentiate XML schema for failsafe and surefire


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/71b00149
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/71b00149
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/71b00149

Branch: refs/heads/3.0-rc1
Commit: 71b00149392475a43bef2f0e618e3f5b5a64cdaa
Parents: cfb6177
Author: Tibor17 <ti...@lycos.com>
Authored: Sat Jan 16 09:55:44 2016 +0100
Committer: Tibor17 <ti...@lycos.com>
Committed: Sat Jan 16 09:55:44 2016 +0100

----------------------------------------------------------------------
 maven-failsafe-plugin/pom.xml                   | 20 ++++++++++++
 .../plugin/failsafe/IntegrationTestMojo.java    |  6 ++++
 .../plugin/surefire/AbstractSurefireMojo.java   |  5 ++-
 .../maven/plugin/surefire/CommonReflector.java  |  8 ++---
 .../surefire/StartupReportConfiguration.java    | 34 ++++++++++++++------
 .../surefire/report/DefaultReporterFactory.java |  8 +++--
 .../surefire/report/StatelessXmlReporter.java   | 19 +++++------
 .../report/DefaultReporterFactoryTest.java      |  2 +-
 .../report/StatelessXmlReporterTest.java        | 26 +++++++--------
 .../maven/plugin/surefire/SurefirePlugin.java   |  6 ++++
 maven-surefire-plugin/src/site/apt/index.apt.vm |  3 +-
 11 files changed, 94 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-failsafe-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index 8c56890..06c8e95 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -174,6 +174,26 @@
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>generate-test-report</id>
+            <phase>pre-site</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target name="generate-failsafe-test-report">
+                <move file="${project.build.directory}/source-site/resources/xsd/surefire-test-report.xsd"
+                      tofile="${project.build.directory}/source-site/resources/xsd/failsafe-test-report.xsd"/>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-site-plugin</artifactId>
         <configuration>
           <siteDirectory>${project.build.directory}/source-site</siteDirectory>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/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 fd744fe..bf50fec 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
@@ -390,6 +390,12 @@ public class IntegrationTestMojo
         return new String[]{ "**/IT*.java", "**/*IT.java", "**/*ITCase.java" };
     }
 
+    @Override
+    protected String getReportSchemaLocation()
+    {
+        return "https://maven.apache.org/surefire/maven-failsafe-plugin/xsd/failsafe-test-report.xsd";
+    }
+
     public boolean isSkipTests()
     {
         return skipTests;

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/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 111c9c5..eaa01a8 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
@@ -720,6 +720,8 @@ public abstract class AbstractSurefireMojo
 
     protected abstract String[] getDefaultIncludes();
 
+    protected abstract String getReportSchemaLocation();
+
     private String getDefaultExcludes()
     {
         return "**/*$*";
@@ -1599,7 +1601,8 @@ public abstract class AbstractSurefireMojo
         return new StartupReportConfiguration( isUseFile(), isPrintSummary(), getReportFormat(),
                                                isRedirectTestOutputToFile(), isDisableXmlReport(),
                                                getReportsDirectory(), isTrimStackTrace(), getReportNameSuffix(),
-                                               configChecksum, requiresRunHistory(), getRerunFailingTestsCount() );
+                                               configChecksum, requiresRunHistory(), getRerunFailingTestsCount(),
+                                               getReportSchemaLocation() );
     }
 
     private boolean isSpecificTestSpecified()

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java
index a8be45b..06ec9a5 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java
@@ -59,21 +59,21 @@ public class CommonReflector
                                                   surefireClassLoader );
     }
 
-
-    Object createStartupReportConfiguration( @Nonnull StartupReportConfiguration reporterConfiguration )
+    private Object createStartupReportConfiguration( @Nonnull StartupReportConfiguration reporterConfiguration )
     {
         Constructor<?> constructor = ReflectionUtils.getConstructor( startupReportConfiguration,
                                                                      boolean.class, boolean.class,
                                                                      String.class, boolean.class, boolean.class,
                                                                      File.class, boolean.class, String.class,
-                                                                     String.class, boolean.class, int.class );
+                                                                     String.class, boolean.class, int.class,
+                                                                     String.class );
         //noinspection BooleanConstructorCall
         Object[] params = { reporterConfiguration.isUseFile(), reporterConfiguration.isPrintSummary(),
             reporterConfiguration.getReportFormat(), reporterConfiguration.isRedirectTestOutputToFile(),
             reporterConfiguration.isDisableXmlReport(), reporterConfiguration.getReportsDirectory(),
             reporterConfiguration.isTrimStackTrace(), reporterConfiguration.getReportNameSuffix(),
             reporterConfiguration.getConfigurationHash(), reporterConfiguration.isRequiresRunHistory(),
-            reporterConfiguration.getRerunFailingTestsCount() };
+            reporterConfiguration.getRerunFailingTestsCount(), reporterConfiguration.getXsdSchemaLocation() };
         return ReflectionUtils.newInstance( constructor, params );
     }
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
index 5717f70..f45b303 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java
@@ -45,6 +45,10 @@ import javax.annotation.Nonnull;
  */
 public class StartupReportConfiguration
 {
+    public static final String BRIEF_REPORT_FORMAT = ConsoleReporter.BRIEF;
+
+    public static final String PLAIN_REPORT_FORMAT = ConsoleReporter.PLAIN;
+
     private final PrintStream originalSystemOut;
 
     private final PrintStream originalSystemErr;
@@ -71,13 +75,11 @@ public class StartupReportConfiguration
 
     private final int rerunFailingTestsCount;
 
-    private final Properties testVmSystemProperties = new Properties();
-
-    public static final String BRIEF_REPORT_FORMAT = ConsoleReporter.BRIEF;
+    private String xsdSchemaLocation;
 
-    public static final String PLAIN_REPORT_FORMAT = ConsoleReporter.PLAIN;
+    private final Properties testVmSystemProperties = new Properties();
 
-    private final Map<String, Map<String, List<WrappedReportEntry>>> testClassMethodRunHistoryMap
+    private final Map<String, Map<String, List<WrappedReportEntry>>> testClassMethodRunHistory
         = new ConcurrentHashMap<String, Map<String, List<WrappedReportEntry>>>();
 
     @SuppressWarnings( "checkstyle:parameternumber" )
@@ -85,7 +87,7 @@ public class StartupReportConfiguration
                                        boolean redirectTestOutputToFile, boolean disableXmlReport,
                                        @Nonnull File reportsDirectory, boolean trimStackTrace, String reportNameSuffix,
                                        String configurationHash, boolean requiresRunHistory,
-                                       int rerunFailingTestsCount )
+                                       int rerunFailingTestsCount, String xsdSchemaLocation )
     {
         this.useFile = useFile;
         this.printSummary = printSummary;
@@ -100,20 +102,27 @@ public class StartupReportConfiguration
         this.originalSystemOut = System.out;
         this.originalSystemErr = System.err;
         this.rerunFailingTestsCount = rerunFailingTestsCount;
+        this.xsdSchemaLocation = xsdSchemaLocation;
     }
 
+    /**
+     * For testing purposes only.
+     */
     public static StartupReportConfiguration defaultValue()
     {
         File target = new File( "./target" );
         return new StartupReportConfiguration( true, true, "PLAIN", false, false, target, false, null, "TESTHASH",
-                                               false, 0 );
+                                               false, 0, null );
     }
 
+    /**
+     * For testing purposes only.
+     */
     public static StartupReportConfiguration defaultNoXml()
     {
         File target = new File( "./target" );
         return new StartupReportConfiguration( true, true, "PLAIN", false, true, target, false, null, "TESTHASHxXML",
-                                               false, 0 );
+                                               false, 0, null );
     }
 
     public boolean isUseFile()
@@ -160,8 +169,8 @@ public class StartupReportConfiguration
     {
         return isDisableXmlReport()
             ? null
-            : new StatelessXmlReporter( reportsDirectory, reportNameSuffix, trimStackTrace,
-                                        rerunFailingTestsCount, testClassMethodRunHistoryMap );
+            : new StatelessXmlReporter( reportsDirectory, reportNameSuffix, trimStackTrace, rerunFailingTestsCount,
+                                        testClassMethodRunHistory, xsdSchemaLocation );
     }
 
     public FileReporter instantiateFileReporter()
@@ -228,4 +237,9 @@ public class StartupReportConfiguration
     {
         return originalSystemOut;
     }
+
+    public String getXsdSchemaLocation()
+    {
+        return xsdSchemaLocation;
+    }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java
----------------------------------------------------------------------
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
index 13bcc96..dbb78d7 100644
--- 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
@@ -36,6 +36,8 @@ import java.util.Map;
 import java.util.TreeMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
+import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN;
+
 /**
  * Provides reporting modules on the plugin side.
  * <p/>
@@ -46,7 +48,6 @@ import java.util.concurrent.ConcurrentLinkedQueue;
 public class DefaultReporterFactory
     implements ReporterFactory
 {
-
     private RunStatistics globalStats = new RunStatistics();
 
     private final StartupReportConfiguration reportConfiguration;
@@ -78,7 +79,7 @@ public class DefaultReporterFactory
                                     reportConfiguration.instantiateStatelessXmlReporter(),
                                     reportConfiguration.instantiateConsoleOutputFileReporter(), statisticsReporter,
                                     reportConfiguration.isTrimStackTrace(),
-                                    ConsoleReporter.PLAIN.equals( reportConfiguration.getReportFormat() ),
+                                    PLAIN.equals( reportConfiguration.getReportFormat() ),
                                     reportConfiguration.isBriefOrPlainFormat() );
         addListener( testSetRunListener );
         return testSetRunListener;
@@ -151,6 +152,9 @@ public class DefaultReporterFactory
         return globalStats;
     }
 
+    /**
+     * For testing purposes only.
+     */
     public static DefaultReporterFactory defaultNoXml()
     {
         return new DefaultReporterFactory( StartupReportConfiguration.defaultNoXml() );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/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 3305c5b..9e22f1e 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
@@ -94,19 +94,23 @@ public class StatelessXmlReporter
 
     private final int rerunFailingTestsCount;
 
+    private final String xsdSchemaLocation;
+
     // Map between test class name and a map between test method name
     // and the list of runs for each test method
     private final Map<String, Map<String, List<WrappedReportEntry>>> testClassMethodRunHistoryMap;
 
     public StatelessXmlReporter( File reportsDirectory, String reportNameSuffix, boolean trimStackTrace,
                                  int rerunFailingTestsCount,
-                                 Map<String, Map<String, List<WrappedReportEntry>>> testClassMethodRunHistoryMap )
+                                 Map<String, Map<String, List<WrappedReportEntry>>> testClassMethodRunHistoryMap,
+                                 String xsdSchemaLocation )
     {
         this.reportsDirectory = reportsDirectory;
         this.reportNameSuffix = reportNameSuffix;
         this.trimStackTrace = trimStackTrace;
         this.rerunFailingTestsCount = rerunFailingTestsCount;
         this.testClassMethodRunHistoryMap = testClassMethodRunHistoryMap;
+        this.xsdSchemaLocation = xsdSchemaLocation;
     }
 
     public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStats testSetStats )
@@ -128,8 +132,7 @@ public class StatelessXmlReporter
             XMLWriter ppw = new PrettyPrintXMLWriter( fw );
             ppw.setEncoding( ENCODING );
 
-            createTestSuiteElement( ppw, testSetReportEntry, testSetStats, reportNameSuffix,
-                                    testSetReportEntry.elapsedTimeAsString() );
+            createTestSuiteElement( ppw, testSetReportEntry, testSetStats, testSetReportEntry.elapsedTimeAsString() );
 
             showProperties( ppw );
 
@@ -347,17 +350,15 @@ public class StatelessXmlReporter
         ppw.addAttribute( "time", timeAsString );
     }
 
-    private static void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
-                                                String reportNameSuffix1, String timeAsString )
+    private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats,
+                                         String timeAsString )
     {
         ppw.startElement( "testsuite" );
 
         ppw.addAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
+        ppw.addAttribute( "xsi:noNamespaceSchemaLocation", xsdSchemaLocation );
 
-        ppw.addAttribute( "xsi:noNamespaceSchemaLocation",
-                          "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" );
-
-        ppw.addAttribute( "name", report.getReportName( reportNameSuffix1 ) );
+        ppw.addAttribute( "name", report.getReportName( reportNameSuffix ) );
 
         if ( report.getGroup() != null )
         {

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
----------------------------------------------------------------------
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
index c71611d..090a11b 100644
--- 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
@@ -62,7 +62,7 @@ public class DefaultReporterFactoryTest
     public void testMergeTestHistoryResult()
     {
         StartupReportConfiguration reportConfig = new StartupReportConfiguration( true, true, "PLAIN", false, false, new File("target"), false, null, "TESTHASH",
-                                                                                                 false, 1 );
+                                                                                                 false, 1, null );
 
         DefaultReporterFactory factory = new DefaultReporterFactory( reportConfig );
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
----------------------------------------------------------------------
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 e82515e..5b649e3 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
@@ -43,19 +43,18 @@ import java.util.concurrent.atomic.AtomicInteger;
 public class StatelessXmlReporterTest
     extends TestCase
 {
-    private TestSetStats stats;
-
-    private TestSetStats rerunStats;
-
-    private File expectedReportFile;
-
-    private File reportDir;
-
+    private static final String XSD =
+            "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd";
     private final static String TEST_ONE = "aTestMethod";
     private final static String TEST_TWO = "bTestMethod";
     private final static String TEST_THREE = "cTestMethod";
     private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger();
 
+    private TestSetStats stats;
+    private TestSetStats rerunStats;
+    private File expectedReportFile;
+    private File reportDir;
+
     @Override
     protected void setUp()
         throws Exception
@@ -85,7 +84,7 @@ public class StatelessXmlReporterTest
     {
         StatelessXmlReporter reporter =
             new StatelessXmlReporter( reportDir, null, false, 0,
-                                      new ConcurrentHashMap<String, Map<String, List<WrappedReportEntry>>>() );
+                                      new ConcurrentHashMap<String, Map<String, List<WrappedReportEntry>>>(), XSD );
         reporter.cleanTestHistoryMap();
 
         ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), getClass().getName(), 12 );
@@ -138,7 +137,7 @@ public class StatelessXmlReporterTest
 
         stats.testSucceeded( t2 );
         StatelessXmlReporter reporter = new StatelessXmlReporter( reportDir, null, false, 0,
-                        new ConcurrentHashMap<String, Map<String, List<WrappedReportEntry>>>() );
+                        new ConcurrentHashMap<String, Map<String, List<WrappedReportEntry>>>(), XSD );
         reporter.testSetCompleted( testSetReportEntry, stats );
 
         FileInputStream fileInputStream = new FileInputStream( expectedReportFile );
@@ -217,11 +216,8 @@ public class StatelessXmlReporterTest
         rerunStats.testSucceeded( testThreeSecondRun );
 
         StatelessXmlReporter reporter =
-            new StatelessXmlReporter( reportDir,
-                                      null,
-                                      false,
-                                      1,
-                                      new HashMap<String, Map<String, List<WrappedReportEntry>>>() );
+            new StatelessXmlReporter( reportDir, null, false, 1,
+                                      new HashMap<String, Map<String, List<WrappedReportEntry>>>(), XSD );
 
         reporter.testSetCompleted( testSetReportEntry, stats );
         reporter.testSetCompleted( testSetReportEntry, rerunStats );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/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 7d8044e..52a6210 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
@@ -344,6 +344,12 @@ public class SurefirePlugin
         return new String[]{ "**/Test*.java", "**/*Test.java", "**/*TestCase.java" };
     }
 
+    @Override
+    protected String getReportSchemaLocation()
+    {
+        return "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd";
+    }
+
     // now for the implementation of the field accessors
 
     public boolean isSkipTests()

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/71b00149/maven-surefire-plugin/src/site/apt/index.apt.vm
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/site/apt/index.apt.vm b/maven-surefire-plugin/src/site/apt/index.apt.vm
index 9c7ef2f..2a3d670 100644
--- a/maven-surefire-plugin/src/site/apt/index.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/index.apt.vm
@@ -79,7 +79,8 @@ mvn verify
 
   By default, these files are generated at <<<$\{basedir\}/target/${thisPlugin.toLowerCase()}-reports>>>.
 
-  The schema for the Surefire XML reports is available at {{{./xsd/surefire-test-report.xsd}Surefire XML Report Schema}}.
+  The schema for the ${thisPlugin} XML reports is available at
+  {{{./xsd/${thisPlugin.toLowerCase()}-test-report.xsd}${thisPlugin} XML Report Schema}}.
 
   For an HTML format of the report, please see the
   {{{http://maven.apache.org/plugins/maven-surefire-report-plugin/}Maven Surefire Report Plugin}}.