Clover is able to detect test methods for following test frameworks and code patterns.
This approach can be used for Java 1.4, which does not support annotations. In such case, test methods can be marked using JavaDoc tags:
TestNG style
/** @testng.test */
class MyTest {
/** @testng.test */
void myTestMethod() { }
}
JUnit style
/** @test */
void myTestMethod() { }
Methods with a following signature:
public void test***()
Methods annotated with one of the following:
@junit.org.Test(expected={Foo.class})
@junit.org.Test(expected=Foo.class)
@Test(expected=Foo.class)
Methods annotated with:
@Test
@org.springframework.test.annotation.ExpectedException({Bar.class})
or
@Test
@ExpectedException(value={Bar.class})
Methods annotated with one of the following:
@org.testng.annotations.ExpectedExceptions(Foo.class)
@ExpectedExceptions(org.bar.Foo.class)
@org.testng.annotations.Test(expectedExceptions={Foo.class})
@Test(expectedExceptions={Foo.class})
@org.testng.annotations.Test(expectedExceptions=Foo.class)
@Test(expectedExceptions=Foo.class)
Methods annotated with one of the following:
@com.googlecode.instinct.marker.annotate.Specification(expectedException=Foo.class)
@Specification(expectedException=Foo.class)
These patterns are being used by Clover for per-test coverage, test optimization and reporting.