public TestOutcomes from(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader().forFormat(format); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
/** * Load the test outcomes from a given directory. * * @param reportDirectory An existing directory that contains the test outcomes in XML or JSON format. * @return The full list of test outcomes. * @throws java.io.IOException Thrown if the specified directory was invalid. */ public List<TestOutcome> loadFrom(final File reportDirectory) throws IOException { final AcceptanceTestLoader testOutcomeReporter = getOutcomeReporter(); List<File> reportFiles = getAllOutcomeFilesFrom(reportDirectory); final List<TestOutcome> testOutcomes = Collections.synchronizedList(new ArrayList<TestOutcome>()); for(File reportFile : reportFiles) { testOutcomes.addAll(testOutcomeReporter.loadReportFrom(reportFile).asSet()); } Collections.sort(testOutcomes, byTitle()); return ImmutableList.copyOf(testOutcomes); }
public static TestOutcomes testOutcomesIn(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader(); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
/** * Load the test outcomes from a given directory, sorted by Title * * @param reportDirectory An existing directory that contains the test outcomes in XML or JSON format. * @return The full list of test outcomes. * @throws ReportLoadingFailedError Thrown if the specified directory was invalid or loading finished with error. */ public List<TestOutcome> loadFrom(final File reportDirectory) throws ReportLoadingFailedError { try { final List<Callable<Set<TestOutcome>>> partitions = new ArrayList<>(); final AcceptanceTestLoader testOutcomeReporter = getOutcomeReporter(); for(File sourceFile : getAllOutcomeFilesFrom(reportDirectory)) { partitions.add(new TestOutcomeLoaderCallable(testOutcomeReporter,sourceFile)); } final ExecutorService executorPool = Executors.newFixedThreadPool(20);//NumberOfThreads.forIOOperations()); final List<Future<Set<TestOutcome>>> loadedTestOutcomes = executorPool.invokeAll(partitions); List<TestOutcome> testOutcomes = new ArrayList<>(); for(Future<Set<TestOutcome>> loadedTestOutcome : loadedTestOutcomes) { testOutcomes.addAll(loadedTestOutcome.get()); } executorPool.shutdown(); return inOrderOfTestExecution(testOutcomes); } catch (Exception e) { throw new ReportLoadingFailedError("Can not load reports for some reason", e); } }
private Optional<TestOutcomes> loadOutcomes() { TestOutcomes outcomes = null; try { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.JSON).from(outputDirectory); if (outcomes.getTotal() == 0) { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.XML).from(outputDirectory); } } catch (IOException e) { e.printStackTrace(); } return Optional.of(outcomes); } }
public TestOutcomeLoader forFormat(OutcomeFormat format) { return new TestOutcomeLoader(environmentVariables, new FormatConfiguration(format)); } /**
public static TestOutcomes testOutcomesIn(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader(); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
private Optional<TestOutcomes> loadOutcomes() { TestOutcomes outcomes = null; try { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.JSON).from(outputDirectory); if (outcomes.getTotal() == 0) { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.XML).from(outputDirectory); } } catch (IOException e) { e.printStackTrace(); } return Optional.of(outcomes); } }
public TestOutcomeLoader forFormat(OutcomeFormat format) { return new TestOutcomeLoader(environmentVariables, new FormatConfiguration(format)); } /**
public TestOutcomes from(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader().forFormat(format); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
/** * Load the test outcomes from a given directory. * * @param reportDirectory An existing directory that contains the test outcomes in XML or JSON format. * @return The full list of test outcomes. * @throws java.io.IOException Thrown if the specified directory was invalid. */ public List<TestOutcome> loadFrom(final File reportDirectory) throws IOException { final AcceptanceTestLoader testOutcomeReporter = getOutcomeReporter(); List<File> reportFiles = getAllOutcomeFilesFrom(reportDirectory); final List<TestOutcome> testOutcomes = Collections.synchronizedList(new ArrayList<TestOutcome>()); for(File reportFile : reportFiles) { testOutcomes.addAll(testOutcomeReporter.loadReportFrom(reportFile).asSet()); } Collections.sort(testOutcomes, byTitle()); return ImmutableList.copyOf(testOutcomes); }
public static TestOutcomes testOutcomesIn(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader(); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
private Optional<TestOutcomes> loadOutcomes() { TestOutcomes outcomes = null; try { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.JSON).from(outputDirectory); if (outcomes.getTotal() == 0) { outcomes = TestOutcomeLoader.loadTestOutcomes().inFormat(OutcomeFormat.XML).from(outputDirectory); } if (thereAreTagsIn(tags)) { outcomes = outcomes.withTags(tags); } } catch (IOException e) { e.printStackTrace(); } return Optional.ofNullable(outcomes); }
public TestOutcomeLoader forFormat(OutcomeFormat format) { return new TestOutcomeLoader(environmentVariables, new FormatConfiguration(format)); }
public TestOutcomes from(final File reportsDirectory) throws IOException { TestOutcomeLoader loader = new TestOutcomeLoader().forFormat(format); return TestOutcomes.of(loader.loadFrom(reportsDirectory)); }
private TestOutcomes loadTestOutcomesFrom(File sourceDirectory) throws IOException { return TestOutcomeLoader.loadTestOutcomes().inFormat(getFormat()).from(sourceDirectory).withHistory().withRequirementsTags(); }
private TestOutcomes loadTestOutcomesFrom(File sourceDirectory) throws IOException { return TestOutcomeLoader.loadTestOutcomes().inFormat(getFormat()).from(sourceDirectory).withHistory().withRequirementsTags(); }