public void generateReports() throws IOException { generateReports(NO_SOURCE_FILE); }
private void setupOutputDirectoryIfRequired() { if (getOutputDirectory() != null) { getOutputDirectory().mkdirs(); } }
private void generateReportsFor(List<TestOutcome> outcomes) throws IOException { TestOutcomes allOutcomes = TestOutcomes.of(outcomes); for (TestOutcome outcome : allOutcomes.getOutcomes()) { if (shouldGenerate(OutcomeFormat.XML)) { getXMLReporter().generateReportFor(outcome, allOutcomes); } if (shouldGenerate(OutcomeFormat.JSON)) { getJsonReporter().generateReportFor(outcome, allOutcomes); } getHTMLReporter().generateReportFor(outcome, allOutcomes); } }
public void generateReports(Optional<File> sourceDirectory) throws IOException { setupOutputDirectoryIfRequired(); for (TestOutcomeAdaptor adaptor : adaptors) { List<TestOutcome> outcomes = sourceDirectory.isPresent() ? adaptor.loadOutcomesFrom(sourceDirectory.get()) : adaptor.loadOutcomes(); generateReportsFor(outcomes); } }
@Override public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Importing external test reports"); getLog().info("Source directory: " + source); getLog().info("Output directory: " + getOutputDirectory()); try { getLog().info("Adaptor: " + adaptorService.getAdaptor(format)); reporter.registerAdaptor(adaptorService.getAdaptor(format)); reporter.setOutputDirectory(outputDirectory); reporter.generateReportsFrom(source); } catch (IOException e) { throw new MojoExecutionException(e.getMessage()); } } }
private void generateReportsFor(List<TestOutcome> outcomes) throws IOException { TestOutcomes allOutcomes = TestOutcomes.of(outcomes); for (TestOutcome outcome : allOutcomes.getOutcomes()) { if (shouldGenerate(OutcomeFormat.XML)) { getXMLReporter().generateReportFor(outcome, allOutcomes); } if (shouldGenerate(OutcomeFormat.JSON)) { getJsonReporter().generateReportFor(outcome, allOutcomes); } getHTMLReporter().generateReportFor(outcome, allOutcomes); } }
public void generateReports(Optional<File> sourceDirectory) throws IOException { setupOutputDirectoryIfRequired(); for (TestOutcomeAdaptor adaptor : adaptors) { List<TestOutcome> outcomes = sourceDirectory.isPresent() ? adaptor.loadOutcomesFrom(sourceDirectory.get()) : adaptor.loadOutcomes(); generateReportsFor(outcomes); } }
private void setupOutputDirectoryIfRequired() { if (getOutputDirectory() != null) { getOutputDirectory().mkdirs(); } }
public void generateReports() throws IOException { generateReports(NO_SOURCE_FILE); }
private AcceptanceTestReporter getHTMLReporter() { HtmlAcceptanceTestReporter reporter = new HtmlAcceptanceTestReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }
/** * @param sourceDirectory * @throws IOException */ public void generateReportsFrom(File sourceDirectory) throws IOException { generateReports(Optional.fromNullable(sourceDirectory)); }
private AcceptanceTestReporter getXMLReporter() { XMLTestOutcomeReporter reporter = new XMLTestOutcomeReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }
/** * @param sourceDirectory * @throws IOException */ public void generateReportsFrom(File sourceDirectory) throws IOException { generateReports(Optional.fromNullable(sourceDirectory)); }
private AcceptanceTestReporter getHTMLReporter() { HtmlAcceptanceTestReporter reporter = new HtmlAcceptanceTestReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }
private AcceptanceTestReporter getJsonReporter() { JSONTestOutcomeReporter reporter = new JSONTestOutcomeReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }
private AcceptanceTestReporter getXMLReporter() { XMLTestOutcomeReporter reporter = new XMLTestOutcomeReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }
private AcceptanceTestReporter getJsonReporter() { JSONTestOutcomeReporter reporter = new JSONTestOutcomeReporter(); reporter.setOutputDirectory(getOutputDirectory()); return reporter; }