in wilma-functionaltest/src/main/java/com/epam/gepard/generic/GenericListTestSuite.java [80:123]
public GenericListTestSuite(final String testListFile, final ExpressionTestFilter filter, final Environment environment) throws IOException,
ClassNotFoundException {
this.environment = environment;
LineNumberReader listReader = new LineNumberReader(new InputStreamReader(new FileInputStream(testListFile)));
String originalLine;
while ((originalLine = listReader.readLine()) != null) {
originalLine = originalLine.trim();
if ("".equals(originalLine) || originalLine.startsWith("//") || originalLine.startsWith("#")) {
continue;
}
String line = originalLine.replace(File.separatorChar, '.');
// if: classname -> 1 run is expected
// if: classname,3 -> 3 run is expected
// if: classname,,AAA -> AAA is used as a blocker id
// if: classname,feederdescriptor,...-> loader class defines the number of execution and provides the tests
String[] testDescriptor = line.split(",");
Class<?> clazz = Class.forName(testDescriptor[TESTLIST_CLASS_NAME_FIELD]);
//add as many classes to the stack as data driven approach requires
if (filter.accept(clazz)) {
int count = 1;
DataFeederLoader dataFeeder = null;
if ((testDescriptor.length > TESTLIST_FEEDER_DESCRIPTOR_FIELD) && (!testDescriptor[TESTLIST_FEEDER_DESCRIPTOR_FIELD].isEmpty())) {
//this is a data driven TC
dataFeeder = new DataFeederLoader(clazz.getName(), testDescriptor[TESTLIST_FEEDER_DESCRIPTOR_FIELD], environment);
count = dataFeeder.calculateRuns(clazz.getName(), count);
DataDrivenParameterArray parameterArray = dataFeeder.calculateParameterArray(clazz.getName(), null);
dataFeeder.reserveParameterArray(parameterArray);
}
//detect blocker class
String blocker = null;
if (testDescriptor.length > TESTLIST_BLOCKER_FIELD) {
//has blocker value
blocker = testDescriptor[TESTLIST_BLOCKER_FIELD];
}
//and add it to the suite
TestClassData testClassData = new TestClassData(clazz, count, blocker);
addTestClass(testClassData, dataFeeder, originalLine);
usedTc++; //count the used test classes
}
}
listReader.close();
}