### Question:
AllureReportGenerator { public void generate(File outputDirectory) { ReportWriter writer = new ReportWriter(outputDirectory); generate(writer); } AllureReportGenerator(File... inputDirectories);  AllureReportGenerator(ClassLoader pluginClassLoader, File... inputDirectories);   AllureReportGenerator(AbstractModule module); void generate(File outputDirectory); void generate(ReportWriter writer);  }### Answer:
@Test public void shouldGenerateWithoutFailures() throws Exception { AllureReportGenerator generator = new AllureReportGenerator(new File("target/allure-results")); File outputDirectory = folder.newFolder(); generator.generate(outputDirectory); Path dataDirectory = outputDirectory.toPath().resolve(ReportWriter.DATA_DIRECTORY_NAME); assertTrue("Data directory should be created", Files.exists(dataDirectory)); assertThat(dataDirectory, contains("xunit.json")); assertThat(dataDirectory, contains("timeline.json")); assertThat(dataDirectory, contains("behaviors.json")); assertThat(dataDirectory, contains("defects.json")); assertThat(dataDirectory, contains("graph.json")); assertThat(dataDirectory, contains(PluginManager.WIDGETS_JSON)); assertThat(dataDirectory, contains(ReportWriter.REPORT_JSON)); assertThat(dataDirectory, hasFilesCount(15, "*-attachment*")); assertThat(dataDirectory, hasFilesCount(321, "*-testcase.json")); }
@Test(expected = ReportGenerationException.class) public void shouldFailIfNoResults() throws Exception { AllureReportGenerator generator = new AllureReportGenerator(folder.newFolder()); generator.generate(folder.newFolder()); }
@Test(expected = ReportGenerationException.class) public void shouldFailIfNoResultsDirectory() throws Exception { AllureReportGenerator generator = new AllureReportGenerator( new File(folder.newFolder(), "unknown-directory")); generator.generate(folder.newFolder()); }