/** * Checks if the scenario is accepted. * * @param scenario the scenario to check. * @return true when accepted false otherwise. */ public boolean acceptScenario(final ScenarioTestDoc scenario) { return acceptsAllOf(scenario.getCategories()); }
/** * Filters scenarios by their categories. * * @param scenarios the scenarios to filter. * @return the filtered scenarios. */ public List<ScenarioTestDoc> filterScenarios( final List<ScenarioTestDoc> scenarios) { final List<ScenarioTestDoc> filtered = new ArrayList<ScenarioTestDoc>(scenarios.size()); for (final ScenarioTestDoc scenario : scenarios) { final List<String> categories = scenario.getCategories(); if (acceptsAllOf(categories)) { filtered.add(scenario); } } return filtered; }
/** * {@inheritDoc} * * @see de.smartics.testdoc.maven.export.AbstractReportExporter#renderCategories(de.smartics.testdoc.report.doc.ScenarioTestDoc) */ @Override protected void renderCategories(final ScenarioTestDoc scenario) throws IOException { try { final List<String> categories = testDocHelper.filter(scenario.getCategories()); if (!categories.isEmpty()) { xmlWriter.writeStartElement(TESTDOC_NS, "categories"); for (final String category : categories) { writeElement("category", messages.getLabel(category)); } xmlWriter.writeEndElement(); } } catch (final XMLStreamException e) { throw new IOException("Cannot write categories.", e); } }
/** * {@inheritDoc} * * @see de.smartics.testdoc.maven.export.AbstractReportExporter#renderCategories(de.smartics.testdoc.report.doc.ScenarioTestDoc) */ @Override protected void renderCategories(final ScenarioTestDoc scenario) throws IOException { try { final List<String> categories = testDocHelper.filter(scenario.getCategories()); if (!categories.isEmpty()) { xmlWriter.writeStartElement(TESTDOC_NS, "categories"); for (final String category : categories) { writeElement("category", messages.getLabel(category)); } xmlWriter.writeEndElement(); } } catch (final XMLStreamException e) { throw new IOException("Cannot write categories.", e); } }
testDocHelper.filter(scenario.getCategories()); if (!categories.isEmpty())
testDocHelper.filter(scenario.getCategories()); if (!categories.isEmpty())