/** * Convenience constructor to create an instance with a filter that accepts * all categories and shows defaults. * * @param index the index of test documentation. */ public TestDocHelper(final UnitTestDocIndex index) { this(index, new ReportConfig()); }
/** * Returns the configuration of links to images used in reports. * * @return the configuration of links to images used in reports. */ public ImageHelper getImageHelper() { return config.getImageHelper(); }
/** * Returns the configuration that tells which report information is to be * displayed. * * @return the configuration that tells which report information is to be * displayed. */ public InformationFilter getInformationFilter() { return config.getInformationFilter(); }
/** * Filters scenarios by their categories according the the given report * configuration. * * @param scenarios the scenarios to filter. * @return the filtered scenarios. */ public List<ScenarioTestDoc> filterScenarios( final List<ScenarioTestDoc> scenarios) { return config.getSelectionFilter().filterScenarios(scenarios); }
/** * Returns the manager to access JUnit report information. Is * <code>null</code> if the information is not to be included. * * @return the manager to access JUnit report information. */ public JUnitTestCaseManager getJunitManager() { return config.getJunitManager(); }
/** * Returns the comparator to use to sort the rendering of unit test * documentation. * * @return the comparator to use to sort the rendering of unit test * documentation. */ public Comparator<UnitTestDoc> getUnitTestDocComparator() { return config.getUnitTestDocComparator(); }
/** * Returns the external reports to reference to. * * @return the external reports. */ public ExternalReportReferences getReports() { return config.getReports(); }
/** * Filters the given categories according the the given report configuration. * * @param categories the categories to be filtered. * @return a copy of the given <code>categories</code> containing only those * categories that are accepted. */ public List<String> filter(final List<String> categories) { return config.getSelectionFilter().filterCategories(categories); }
/** * Checks whether or not to include JUnit report information. * * @return <code>true</code> if the information is requested to be included, * <code>false</code> if it should be omitted. */ public boolean isJUnitReportInformationRequested() { return config.getJunitManager() != null; }
private ReportConfig createReportConfig() throws MavenReportException { final InformationFilter.Builder builder = new InformationFilter.Builder(); builder.setShowIndexOfIndices(showIndexOfIndices); builder.setShowNumbering(showNumbering); builder.setShowCategories(showCategories); builder.setShowTestCase(showTestCase); builder.setShowTestStatus(showTestStatus); final InformationFilter filter = builder.build(); final SelectionFilter selectionFilter = new SelectionFilter(includeCategories, excludeCategories); final Comparator<UnitTestDoc> comparator = createComparator(); final ReportConfig config = new ReportConfig(selectionFilter, filter, junitManager, imageHelper, reports, comparator); return config; }
private ReportConfig createReportConfig() throws MavenReportException { final InformationFilter.Builder builder = new InformationFilter.Builder(); builder.setShowIndexOfIndices(showIndexOfIndices); builder.setShowNumbering(showNumbering); builder.setShowCategories(showCategories); builder.setShowTestCase(showTestCase); builder.setShowTestStatus(showTestStatus); final InformationFilter filter = builder.build(); final SelectionFilter selectionFilter = new SelectionFilter(includeCategories, excludeCategories); final Comparator<UnitTestDoc> comparator = createComparator(); final ReportConfig config = new ReportConfig(selectionFilter, filter, junitManager, imageHelper, reports, comparator); return config; }