@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Inherited public @interface DataSet
' @DataSet
public class MyTestClass extends UnitilsJUnit3 {
'
public void testMethod1(){
}
'
' @DataSet("aCustomFileName.xml")
public void testMethod2(){
}
}
Will load a data set file named MyTestClass.xml or MyTestClass-testMethod1.xml for testMethod1 in the same directory
as the class. And for testMethod2 a data set file named aCustomFileName.xml in the same directory as the class is
loaded.
public class MyTestClass extends UnitilsJUnit3 {
'
public void testMethod1(){
}
'
' @DataSet
public void testMethod2(){
}
}
Will not load any dataset for testMethod1 (there is no class level data set). Will load a data set file named
MyTestClass.xml or MyTestClass.testMethod2.xml for testMethod2.| Modifier and Type | Optional Element and Description |
|---|---|
String |
databaseName
The name of the database.
|
Class<? extends DataSetFactory> |
factory
The factory that needs to be used to read the dataset file and create a
MultiSchemaDataSet
object |
Class<? extends DataSetLoadStrategy> |
loadStrategy
The strategy that needs to be used to get the dbunit dataset into the database
|
String[] |
value
The file name of the data set.
|
public abstract String[] value
public abstract Class<? extends DataSetLoadStrategy> loadStrategy
DataSetLoadStrategy. Use the default value DataSetLoadStrategy
to make use of the default loadStragegy configured in the unitils configuration.public abstract Class<? extends DataSetFactory> factory
MultiSchemaDataSet
objectDataSetFactory. Use the default value DataSetFactory
to make use of the default DataSetLoadStrategy configured in the unitils configuration.Copyright © 2017. All rights reserved.