@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Inherited public @interface ExpectedDataSet
' @ExpectedDataSet
public class MyTestClass extends UnitilsJUnit3 {
'
public void testMethod1(){
}
'
' @ExpectedDataSet("aCustomFileName.xml")
public void testMethod2(){
}
}
Will check the resulting contents of the unit test database using a data set file named MyTestClass.testMethod1-result.xml
in the same directory as the class for testMethod1 and aCustomFileName.xml for testMethod2.
public class MyTestClass extends UnitilsJUnit3 {
'
public void testMethod1(){
}
'
' @ExpectedDataSet
public void testMethod2(){
}
}
Will not perform any dataset check for testMethod1 (there is no class level expected data set). And will use a data set
file named MyTestClass.testMethod2-result.xml for testMethod2.| Modifier and Type | Optional Element and Description |
|---|---|
String |
databaseName
The name of the database.
|
Class<? extends DataSetFactory> |
factory |
String[] |
value
The file name of the data set.
|
public abstract String[] value
public abstract Class<? extends DataSetFactory> factory
Copyright © 2017. All rights reserved.