use of com.axway.ats.log.model.ScenarioResult in project ats-framework by Axway.
the class SuiteWrapper method calculateFinalStatistics.
public void calculateFinalStatistics() {
if (dataLoadedFromDb) {
// all statistics came calculated
return;
}
for (Entry<String, List<Testcase>> scenarioEntry : testcasesMap.entrySet()) {
++scenariosTotal;
ScenarioResult scenarioResult = ScenarioResult.PASSED;
Collection<Testcase> testcasesPerScenario = scenarioEntry.getValue();
for (Testcase testcase : testcasesPerScenario) {
++testcasesTotal;
switch(testcase.result) {
case // FAILED
0:
++testcasesFailed;
scenarioResult = ScenarioResult.FAILED;
break;
case // SKIPPED
2:
++testcasesSkipped;
if (scenarioResult == ScenarioResult.PASSED) {
scenarioResult = ScenarioResult.SKIPPED;
}
break;
default:
break;
}
}
if (scenarioResult == ScenarioResult.FAILED) {
++scenariosFailed;
} else if (scenarioResult == ScenarioResult.SKIPPED) {
++scenariosSkipped;
}
}
}
Aggregations