@Retention(value=RUNTIME) @Target(value={TYPE,FIELD,METHOD}) @Documented public @interface TestExtension
Extension except used for inserting extensions during unit tests.
This annotation must be used on a method/field of a test case class, or an nested type of the test case. The extensions are activated only when the outer test class is being run.
TestExtensionLoaderpublic abstract String[] value
class FooTest extends HudsonTestCase {
public void test1() { ... }
public void test2() { ... }
// this only kicks in during test1
@TestExtension("test1")
class Foo extends ConsoleAnnotator { ... }
// this kicks in both for test1 and test2
@TestExtension
class Bar extends ConsoleAnnotator { ... }
// You can also specify multiple test cases with parameters
@TestExtension({"test1", "test2"})
class Baz extends ConsoleAnnotator { ... }
}
Copyright © 2004–2019. All rights reserved.