|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME)
@Target(value={METHOD,TYPE})
public @interface DataLoader
A method or class level annotation providing users with the ability to specify a data Loader strategy for their test class.
EasyTest supports CSV, EXCEL and XML based data loading. But it may not be sufficient in all the cases.
Also EasyTest's Data Loading Strategy may not suit every user. In such a case, a user can write his own Custom Loader and pass it to the Data Loader annotation
to supply your own custom Loader.
For eg. this is how you can use it :
@Test
@DataLoader(loader=MyCustomDataLoader.class)
public void testGetItems(........
OR
@Test
@DataLoader(filePaths={testData.json} , loader=MyCustomDataLoader.class)
public void testGetItems(........
OR
@Test
@DataLoader(filePaths={testData.csv})
public void testGetItems(........
OR
@Test
@DataLoader(filePaths={testDataExcel.xls})
public void testGetItems(........
Note that the custom Loader must implement the Loader interface and should have a no arg constructor.
| Optional Element Summary | |
|---|---|
String[] |
filePaths
The list of files representing the input test data for the given test method. |
Class<? extends Loader> |
loader
The custom Loader class that will be used by EasyTest to load the test data |
LoaderType |
loaderType
The type of file that contains the data. |
public abstract String[] filePaths
public abstract LoaderType loaderType
public abstract Class<? extends Loader> loader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||