Package org.jvnet.hudson.test
Annotation Interface TestExtension
Works like
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.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Optional Element Summary
-
Element Details
-
value
String[] valueTo make this extension only active for one test case, specify the test method name. Otherwise, leave it unspecified and it'll apply to all the test methods defined in the same class. For example: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 { ... } }
- Default:
- {}
-