[ 
http://jira.codehaus.org/browse/SUREFIRE-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Fabulich updated SUREFIRE-131:
----------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s:     (was: 2.4)
                   2.x

I hesitate to add another option to a plugin that already has so many options, 
especially one that sounds so much like another option we already have.

Note that this is not the recommended way to address the division between unit 
tests and integration tests.  The recommended way is to put your unit tests 
into a separate module, or at least a separate plugin execution.  
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

Finally, it's already possible to put 
<excludes><exclude>${mySpecialProperty}</exclude></excludes> in your plugin 
configuration, allowing you to configure your plugin from the command line.

> Excluding tests with command line pattern
> -----------------------------------------
>
>                 Key: SUREFIRE-131
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-131
>             Project: Maven Surefire
>          Issue Type: New Feature
>    Affects Versions: 2.0 (2.2 plugin)
>         Environment: All environments running JUnit tests
>            Reporter: Johannes Carlén
>            Priority: Minor
>             Fix For: 2.x
>
>
> I'd like to be able to exclude certain tests from being run. An example of 
> this could be a scenario where I'd like just the unit tests and not the 
> integration tests to run. In our case, we name all integration test with the 
> postfix "IntTest" instead of just "Test".
> This is now possible through configuring the plugin in the pom, however it is 
> not possible to decide at the command line if I just like to run some tests 
> and not all.
> Example of use with this implementation would be:
> mvn -Dexclude=*IntTest test
> which would run all tests - excluding those that ends with IntTest
> The amount of code needed for implementation is minimal. In 
> SurefirePlugin.java:
> Just add a property - something like:
>     /**
>      * Specify this parameter to exclude test by their name. It follows
>      * the same conventions as the <code>test</code> parameter.
>      * 
>      * @parameter expression="${exclude}"
>      * 
>      */
>     private String exclude;
> Add this code at line 527
>                 if ( this.exclude != null )
>                 {   
>                     String exclude = "**/" + this.exclude + ".java";
>                     excludes.add(exclude);
>                     getLog().debug( "Excluding test with pattern :" + exclude 
> );
>                 }
> ...and that's all.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to