Package de.hybris.platform.order.impl
Class TestCaseXmlHelper
java.lang.Object
de.hybris.platform.order.impl.TestCaseXmlHelper
- All Implemented Interfaces:
Iterable
Class for loading XML with generated test cases, being output from 'tcases' external tool.
Assumes that each test case consists of same parameters. Can output content in following formats:
Assumes that each test case consists of same parameters. Can output content in following formats:
- CSV
- Map<String,String>
- iterator
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestCaseXmlHelper(File sourceXmlFile) TestCaseXmlHelper(InputStream sourceXmlStream) -
Method Summary
Modifier and TypeMethodDescriptionGet all parameter names as ordered List<String>.Get all parameters as CSV string separated byCSV_SEPARATOR='\t'.Get a test case (a "row") as a CSV row separated byCSV_SEPARATOR='\t'.intgetTestCase(int index) Get test case ("a row") as a Map<String,String>iterator()Get all test cases as anIterator<String>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
CSV_SEPARATOR
public static final char CSV_SEPARATOR- See Also:
-
-
Constructor Details
-
TestCaseXmlHelper
public TestCaseXmlHelper(File sourceXmlFile) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException -
TestCaseXmlHelper
public TestCaseXmlHelper(InputStream sourceXmlStream) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException
-
-
Method Details
-
getVar
-
getCSVRow
-
getCSVRow
Get a test case (a "row") as a CSV row separated byCSV_SEPARATOR='\t'.- Parameters:
rowNumber- Test case numberparameters- Provide a list of parameters (getAllParameters) to get specific ordering.
Acts as a CSV header.- Returns:
- A String, single CSV row with specific ordering and separators.
-
getRowCount
public int getRowCount() -
getAllParameters
Get all parameter names as ordered List<String>. Use this to keep same parameter order when selecting rows.- Returns:
- Ordered list of parameter names.
-
getCSVHeader
Get all parameters as CSV string separated byCSV_SEPARATOR='\t'.- Returns:
- CSV header with all test case parameters and default separator.
-
getTestCase
Get test case ("a row") as a Map<String,String>- Parameters:
index- Requested test case number.- Returns:
- Map of parameters for a given test case number.
-
iterator
Get all test cases as anIterator<String>
-