private void waitForReportGenerationToFinish(List<Future> tasks) { try { for (Future task : tasks) { task.get(); } } catch (InterruptedException | ExecutionException | CancellationException e) { throw new ReportGenerationFailedError( "Failed to generate configuration report", e); } }
private void generateFullReportFor(final TestOutcomes testOutcomes, final AcceptanceTestFullReporter reporter) { try { reporter.setOutputDirectory(outputDirectory); reporter.generateReportsFor(testOutcomes); } catch (Exception e) { throw new ReportGenerationFailedError( "Failed to generate reports using " + reporter, e); } } }
private void generateReportFor(final TestOutcome testOutcome, final TestOutcomes allTestOutcomes, final AcceptanceTestReporter reporter) { try { LOGGER.info(reporter + ": Generating report for test outcome: " + testOutcome.getCompleteName()); reporter.setOutputDirectory(outputDirectory); reporter.generateReportFor(testOutcome, allTestOutcomes); } catch (IOException e) { throw new ReportGenerationFailedError( "Failed to generate reports using " + reporter, e); } }
private void generateReportFor(final TestOutcome testOutcome, final AcceptanceTestReporter reporter) { try { LOGGER.debug(reporter + ": Generating report for test outcome: " + testOutcome.getCompleteName()); reporter.setOutputDirectory(outputDirectory); reporter.generateReportFor(testOutcome); } catch (Exception e) { throw new ReportGenerationFailedError( "Failed to generate reports using " + reporter, e); } }
private void generateReportFor(final TestOutcome testOutcome, final TestOutcomes allTestOutcomes, final AcceptanceTestReporter reporter) { try { LOGGER.info(reporter + ": Generating report for test outcome: " + testOutcome.getCompleteName()); reporter.setOutputDirectory(outputDirectory); reporter.generateReportFor(testOutcome, allTestOutcomes); } catch (IOException e) { throw new ReportGenerationFailedError( "Failed to generate reports using " + reporter, e); } }
/** * Store some configuration properties under output directory */ public void generateConfigurationsReport() { final Configuration configuration = ConfiguredEnvironment.getConfiguration(); Config config = ConfigFactory.empty(); config = config.withValue(ThucydidesSystemProperty.SERENITY_OUTPUT_DIRECTORY.preferredName(), ConfigValueFactory.fromAnyRef(configuration.getOutputDirectory().getAbsolutePath())); try { final boolean autoFlush = true; final Path flow = this.outputDirectory.toPath().resolve( ThucydidesSystemProperty.SERENITY_FLOW_REPORTS_DIR.preferredName()); final Path file = flow.resolve(ThucydidesSystemProperty.SERENITY_CONFIGURATION_REPORT.preferredName()); Files.createDirectories(flow); try (Writer writer = new PrintWriter(Files.newBufferedWriter(file, StandardCharsets.UTF_8), autoFlush)) { LOGGER.debug("Generating report for configuration"); writer.write(config.root().render(ConfigRenderOptions.concise().setJson(true))); } } catch (final Exception e) { throw new ReportGenerationFailedError( "Failed to generate configuration reports", e); } }