net.thucydides.core.csv
Class CSVTestDataSource

Package class diagram package CSVTestDataSource
java.lang.Object
  extended by net.thucydides.core.csv.CSVTestDataSource
All Implemented Interfaces:
TestDataSource

public class CSVTestDataSource
extends Object
implements TestDataSource

Test data from a CSV file.


Constructor Summary
CSVTestDataSource(String path)
           
CSVTestDataSource(String path, char separatorValue)
           
 
Method Summary
protected
<T> boolean
assignPropertyValue(T newObject, String property, String value)
           
protected
<T> T
createNewInstanceOf(Class<T> clazz, Object... constructorArgs)
           
protected  List<String[]> getCSVDataFrom(Reader testDataReader)
           
 List<Map<String,String>> getData()
           
<T> List<T>
getDataAsInstancesOf(Class<T> clazz, Object... constructorArgs)
          Returns the test data as a list of JavaBean instances.
 List<String> getHeaders()
           
<T> List<T>
getInstanciatedInstancesFrom(Class<T> clazz, StepFactory factory)
           
protected  List<Map<String,String>> loadTestDataFrom(List<String[]> rows)
           
static boolean validTestDataPath(String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVTestDataSource

public CSVTestDataSource(String path,
                         char separatorValue)
                  throws IOException
Throws:
IOException

CSVTestDataSource

public CSVTestDataSource(String path)
                  throws IOException
Throws:
IOException
Method Detail

validTestDataPath

public static boolean validTestDataPath(String path)

getCSVDataFrom

protected List<String[]> getCSVDataFrom(Reader testDataReader)
                                 throws IOException
Throws:
IOException

loadTestDataFrom

protected List<Map<String,String>> loadTestDataFrom(List<String[]> rows)
                                             throws IOException
Throws:
IOException

getData

public List<Map<String,String>> getData()
Specified by:
getData in interface TestDataSource

getHeaders

public List<String> getHeaders()
Specified by:
getHeaders in interface TestDataSource

getDataAsInstancesOf

public <T> List<T> getDataAsInstancesOf(Class<T> clazz,
                                        Object... constructorArgs)
Returns the test data as a list of JavaBean instances.

Specified by:
getDataAsInstancesOf in interface TestDataSource

getInstanciatedInstancesFrom

public <T> List<T> getInstanciatedInstancesFrom(Class<T> clazz,
                                                StepFactory factory)
Specified by:
getInstanciatedInstancesFrom in interface TestDataSource

createNewInstanceOf

protected <T> T createNewInstanceOf(Class<T> clazz,
                                    Object... constructorArgs)

assignPropertyValue

protected <T> boolean assignPropertyValue(T newObject,
                                          String property,
                                          String value)


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.