CLITestData testdata = (CLITestData) testsFromConfigFile.get(index);
// Execute the test commands
ArrayList<TestCmd> testCommands = testdata.getTestCommands();
Result cmdResult = null;
for (TestCmd cmd : testCommands) {
try {
cmdResult = execute(cmd);
} catch (Exception e) {
fail(StringUtils.stringifyException(e));
}
}
boolean overallTCResult = true;
// Run comparators
ArrayList<ComparatorData> compdata = testdata.getComparatorData();
for (ComparatorData cd : compdata) {
final String comptype = cd.getComparatorType();
boolean compareOutput = false;
if (! comptype.equalsIgnoreCase("none")) {
compareOutput = compareTestOutput(cd, cmdResult);
overallTCResult &= compareOutput;
}
cd.setExitCode(cmdResult.getExitCode());
cd.setActualOutput(cmdResult.getCommandOutput());
cd.setTestResult(compareOutput);
}
testdata.setTestResult(overallTCResult);
// Execute the cleanup commands