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 2011/11/29 23:57:05 UTC

svn commit: r1208125 - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-plugin/src/main/java/org/apache/maven/plugin/sur...

Author: krosenvold
Date: Tue Nov 29 22:57:02 2011
New Revision: 1208125

URL: http://svn.apache.org/viewvc?rev=1208125&view=rev
Log:
o Fixed javadocs before release, added docs about minor api changes.

Added:
    maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm   (with props)
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
    maven/surefire/trunk/maven-surefire-plugin/src/site/apt/api.apt.vm
    maven/surefire/trunk/maven-surefire-plugin/src/site/apt/usage.apt.vm
    maven/surefire/trunk/maven-surefire-plugin/src/site/site.xml

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java (original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java Tue Nov 29 22:57:02 2011
@@ -424,8 +424,8 @@ public class IntegrationTestMojo
     private boolean childDelegation;
 
     /**
-     * (TestNG only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will
-     * be included in test run, if specified.<br/>
+     * (TestNG/JUnit47 provider with JUnit4.8+ only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will
+     * be included in test run, if specified.<br/>For JUnit, this parameter forces the use of the 4.7 provider<br/>
      * This parameter is ignored if the <code>suiteXmlFiles</code> parameter is specified.
      *
      * @parameter expression="${groups}"
@@ -434,8 +434,8 @@ public class IntegrationTestMojo
     private String groups;
 
     /**
-     * (TestNG only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will
-     * specifically not be run.<br/>
+     * (TestNG/JUnit47 provider with JUnit4.8+ only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will
+     * specifically not be run.<br/>For JUnit, this parameter forces the use of the 4.7 provider<br/>
      * This parameter is ignored if the <code>suiteXmlFiles</code> parameter is specified.
      *
      * @parameter expression="${excludedGroups}"
@@ -634,7 +634,7 @@ public class IntegrationTestMojo
      * Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a
      * multi-module build.
      * <p/>
-     * Failed first will run tests that failed on previous run first, as well as new tests.
+     * Failed first will run tests that failed on previous run first, as well as new tests for this run.
      * <p/>
      * Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests to
      * make all tests complete at the same time, reducing the overall execution time.

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java (original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Tue Nov 29 22:57:02 2011
@@ -294,6 +294,11 @@ public abstract class AbstractSurefireMo
         return this.getParallel() != null && this.getParallel().trim().length() > 0;
     }
 
+    protected boolean isAnyGroupsSelected()
+    {
+        return this.getGroups() != null && this.getExcludedGroups() != null;
+    }
+
     /**
      * Converts old JUnit configuration parameters over to new properties based configuration
      * method. (if any are defined the old way)
@@ -1298,7 +1303,8 @@ public abstract class AbstractSurefireMo
         public boolean isApplicable()
         {
             final boolean isJunitArtifact47 = isAnyJunit4( junitArtifact ) && isJunit47Compatible( junitArtifact );
-            return isAnyConcurrencySelected() && ( isJunitArtifact47 || is47CompatibleJunitDep() );
+            final boolean isAny47ProvidersForcers = isAnyConcurrencySelected() || isAnyGroupsSelected();
+            return isAny47ProvidersForcers && ( isJunitArtifact47 || is47CompatibleJunitDep() );
         }
 
         public void addProviderProperties()

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java (original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java Tue Nov 29 22:57:02 2011
@@ -393,9 +393,10 @@ public class SurefirePlugin
     private boolean childDelegation;
 
     /**
-     * (TestNG only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will
-     * be included in test run, if specified.<br/>
+     * (TestNG/JUnit47 provider with JUnit4.8+ only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will
+     * be included in test run, if specified. <br/>For JUnit, this parameter forces the use of the 4.7 provider<br/>
      * This parameter is ignored if the <code>suiteXmlFiles</code> parameter is specified.
+     * .
      *
      * @parameter expression="${groups}"
      * @since 2.2
@@ -403,8 +404,8 @@ public class SurefirePlugin
     private String groups;
 
     /**
-     * (TestNG only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will
-     * specifically not be run.<br/>
+     * (TestNG/JUnit47 provider with JUnit4.8+ only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will
+     * specifically not be run.<br/>For JUnit, this parameter forces the use of the 4.7 provider<br/>
      * This parameter is ignored if the <code>suiteXmlFiles</code> parameter is specified.
      *
      * @parameter expression="${excludedGroups}"
@@ -413,7 +414,7 @@ public class SurefirePlugin
     private String excludedGroups;
 
     /**
-     * (TestNG only) List of &lt;suiteXmlFile> elements specifying TestNG suite xml file locations. Note that
+     * (TestNG) List of &lt;suiteXmlFile> elements specifying TestNG suite xml file locations. Note that
      * <code>suiteXmlFiles</code> is incompatible with several other parameters of this plugin, like
      * <code>includes/excludes</code>.<br/>
      * This parameter is ignored if the <code>test</code> parameter is specified (allowing you to run a single test
@@ -596,7 +597,7 @@ public class SurefirePlugin
      * Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a
      * multi-module build.
      * <p/>
-     * Failed first will run tests that failed on previous run first, as well as new tests.
+     * Failed first will run tests that failed on previous run first, as well as new tests for this run.
      * <p/>
      * Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests to
      * make all tests complete at the same time, reducing the overall execution time.

Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/api.apt.vm
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/api.apt.vm?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/api.apt.vm (original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/api.apt.vm Tue Nov 29 22:57:02 2011
@@ -58,3 +58,18 @@ Maven Surefire Provider API
 
   The javadoc on the intefaces mentioned in this article should otherwise be sufficient to write a provider.
   Providers are added as dependencies to the surefire/failsafe plugins.
+
+** API Changes for 2.11
+
+    Prior to 2.11, the provider would do
+
++---+
+    TestsToRun scanned = directoryScanner.locateTestClasses( testClassLoader, scannerFilter );
++---+
+
+    and the classes would arrive in sorted order. In 2.11, an additional step must be implemented by the provider;
+
++---+
+    TestsToRun scanned = directoryScanner.locateTestClasses( testClassLoader, scannerFilter );
+    return providerParameters.getRunOrderCalculator().orderTestClasses(  scanned );
++---+

Added: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm?rev=1208125&view=auto
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm (added)
+++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm Tue Nov 29 22:57:02 2011
@@ -0,0 +1,24 @@
+Feature matrix
+
+    Not all features are supported for all test frameworks, and the following table gives a brief overview
+    of support status:
+
+*---------------------------------------------+-----------+-----------+------------+-----------+----------+
+|| <<Feature>>                                ||<<JUnit3>>||<<JUnit4>>||<<Junit47>>||<<TestNG>>||<<Pojo>> |
+*---------------------------------------------+------------+----------+------------+-----------+----------+
+| groups/category support                     |     N      |    N     |      Y     |    Y      |  N       |
+*---------------------------------------------+------------+----------+------------+-----------+----------+
+| security manager support                    |     Y      |    N     |      N     |    N      |  N       |
+*---------------------------------------------+------------+----------+------------+-----------+----------+
+| runOrder support                            |     Y      |    Y     |      Y     |    ?      |  Y       |
+*---------------------------------------------+------------+----------+------------+-----------+----------+
+| parallel support                            |     N      |    N     |      Y     |    Y      |  N       |
+*---------------------------------------------+------------+----------+------------+-----------+----------+
+
+
+    Legend: Y means supported, N means not supported. ? means not tested.
+
+    If you would like to implement support for
+    a given provider with an N or a ? (or create tests for it), you should create a patch and mark the issue is an
+    improvement. If there is something wrong with an implementation marked with "Y" it's a bug.
+

Propchange: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/usage.apt.vm
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/usage.apt.vm?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/usage.apt.vm Tue Nov 29 22:57:02 2011
@@ -121,8 +121,7 @@ mvn verify
   The POJO provider above allows you to write tests that do not depend on
   JUnit. They behave in the same way, running all <<<test*>>> methods that are
   public in the class, but the API dependency is not required. To perform
-  assertions, the JDK 1.4 <<<assert>>> keyword can be used, or you can use
-  <<<org.apache.maven.surefire.assertion.Assert>>>.
+  assertions, the JDK 1.4 <<<assert>>> keyword can be used.
   See {{{./examples/pojo-test.html} using POJO tests}} for more information.
 
   All of the providers support the Surefire Plugin parameter configurations.

Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/site.xml?rev=1208125&r1=1208124&r2=1208125&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/site/site.xml (original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/site/site.xml Tue Nov 29 22:57:02 2011
@@ -43,6 +43,7 @@
       <item name="Introduction" href="index.html"/>
       <item name="Goals" href="plugin-info.html"/>
       <item name="Usage" href="usage.html"/>
+      <item name="Feature matrix" href="featurematrix.html"/>
       <item name="API" href="api.html"/>
       <item name="FAQ" href="faq.html"/>
     </menu>