/** * Default constructor. * * @param messages the resource bundles with messages to display as labels in * the generated report. * @param testDocHelper the value for testDocHelper. */ protected AbstractReportExporter(final MessageHelper messages, final TestDocHelper testDocHelper) { this.messages = messages; this.testDocHelper = testDocHelper; this.informationFilter = testDocHelper.getInformationFilter(); }
protected void renderTableEnd(final ScenarioTestDoc scenarioRepresentant) throws IOException { final Type testCaseType = scenarioRepresentant.getTestCaseType(); final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); junitManager.evict(testCaseType); }
@Override protected void renderJUnitStatus(final ScenarioTestDoc scenario) if (this.testDocHelper.isJUnitReportInformationRequested() && informationFilter.isShowTestStatus()) final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); final Type testCaseType = scenario.getTestCaseType(); final TestMethodDoc testMethod = scenario.getTestMethod(); testCase.getTestMethod(testMethodName); final ImageHelper images = testDocHelper.getImageHelper(); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
testDocHelper.filterScenarios(testDoc.getScenarios()); final ExternalReportReferences reports = testDocHelper.getReports(); renderTestDocUutReportLinks(type, reports);
final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); final Type testCaseType = scenario.getTestCaseType(); final TestMethodDoc testMethod = scenario.getTestMethod(); testCase.getTestMethod(testMethodName); final ImageHelper images = testDocHelper.getImageHelper(); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
/** * {@inheritDoc} * * @see de.smartics.testdoc.maven.export.AbstractReportExporter#renderTestCase(de.smartics.testdoc.report.doc.ScenarioTestDoc) */ @Override protected void renderTestCase(final ScenarioTestDoc scenario) throws IOException { try { final TestMethodDoc testMethodDoc = scenario.getTestMethod(); final Type type = scenario.getTestCaseType(); xmlWriter.writeStartElement(TESTDOC_NS, "test-case"); writeType(type); final ExternalReportReferences refs = testDocHelper.getReports(); renderReports(type, refs.getTestCaseReports(), testMethodDoc); xmlWriter.writeEndElement(); } catch (final XMLStreamException e) { throw new IOException("Cannot write test case.", 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); } }
private void renderJunitHeader() { if (this.testDocHelper.isJUnitReportInformationRequested() && informationFilter.isShowTestStatus()) { sink.tableHeaderCell(messages .getLabel("report.table.header.junitestcase.width")); final String label = messages.getLabel("report.table.header.junitestcase"); sink.text(label); sink.tableHeaderCell_(); } }
protected void exportIndex(final Locale locale) throws MavenReportException { try { final List<ExportIndex> exportIndices = createExportIndices(); final UnitTestDocIndex index = testDocHelper.getIndex(); if (formats == null || formats.contains("site")) { exportSinkReport(exportIndices, index); } if (formats != null && formats.contains("xml")) { exportXmlReport(exportIndices, index); } } catch (IOException e) { throw new MavenReportException("Cannot generate testdoc XML files.", e); } }
/** * Default constructor. * * @param reportName the name of the report to export. * @param messages the resource bundles with messages to display as labels in * the generated report. * @param exporter the exporter that knows the format of the file to be * written. * @param exportIndices the indices to created. */ protected AbstractOutputManager(final String reportName, final MessageHelper messages, final AbstractReportExporter exporter, final List<ExportIndex> exportIndices) { this.reportName = reportName; this.messages = messages; this.exporter = exporter; this.testDocs = new TreeSet<UnitTestDoc>(exporter.getTestDocHelper() .getUnitTestDocComparator()); for (final ExportIndex exportIndex : exportIndices) { index.addIndex(exportIndex); } }
/** * {@inheritDoc} */ @Override protected void executeReport(final Locale locale) throws MavenReportException { if (canGenerateReport()) { super.executeReport(locale); final IndexProvider indexChecker = new IndexProvider(serOutputDirectory); final ReportConfig reportConfig = createReportConfig(); testDocHelper = indexChecker.createHelper(reportConfig); if (testDocHelper.isIndexProvided()) { exportIndex(locale); } else { getLog().info( "No test doc information found, no report will be generated."); } } else { getLog().debug("Skipping testdoc report."); } }
@Override protected void renderJUnitStatus(final ScenarioTestDoc scenario) if (this.testDocHelper.isJUnitReportInformationRequested() && informationFilter.isShowTestStatus()) final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); final Type testCaseType = scenario.getTestCaseType(); final TestMethodDoc testMethod = scenario.getTestMethod(); testCase.getTestMethod(testMethodName); final ImageHelper images = testDocHelper.getImageHelper(); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
testDocHelper.filterScenarios(testDoc.getScenarios()); final ExternalReportReferences reports = testDocHelper.getReports(); renderTestDocUutReportLinks(type, reports);
final JUnitTestCaseManager junitManager = testDocHelper.getJunitManager(); final Type testCaseType = scenario.getTestCaseType(); final TestMethodDoc testMethod = scenario.getTestMethod(); testCase.getTestMethod(testMethodName); final ImageHelper images = testDocHelper.getImageHelper(); final ResultType resultType = method.getResultType(); final String link = images.getImageLink(resultType);
/** * {@inheritDoc} * * @see de.smartics.testdoc.maven.export.AbstractReportExporter#renderTestCase(de.smartics.testdoc.report.doc.ScenarioTestDoc) */ @Override protected void renderTestCase(final ScenarioTestDoc scenario) throws IOException { try { final TestMethodDoc testMethodDoc = scenario.getTestMethod(); final Type type = scenario.getTestCaseType(); xmlWriter.writeStartElement(TESTDOC_NS, "test-case"); writeType(type); final ExternalReportReferences refs = testDocHelper.getReports(); renderReports(type, refs.getTestCaseReports(), testMethodDoc); xmlWriter.writeEndElement(); } catch (final XMLStreamException e) { throw new IOException("Cannot write test case.", 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); } }
private void renderJunitHeader() { if (this.testDocHelper.isJUnitReportInformationRequested() && informationFilter.isShowTestStatus()) { sink.tableHeaderCell(messages .getLabel("report.table.header.junitestcase.width")); final String label = messages.getLabel("report.table.header.junitestcase"); sink.text(label); sink.tableHeaderCell_(); } }
protected void exportIndex(final Locale locale) throws MavenReportException { try { final List<ExportIndex> exportIndices = createExportIndices(); final UnitTestDocIndex index = testDocHelper.getIndex(); if (formats == null || formats.contains("site")) { exportSinkReport(exportIndices, index); } if (formats != null && formats.contains("xml")) { exportXmlReport(exportIndices, index); } } catch (IOException e) { throw new MavenReportException("Cannot generate testdoc XML files.", e); } }
/** * Default constructor. * * @param reportName the name of the report to export. * @param messages the resource bundles with messages to display as labels in * the generated report. * @param exporter the exporter that knows the format of the file to be * written. * @param exportIndices the indices to created. */ protected AbstractOutputManager(final String reportName, final MessageHelper messages, final AbstractReportExporter exporter, final List<ExportIndex> exportIndices) { this.reportName = reportName; this.messages = messages; this.exporter = exporter; this.testDocs = new TreeSet<UnitTestDoc>(exporter.getTestDocHelper() .getUnitTestDocComparator()); for (final ExportIndex exportIndex : exportIndices) { index.addIndex(exportIndex); } }
/** * {@inheritDoc} */ @Override protected void executeReport(final Locale locale) throws MavenReportException { if (canGenerateReport()) { super.executeReport(locale); final IndexProvider indexChecker = new IndexProvider(serOutputDirectory); final ReportConfig reportConfig = createReportConfig(); testDocHelper = indexChecker.createHelper(reportConfig); if (testDocHelper.isIndexProvided()) { exportIndex(locale); } else { getLog().info( "No test doc information found, no report will be generated."); } } else { getLog().debug("Skipping testdoc report."); } }