private void displayResults() {
LOG.info("Detailed results:");
LOG.info("----------------------------------\n");
for (int i = 0; i < testsFromConfigFile.size(); i++) {
CLITestData td = testsFromConfigFile.get(i);
boolean testResult = td.getTestResult();
// Display the details only if there is a failure
if (!testResult) {
LOG.info("-------------------------------------------");
LOG.info(" Test ID: [" + (i + 1) + "]");
LOG.info(" Test Description: [" + td.getTestDesc() + "]");
LOG.info("");
ArrayList<String> testCommands = td.getTestCommands();
for (int j = 0; j < testCommands.size(); j++) {
LOG.info(" Test Commands: [" +
expandCommand((String) testCommands.get(j)) + "]");
}
LOG.info("");
ArrayList<String> cleanupCommands = td.getCleanupCommands();
for (int j = 0; j < cleanupCommands.size(); j++) {
LOG.info(" Cleanup Commands: [" +
expandCommand((String) cleanupCommands.get(j)) + "]");
}
LOG.info("");
ArrayList<ComparatorData> compdata = td.getComparatorData();
for (int j = 0; j < compdata.size(); j++) {
boolean resultBoolean = compdata.get(j).getTestResult();
LOG.info(" Comparator: [" +
compdata.get(j).getComparatorType() + "]");
LOG.info(" Comparision result: [" +
(resultBoolean ? "pass" : "fail") + "]");
LOG.info(" Expected output: [" +
compdata.get(j).getExpectedOutput() + "]");
LOG.info(" Actual output: [" +
compdata.get(j).getActualOutput() + "]");
}
LOG.info("");
}
}
LOG.info("Summary results:");
LOG.info("----------------------------------\n");
boolean overallResults = true;
int totalPass = 0;
int totalFail = 0;
int totalComparators = 0;
for (int i = 0; i < testsFromConfigFile.size(); i++) {
CLITestData td = testsFromConfigFile.get(i);
totalComparators +=
testsFromConfigFile.get(i).getComparatorData().size();
boolean resultBoolean = td.getTestResult();
if (resultBoolean) {
totalPass ++;
} else {
totalFail ++;
}