org.easetech.easytest.annotation
Annotation Type DataLoader


@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.

Author:
Anuj Kumar

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.
 

filePaths

public abstract String[] filePaths
The list of files representing the input test data for the given test method.

Default:
{}

loaderType

public abstract LoaderType loaderType
The type of file that contains the data. Defaults to "none"

Default:
org.easetech.easytest.loader.LoaderType.NONE

loader

public abstract Class<? extends Loader> loader
The custom Loader class that will be used by EasyTest to load the test data

Default:
org.easetech.easytest.loader.EmptyLoader.class


Copyright © 2013. All Rights Reserved.