Class CSVTestDataSource
java.lang.Object
net.thucydides.core.steps.stepdata.CSVTestDataSource
- All Implemented Interfaces:
TestDataSource
Test data from a CSV file.
-
Constructor Summary
ConstructorsConstructorDescriptionCSVTestDataSource
(String path) CSVTestDataSource
(String path, char separatorValue) CSVTestDataSource
(String path, char separatorValue, char quotechar, char escape) CSVTestDataSource
(List<String> paths, char separatorValue) CSVTestDataSource
(List<String> paths, char separatorValue, char quotechar, char escape, int skipLines) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> boolean
assignPropertyValue
(T newObject, String property, String value) protected <T> T
createNewInstanceOf
(Class<T> clazz, Object... constructorArgs) getCSVDataFrom
(Reader testDataReader) getData()
<T> List<T>
getDataAsInstancesOf
(Class<T> clazz, Object... constructorArgs) Returns the test data as a list of JavaBean instances.<T> List<T>
getInstanciatedInstancesFrom
(Class<T> clazz, StepFactory factory) loadTestDataFrom
(List<String[]> rows) separatedBy
(char newSeparator) static boolean
validTestDataPath
(String path)
-
Constructor Details
-
CSVTestDataSource
public CSVTestDataSource(List<String> paths, char separatorValue, char quotechar, char escape, int skipLines) throws IOException - Throws:
IOException
-
CSVTestDataSource
- Throws:
IOException
-
CSVTestDataSource
- Throws:
IOException
-
CSVTestDataSource
- Throws:
IOException
-
CSVTestDataSource
public CSVTestDataSource(String path, char separatorValue, char quotechar, char escape) throws IOException - Throws:
IOException
-
-
Method Details
-
validTestDataPath
-
getCSVDataFrom
- Throws:
IOException
-
loadTestDataFrom
- Throws:
IOException
-
getData
- Specified by:
getData
in interfaceTestDataSource
-
getHeaders
- Specified by:
getHeaders
in interfaceTestDataSource
-
getDataAsInstancesOf
Returns the test data as a list of JavaBean instances.- Specified by:
getDataAsInstancesOf
in interfaceTestDataSource
-
getInstanciatedInstancesFrom
- Specified by:
getInstanciatedInstancesFrom
in interfaceTestDataSource
-
separatedBy
- Specified by:
separatedBy
in interfaceTestDataSource
-
createNewInstanceOf
-
assignPropertyValue
-