[ 
https://jira.codehaus.org/browse/SUREFIRE-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=306465#comment-306465
 ] 

Kristian Rosenvold commented on SUREFIRE-904:
---------------------------------------------

You configured the plugin to run 4 times (default + 3 executions), and it does 
just that. Since you did not specify any groups for the default execution it 
runs everything. Exactly what is the proplem here?
                
> Categorization of tests results in running first tests without 
> categorization,then tests run based on category
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-904
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-904
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.12.2
>         Environment: maven 3.0.4
> junit 4.8.1
> maven surefire pluign 2.12.2
>            Reporter: Ronal Bashirov
>         Attachments: mavenproject2.zip
>
>
> I am separate my tests using junit categories.
> So I have some test:
>  @Test
>     @Category(UnitTest.class)
>     public void testApp1() {
>         
>         System.out.println( "UnitTest" );
>         assertTrue(true);
>     }
>     @Test
>     @Category(ComponentTest.class)
>     public void testApp2() {
>         System.out.println( "ComponentTest" );
>         assertTrue(true);
>     }
>     @Test
>     @Category(SystemTest.class)
>     public void testApp3() {
>         System.out.println( "SystemTest" );
>         assertTrue(true);
>     }
> Then I am trying to run them separately 
>  <plugin>
>                 <artifactId>maven-surefire-plugin</artifactId>
>                 <version>2.12.2</version>
>                 <executions>
>                     <execution>
>                         <id>unit-tests</id>
>                         <goals>
>                             <goal>test</goal>
>                         </goals>
>                         <configuration>
>                             
> <groups>com.mycompany.mavenproject2.UnitTest</groups> 
>                             <reportsDirectory> 
> ${project.build.directory}/surefire-reports/unit</reportsDirectory> 
>                                 
>                         </configuration>     
>                     </execution>
>                     <execution>
>                         <id>comp-tests</id>
>                         <goals>
>                             <goal>test</goal>
>                         </goals>
>                         <configuration>
>                             
> <groups>com.mycompany.mavenproject2.ComponentTest</groups>
>                             <reportsDirectory> 
> ${project.build.directory}/surefire-reports/comp</reportsDirectory> 
>                                          
>                         </configuration>     
>                     </execution>
>                     <execution>
>                         <id>sys-tests</id>
>                         <goals>
>                             <goal>test</goal>
>                         </goals>
>                         <configuration>
>                             
> <groups>com.mycompany.mavenproject2.SystemTest</groups>
>                             <reportsDirectory> 
> ${project.build.directory}/surefire-reports/sys</reportsDirectory>            
>                              
>                         </configuration>     
>                     </execution>
>                 </executions>
>                 
>             </plugin>
> As result I am getting
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.mycompany.mavenproject2.AppTest
> UnitTest
> ComponentTest
> SystemTest
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
> Results :
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
> [surefire:test]
> Surefire report directory: 
> C:\Users\mz\Documents\NetBeansProjects\mavenproject2\target\surefire-reports\unit
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Concurrency config is parallel='none', perCoreThreadCount=true, 
> threadCount=2, useUnlimitedThreads=false
> Running com.mycompany.mavenproject2.AppTest
> UnitTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> [surefire:test]
> Surefire report directory: 
> C:\Users\mz\Documents\NetBeansProjects\mavenproject2\target\surefire-reports\comp
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Concurrency config is parallel='none', perCoreThreadCount=true, 
> threadCount=2, useUnlimitedThreads=false
> Running com.mycompany.mavenproject2.AppTest
> ComponentTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> [surefire:test]
> Surefire report directory: 
> C:\Users\mz\Documents\NetBeansProjects\mavenproject2\target\surefire-reports\sys
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Concurrency config is parallel='none', perCoreThreadCount=true, 
> threadCount=2, useUnlimitedThreads=false
> Running com.mycompany.mavenproject2.AppTest
> SystemTest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to