junit categories annotation doesnt work for method level tests
<[email protected]> 13 Apr 2014 19:40:06 -0700
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was trying JUnit categories annotation with group parameter in maven surefire plugin to run Unit Tests or Integration Tests. It looks like the JUnit categories annotation doesnt work for method level tests, but only works for class level.
Is there anything wrong with my configuration? See details below.
Please help out ASAP.
Setups in pom.xml
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
......
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<groups>testSuite.FastTests</groups>
</configuration>
</plugin>
</plugins>
</build>
The JUnit Categories interface marker
package testSuite;
public interface FastTests {
}
Here's the method level JUnit Categories annotation
public class BackendServiceTest extends TestCase {
@Test
@Category(FastTests.class)
public void testInitialize(){
EagleEyeBackendService.start();
Assert.assertNotNull(CassiniService.getInstance());
......
}
Thanks
Laura