Annotation Interface WithLocalData
Annotates a test method so that JenkinsExtension will use preset
JENKINS_HOME
data loaded from either the 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
(typically src/test/resources
):
-
Under
org/acme/FooTest/testBar
directory; that is, you could have files such asorg/acme/FooTest/testBar/config.xml
ororg/acme/FooTest/testBar/jobs/p/config.xml
, in the same layout as in the realJENKINS_HOME
directory. -
In
org/acme/FooTest/testBar.zip
as a zip file. -
Under
org/acme/FooTest
directory; that is, you could have files such asorg/acme/FooTest/config.xml
ororg/acme/FooTest/jobs/p/config.xml
, in the same layout as in the realJENKINS_HOME
directory. -
In
org/acme/FooTest.zip
as a zip file.
@LocalData("commonData")
results using
org/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:
- Alex Earl
- See Also:
-
JenkinsExtension
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String value- Default:
- ""
-