Search in sources :

Example 1 with ScenarioResult

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;
        }
    }
}
Also used : ScenarioResult(com.axway.ats.log.model.ScenarioResult) Testcase(com.axway.ats.log.autodb.entities.Testcase) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

Testcase (com.axway.ats.log.autodb.entities.Testcase)1 ScenarioResult (com.axway.ats.log.model.ScenarioResult)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1