All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sft.result.ResultDigest Maven / Gradle / Ivy

The newest version!
package sft.result;

import java.util.ArrayList;

public class ResultDigest {

    public final ArrayList scenariosSucceeded = new ArrayList();
    public final ArrayList scenariosFailed = new ArrayList();
    public final ArrayList scenariosIgnored = new ArrayList();
    public int nbScenariosOk;

    public ResultDigest(UseCaseResult useCaseResult) {
        extractFrom(useCaseResult);
    }

    private void extractFrom(UseCaseResult useCaseResult) {

        for (ScenarioResult scenarioResult : useCaseResult.scenarioResults) {
            switch (scenarioResult.issue) {
                case FAILED:
                    scenariosFailed.add(scenarioResult);
                    break;
                case IGNORED:
                    scenariosIgnored.add(scenarioResult);
                    break;
                default:
                case SUCCEEDED:
                    scenariosSucceeded.add(scenarioResult);
                    nbScenariosOk++;
            }
        }
        for (SubUseCaseResult subUseCaseResult : useCaseResult.subUseCaseResults) {
            extractFrom(subUseCaseResult.useCaseResult);
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy