Package org.jvnet.hudson.test.recipes
Annotation Type LocalData
-
@Documented @Recipe(RunnerImpl.class) @JenkinsRecipe(RuleRunnerImpl.class) @Target(METHOD) @Retention(RUNTIME) public @interface LocalData
Runs a test case with a data set local to test method or the test class.This recipe allows your test case to start with the preset
JENKINS_HOMEdata loaded either from your test method or from the test class.For example, if the test method is
org.acme.FooTest.testBar(), then you can have your test data in one of the following places in resources folder (typicallysrc/test/resources):-
Under
org/acme/FooTest/testBardirectory; that is, you could have files such asorg/acme/FooTest/testBar/config.xmlororg/acme/FooTest/testBar/jobs/p/config.xml, in the same layout as in the realJENKINS_HOMEdirectory. -
In
org/acme/FooTest/testBar.zipas a zip file. -
Under
org/acme/FooTestdirectory; that is, you could have files such asorg/acme/FooTest/config.xmlororg/acme/FooTest/jobs/p/config.xml, in the same layout as in the realJENKINS_HOMEdirectory. -
In
org/acme/FooTest.zipas a zip file.
@LocalData("commonData")results usingorg/acme/FooTest/commonData(.zip).Search is performed in this specific order. The fall back mechanism allows you to write one test class that interacts with different aspects of the same data set, by associating the dataset with a test class, or have a data set local to a specific test method.
The choice of zip and directory depends on the nature of the test data, as well as the size of it.
- Author:
- Kohsuke Kawaguchi
- See Also:
TailLog
-
Under
-
-
Element Detail
-
value
String value
- Default:
- ""
-
-