Clover test detection

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Detection of test methods

Clover is able to detect test methods for following test frameworks and code patterns.

JavaDoc tags

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() { }

JUnit3

Methods with a following signature:

public void test***()

JUnit4

Methods annotated with one of the following:

@junit.org.Test(expected={Foo.class})
@junit.org.Test(expected=Foo.class)
@Test(expected=Foo.class)

JUnit4+Spring 

Methods annotated with:

@Test
@org.springframework.test.annotation.ExpectedException({Bar.class})

または

@Test 
@ExpectedException(value={Bar.class})

TestNG

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)

Instinct

Methods annotated with one of the following:

@com.googlecode.instinct.marker.annotate.Specification(expectedException=Foo.class)
@Specification(expectedException=Foo.class)

Usage context

These patterns are being used by Clover for per-test coverage, test optimization and reporting.

 

最終更新日 2012 年 5 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.