[ https://jira.codehaus.org/browse/SUREFIRE-904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tibor Digana closed SUREFIRE-904. --------------------------------- Resolution: Not A Bug Closed upon the discussion http://maven.40175.n5.nabble.com/SUREFIRE-List-of-simple-issues-to-fix-td5814089.html > 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 > Assignee: Tibor Digana > 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 was sent by Atlassian JIRA (v6.1.6#6162)