Class ExcelParser
- java.lang.Object
-
- com.axway.ats.harness.testng.dataproviders.ExcelParser
-
public class ExcelParser extends Object
Utility Class Responsible for parsing the Excel Files.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MULTIPLY
TheString
used to indicate that the table rows are to be returned in Cartesian productstatic String
STRING_TOKEN
static String
TEST_CASE_END
TheString
used to indicate the end of the test case datastatic String
TEST_CASE_START
TheString
used to indicate the beginning of the test case data
-
Constructor Summary
Constructors Constructor Description ExcelParser(InputStream excelFileInputStream, String sheetName)
Constructs a new instance of theExcelParser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[][]
getDataBlock(Method method)
Returns the test case data in the form of a two dimensional Object array.void
setSheetName(String newSheetName)
Sets the currentSheet
that would be used to load the test case data.
-
-
-
Field Detail
-
TEST_CASE_START
public static final String TEST_CASE_START
TheString
used to indicate the beginning of the test case data- See Also:
- Constant Field Values
-
TEST_CASE_END
public static final String TEST_CASE_END
TheString
used to indicate the end of the test case data- See Also:
- Constant Field Values
-
MULTIPLY
public static final String MULTIPLY
TheString
used to indicate that the table rows are to be returned in Cartesian product- See Also:
- Constant Field Values
-
STRING_TOKEN
public static final String STRING_TOKEN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExcelParser
public ExcelParser(InputStream excelFileInputStream, String sheetName) throws DataProviderException
Constructs a new instance of theExcelParser
- Parameters:
excelFileInputStream
-InputStream
to the excel filesheetName
- the name of the excel sheet to use- Throws:
DataProviderException
-
-
Method Detail
-
setSheetName
public void setSheetName(String newSheetName)
Sets the currentSheet
that would be used to load the test case data.- Parameters:
newSheetName
- The name of theSheet
-
getDataBlock
public Object[][] getDataBlock(Method method) throws DataProviderException
Returns the test case data in the form of a two dimensional Object array. The method makes sure the information is loaded only the first time it is called.- Parameters:
method
- the test method which parameters will be used to determine the excel column data type.- Returns:
- Object[][] containing the test data.
- Throws:
DataProviderException
-
-