org.jvnet.hudson.test
Annotation Type TestExtension


@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD,METHOD})
@Documented
public @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:
TestExtensionLoader

Optional Element Summary
 String value
          To make this extension only active for one test case, specify the test method name.
 

value

public abstract String value
To 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.

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 { ... }
 }
 

Default:
""


Copyright © 2004-2013. All Rights Reserved.