public class CsvReader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_KEY |
static int |
SERVICE_CSV_COLUMN_COUNT |
static String |
SERVICE_CSV_FILE_PREFIX |
| Constructor and Description |
|---|
CsvReader() |
| Modifier and Type | Method and Description |
|---|---|
static List<String[]> |
addActionCsvTests(List<String[]> csvList)
update csv test list with tests from action csv files
|
static void |
getAllKeywords()
gets all keywords And stores them in apiMap in testObject
|
static void |
getAllTestCases(String testPath,
String prefix)
gets all test cases from testcase path based on prefix
|
static int |
getColumnIndexByName(String column,
String[] row)
gets column name by the column name
|
static int |
getCsvFileCount() |
static String |
getCsvFileFromIndex(int index)
returns current csv test file
|
static int |
getCsvFileIndex(String fileName)
returns the index of the file from the list of csv files
|
static int |
getCsvFileIndex(String csvDir,
String fileName)
returns the index of the file from the list of csv files
|
static ArrayList<File> |
getCsvFileList(String csvTestPath)
returns a list of all csv test files
|
static int |
getCsvTestcount()
get the number of tests in csv file
|
static List<String[]> |
getCsvTestList(File file) |
static List<String[]> |
getCsvTestListForTestRunner(String csvFile)
gets csv tests list for service tests
|
static List<String[]> |
getCsvTestListForTestRunner(String csvDir,
String csvFile)
gets csv tests list for service tests
|
static int |
getCurrentTestInvocation()
gets csv file index does not increment When retry
|
static int |
getFileIndex(ArrayList<File> testCsvFileList,
String csvFile) |
static List<Object[]> |
getTestCasesFromCsvFile()
gets the tests from csv file based on the current test file index
|
static ArrayList<File> |
getTestDataCsvFileList()
returns a list of all csv test files
|
static boolean |
isRunningServiceTest() |
static boolean |
isValidTestFileType(String filename)
returns if file is valid service test type
|
static Map<String,ServiceObject> |
mapToApiObject(List<String[]> testCases)
maps list of test cases to service object map
|
static ServiceObject |
mapToServiceObject(Object[] testData)
test data array to service object
|
static List<Object[]> |
updateCsvFileFromFile(List<String[]> csvList,
String csvFileName,
String testCaseFile)
update csv test list with additional meta data (csv file name, test index, service type, test count)
if test case is set then single test is returned
|
public static int SERVICE_CSV_COLUMN_COUNT
public static String SERVICE_CSV_FILE_PREFIX
public static final String ACTION_KEY
public static List<Object[]> getTestCasesFromCsvFile()
public static List<Object[]> updateCsvFileFromFile(List<String[]> csvList, String csvFileName, String testCaseFile)
csvList - csvFileName - testCaseFile - public static List<String[]> addActionCsvTests(List<String[]> csvList)
testData - public static Map<String,ServiceObject> mapToApiObject(List<String[]> testCases)
testCases - public static ServiceObject mapToServiceObject(Object[] testData)
testData - public static void getAllTestCases(String testPath, String prefix)
public static void getAllKeywords()
public static int getCurrentTestInvocation()
public static boolean isRunningServiceTest()
public static String getCsvFileFromIndex(int index)
public static int getCsvFileCount()
public static ArrayList<File> getTestDataCsvFileList()
public static ArrayList<File> getCsvFileList(String csvTestPath)
csvTestPath: - full path to csv directorypublic static int getCsvFileIndex(String fileName)
fileName - public static int getCsvFileIndex(String csvDir, String fileName)
fileName - public static List<String[]> getCsvTestListForTestRunner(String csvFile)
csvFile - public static List<String[]> getCsvTestListForTestRunner(String csvDir, String csvFile)
csvFile - public static int getColumnIndexByName(String column, String[] row)
column: - column namerow: - header rowpublic static int getCsvTestcount()
public static boolean isValidTestFileType(String filename)
filename - Copyright © 2019. All rights reserved.