Annotation Type DbUnitDataSet
Data set annotation, used to specify which data set should be loaded for
the next test.
This annotation can be used on:
- Method (i.e test method).
- Class (i.e test class).
- Package (i.e package where test classes belongs)
@DbUnitDataSet("/dataset/xml")
public class TestClass {
@Rule
public DbUnitRule rule = new DbUnitRule(connectionFactory);
@Test
public void test1() {
}
@Test
@DbUnitDataSet("/dataset/xml/table1.xml")
public void test2() {
}
}
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String[] valueSet of data set file to load.- Returns:
- DataSet file to load.
- Default:
- {}
-
inherit
boolean inheritA flag indicating if given annotation should be merged with "parent" annotations. For example, a method can define additional dataset to load than the dataset defined at class level. The default value isfalse
(mainly for retro-compatibility reasons). This means that the dataset for the annotated method or class will shadow and effectively replace any datasets defined by superclasses. If this flag is set totrue
, this means that an annotated method or class will inherit the datasets defined by test superclasses (or meta-annotations).- Returns:
- The inherit flag value.
- Default:
- false
-