public TestOutcomes ofType(TestType testType) { List<TestOutcome> filteredOutcomes = Lists.newArrayList(); for(TestOutcome outcome : outcomes) { if (outcome.typeCompatibleWith(testType)) { filteredOutcomes.add(outcome); } } return TestOutcomes.of(filteredOutcomes); }
public TestOutcomes withResult(TestResult result) { List<TestOutcome> filteredOutcomes = outcomes .stream() .filter(outcome -> countScenariosWithResult(result, outcome) > 0) .collect(Collectors.toList()); return TestOutcomes.of(filteredOutcomes); }
public TestOutcomes withTags(List<TestTag> tags) { Set<TestOutcome> filteredOutcomes = new HashSet<>(); for (TestTag tag : tags) { filteredOutcomes.addAll(matchingOutcomes(outcomes, tag)); } return TestOutcomes.of(filteredOutcomes); }
public TestOutcomes withTags(List<TestTag> tags) { List<TestOutcome> filteredOutcomes = Lists.newArrayList(); for (TestTag tag : tags) { filteredOutcomes.addAll(matchingOutcomes(outcomes, tag)); } return TestOutcomes.of(filteredOutcomes); }
public TestOutcomes withErrorType(String testFailureErrorType) { List<TestOutcome> filteredOutcomes = outcomes .stream() .filter(outcome -> failedWith(outcome, testFailureErrorType)) .collect(Collectors.toList()); return TestOutcomes.of(filteredOutcomes).withLabel(""); }
public static TestOutcomes testOutcomesIn(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader(); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
/** * Find the test outcomes with a given tag name * * @param tagName the name of the tag type we are filtering on * @return A new set of test outcomes for this tag name */ public TestOutcomes withTag(String tagName) { List<TestOutcome> testOutcomesWithTags = outcomes.stream() .filter(outcome -> outcome.hasTagWithName(tagName)) .collect(Collectors.toList()); return TestOutcomes.of(testOutcomesWithTags).withLabel(tagName).withRootOutcomes(getRootOutcomes()); }
public List<RequirementOutcome> enrichRequirementsOutcomesWithReleaseTags(List<? extends RequirementOutcome> outcomes) { List<RequirementOutcome> requirementOutcomes = Lists.newArrayList(); for (RequirementOutcome outcome : outcomes) { List<TestOutcome> enrichedOutcomes = enrichOutcomesWithReleaseTags(outcome.getTestOutcomes().getOutcomes()); requirementOutcomes.add(outcome.withTestOutcomes(TestOutcomes.of(enrichedOutcomes))); } return requirementOutcomes; }
public TestOutcomes withTagTypes(List<String> tagTypes) { List<TestOutcome> testOutcomesWithTags = outcomes.stream() .filter(outcome -> outcome.hasTagWithTypes(tagTypes)) .collect(Collectors.toList()); return TestOutcomes.of(testOutcomesWithTags).withLabel(Joiner.on(",").join(tagTypes)) .withRootOutcomes(getRootOutcomes()); }
public TestOutcomes from(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader().forFormat(format); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
/** * Find the test outcomes with a given tag type * * @param tagType the tag type we are filtering on * @return A new set of test outcomes for this tag type */ public TestOutcomes withTagType(String tagType) { return TestOutcomes.of(filter(havingTagType(tagType), outcomes)).withLabel(tagType).withRootOutcomes(this.getRootOutcomes()); }
/** * Find the test outcomes with a given tag type * * @param tagType the tag type we are filtering on * @return A new set of test outcomes for this tag type */ public TestOutcomes withTagType(String tagType) { return TestOutcomes.of(filter(havingTagType(tagType), outcomes)).withLabel(tagType).withRootOutcomes(this.getRootOutcomes()); }
/** * Find the successful test outcomes in this set * * @return A new set of test outcomes containing only the successful tests */ public TestOutcomes getPassingTests() { return TestOutcomes.of(outcomesFilteredByResult(TestResult.SUCCESS)) .withLabel(labelForTestsWithStatus("passing tests")) .withResultFilter(TestResult.SUCCESS) .withRootOutcomes(getRootOutcomes()); }
public TestOutcomes getErrorTests() { return TestOutcomes.of(filter(withResult(TestResult.ERROR), outcomes)) .withLabel(labelForTestsWithStatus("failing tests")) .withRootOutcomes(getRootOutcomes()); }
public TestOutcomes getErrorTests() { return TestOutcomes.of(filter(withResult(TestResult.ERROR), outcomes)) .withLabel(labelForTestsWithStatus("failing tests")) .withRootOutcomes(getRootOutcomes()); }
/** * Find the failing test outcomes in this set * * @return A new set of test outcomes containing only the failing tests */ public TestOutcomes getFailingTests() { return TestOutcomes.of(filter(withResult(TestResult.FAILURE), outcomes)) .withLabel(labelForTestsWithStatus("failing tests")) .withRootOutcomes(getRootOutcomes()); }
/** * Find the successful test outcomes in this set * * @return A new set of test outcomes containing only the successful tests */ public TestOutcomes getPassingTests() { return TestOutcomes.of(filter(withResult(TestResult.SUCCESS), outcomes)) .withLabel(labelForTestsWithStatus("passing tests")) .withRootOutcomes(getRootOutcomes()); }
public TestOutcomes havingResult(TestResult result) { return TestOutcomes.of(filter(withResult(result), outcomes)) .withLabel(labelForTestsWithStatus(result.name())) .withRootOutcomes(getRootOutcomes()); }
private void generateReportsFor(List<TestOutcome> outcomes) throws IOException { TestOutcomes allOutcomes = TestOutcomes.of(outcomes); for (TestOutcome outcome : allOutcomes.getOutcomes()) { if (shouldGenerate(OutcomeFormat.XML)) { getXMLReporter().generateReportFor(outcome, allOutcomes); } if (shouldGenerate(OutcomeFormat.JSON)) { getJsonReporter().generateReportFor(outcome, allOutcomes); } getHTMLReporter().generateReportFor(outcome, allOutcomes); } }
private void generateReportsFor(List<TestOutcome> outcomes) throws IOException { TestOutcomes allOutcomes = TestOutcomes.of(outcomes); for (TestOutcome outcome : allOutcomes.getOutcomes()) { if (shouldGenerate(OutcomeFormat.XML)) { getXMLReporter().generateReportFor(outcome, allOutcomes); } if (shouldGenerate(OutcomeFormat.JSON)) { getJsonReporter().generateReportFor(outcome, allOutcomes); } getHTMLReporter().generateReportFor(outcome, allOutcomes); } }