Search in sources :

Example 1 with MergedTestArtifactPlan

use of com.thoughtworks.go.domain.MergedTestArtifactPlan in project gocd by gocd.

the class ArtifactPlanFilter method getBuiltInMergedArtifactPlans.

public List<ArtifactPlan> getBuiltInMergedArtifactPlans(List<ArtifactPlan> artifactPlans) {
    MergedTestArtifactPlan testArtifactPlan = null;
    final List<ArtifactPlan> mergedPlans = new ArrayList<>();
    for (ArtifactPlan artifactPlan : artifactPlans) {
        if (artifactPlan.getArtifactPlanType().isTest()) {
            if (testArtifactPlan == null) {
                testArtifactPlan = new MergedTestArtifactPlan(artifactPlan);
                mergedPlans.add(testArtifactPlan);
            } else {
                testArtifactPlan.add(artifactPlan);
            }
        } else if (artifactPlan.getArtifactPlanType() == ArtifactPlanType.file) {
            mergedPlans.add(artifactPlan);
        }
    }
    return mergedPlans;
}
Also used : ArtifactPlan(com.thoughtworks.go.domain.ArtifactPlan) MergedTestArtifactPlan(com.thoughtworks.go.domain.MergedTestArtifactPlan) ArrayList(java.util.ArrayList) MergedTestArtifactPlan(com.thoughtworks.go.domain.MergedTestArtifactPlan)

Aggregations

ArtifactPlan (com.thoughtworks.go.domain.ArtifactPlan)1 MergedTestArtifactPlan (com.thoughtworks.go.domain.MergedTestArtifactPlan)1 ArrayList (java.util.ArrayList)1