@Override public void setMonochrome(boolean monochrome) { if (monochrome) { formats = new MonochromeFormats(); } else { formats = new AnsiFormats(); } }
private void handleTestStepStarted(TestStepStarted event) { if (event.testStep instanceof PickleStepTestStep) { PickleStepTestStep testStep = (PickleStepTestStep) event.testStep; if (isFirstStepAfterBackground(testStep)) { jsFunctionCall("scenario", currentTestCaseMap); currentTestCaseMap = null; } jsFunctionCall("step", createTestStep(testStep)); jsFunctionCall("match", createMatchMap((PickleStepTestStep) event.testStep)); } }
private void handleTestCaseStarted(TestCaseStarted event) { handleStartOfFeature(event); handleScenarioOutline(event); if (testSources.hasBackground(currentFeatureFile, event.testCase.getLine())) { printBackground(event.testCase); currentTestCase = event.testCase; } else { printScenarioDefinition(event.testCase); } }
@Override public void receive(TestSourceRead event) { testSources.addTestSourceReadEvent(event.uri, event); } };
/** * Constructor * * @param out {@link Appendable} to print the result */ @SuppressWarnings("WeakerAccess") // Used by PluginFactory public UsageFormatter(Appendable out) { this.out = new NiceAppendable(out); addUsageStatisticStrategy("median", new MedianUsageStatisticStrategy()); addUsageStatisticStrategy("average", new AverageUsageStatisticStrategy()); }
private void handleTestCaseStarted(final TestCaseStarted event) { Thread currentThread = Thread.currentThread(); final Long threadId = currentThread.getId(); final TestData test = new TestData(event, threadId); allTests.put(getId(event), test); if (!allGroups.containsKey(threadId)) { allGroups.put(threadId, new GroupData(currentThread)); } }
private void printScenarioCounts(PrintStream out) { out.print(scenarioSubCounts.getTotal()); out.print(" Scenarios ("); printSubCounts(out, scenarioSubCounts); out.println(")"); }
private void handleTestStepStarted(TestStepStarted event) { if (event.testStep instanceof PickleStepTestStep) { if (isFirstStepAfterBackground((PickleStepTestStep) event.testStep)) { printScenarioDefinition(currentTestCase); currentTestCase = null; } } }
private void handleTestStepFinished(TestStepFinished event) { if (event.testStep instanceof PickleStepTestStep) { printStep((PickleStepTestStep) event.testStep, event.result); } printError(event.result); }
private List<StepContainer> createStepContainer(List<StepContainer> stepContainers) { for (StepContainer stepContainer : stepContainers) { stepContainer.aggregatedDurations = createAggregatedDurations(stepContainer); formatDurationAsSeconds(stepContainer.durations); } return stepContainers; }
private EventPublisher getOrderedEventPublisher() { // The ordered event publisher stores all events // so don't create it unless we need it. if(orderedEventPublisher == null){ orderedEventPublisher = createCanonicalOrderEventPublisher(); } return orderedEventPublisher; }
@Override public void setStrict(boolean strict) { stats.setStrict(strict); } }
public Plugins(ClassLoader classLoader, PluginFactory pluginFactory, EventPublisher eventPublisher, PluginOptions pluginOptions) { this.classLoader = classLoader; this.pluginFactory = pluginFactory; this.eventPublisher = eventPublisher; this.pluginOptions = pluginOptions; this.plugins = createPlugins(); }
@Override public void receive(TestStepFinished event) { handleTestStepFinished(event); } };
@Override public void receive(TestRunFinished event) { finishReport(); } };
private void printSubCounts(PrintStream out, SubCounts subCounts) { boolean addComma = false; addComma = printSubCount(out, subCounts.failed, Result.Type.FAILED, addComma); addComma = printSubCount(out, subCounts.ambiguous, Result.Type.AMBIGUOUS, addComma); addComma = printSubCount(out, subCounts.skipped, Result.Type.SKIPPED, addComma); addComma = printSubCount(out, subCounts.pending, Result.Type.PENDING, addComma); addComma = printSubCount(out, subCounts.undefined, Result.Type.UNDEFINED, addComma); addComma = printSubCount(out, subCounts.passed, Result.Type.PASSED, addComma); }
private void printNonZeroResultScenarios(PrintStream out) { printScenarios(out, failedScenarios, Result.Type.FAILED); printScenarios(out, ambiguousScenarios, Result.Type.AMBIGUOUS); if (strict) { printScenarios(out, pendingScenarios, Result.Type.PENDING); printScenarios(out, undefinedScenarios, Result.Type.UNDEFINED); } }
@Override public void setMonochrome(boolean monochrome) { if (monochrome) { formats = new MonochromeFormats(); } else { formats = new AnsiFormats(); } }
private void printStepCounts(PrintStream out) { out.print(stepSubCounts.getTotal()); out.print(" Steps ("); printSubCounts(out, stepSubCounts); out.println(")"); }