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); } } }
/** * The default reporters applicable for standard test runs. */ public static List<AcceptanceTestFullReporter> getDefaultFullReporters() { List<AcceptanceTestFullReporter> reporters = new ArrayList<>(); FormatConfiguration formatConfiguration = new FormatConfiguration(Injectors.getInjector().getProvider(EnvironmentVariables.class).get()); ServiceLoader<AcceptanceTestFullReporter> reporterServiceLoader = ServiceLoader.load(AcceptanceTestFullReporter.class); Iterator<AcceptanceTestFullReporter> reporterImplementations = reporterServiceLoader.iterator(); LOGGER.debug("Reporting formats: " + formatConfiguration.getFormats()); while (reporterImplementations.hasNext()) { AcceptanceTestFullReporter reporter = reporterImplementations.next(); LOGGER.debug("Found reporter: " + reporter + "(format = " + reporter.getFormat() + ")"); if (!reporter.getFormat().isPresent() || formatConfiguration.getFormats().contains(reporter.getFormat().get())) { LOGGER.debug("Registering reporter: " + reporter); reporters.add(reporter); } } return reporters; }