Search in sources :

Example 6 with Formatter

use of gherkin.formatter.Formatter in project cucumber-jvm by cucumber.

the class FormatterMissingLifecycleMethods method set_strict_on_strict_aware_formatters.

@Test
public void set_strict_on_strict_aware_formatters() throws Exception {
    PluginFactory factory = mock(PluginFactory.class);
    Formatter strictAwareFormatter = mock(Formatter.class, withSettings().extraInterfaces(StrictAware.class));
    when(factory.create("junit:out/dir")).thenReturn(strictAwareFormatter);
    RuntimeOptions options = new RuntimeOptions(new Env(), factory, asList("--strict", "--plugin", "junit:out/dir"));
    options.getPlugins();
    verify((StrictAware) strictAwareFormatter).setStrict(true);
}
Also used : Formatter(gherkin.formatter.Formatter) PluginFactory(cucumber.runtime.formatter.PluginFactory) StrictAware(cucumber.runtime.formatter.StrictAware) Test(org.junit.Test)

Example 7 with Formatter

use of gherkin.formatter.Formatter in project cucumber-jvm by cucumber.

the class JUnitReporterTest method createReporter.

private void createReporter(boolean strict, boolean allowStartedIgnored) {
    Formatter formatter = mock(Formatter.class);
    Reporter reporter = mock(Reporter.class);
    String allowStartedIgnoredOption = allowStartedIgnored ? "--allow-started-ignored" : "--no-allow-started-ignored";
    jUnitReporter = new JUnitReporter(reporter, formatter, strict, new JUnitOptions(asList(allowStartedIgnoredOption)));
}
Also used : Formatter(gherkin.formatter.Formatter) Reporter(gherkin.formatter.Reporter)

Example 8 with Formatter

use of gherkin.formatter.Formatter in project cucumber-jvm by cucumber.

the class TestNGCucumberRunner method finish.

public void finish() {
    Formatter formatter = runtimeOptions.formatter(classLoader);
    formatter.done();
    formatter.close();
    runtime.printSummary();
}
Also used : Formatter(gherkin.formatter.Formatter)

Aggregations

Formatter (gherkin.formatter.Formatter)8 Reporter (gherkin.formatter.Reporter)3 Test (org.junit.Test)3 StepDefinitionReporter (cucumber.api.StepDefinitionReporter)2 PluginFactory (cucumber.runtime.formatter.PluginFactory)2 CucumberFeature (cucumber.runtime.model.CucumberFeature)2 ColorAware (cucumber.runtime.formatter.ColorAware)1 StrictAware (cucumber.runtime.formatter.StrictAware)1 I18n (gherkin.I18n)1 FilterFormatter (gherkin.formatter.FilterFormatter)1 Background (gherkin.formatter.model.Background)1 Examples (gherkin.formatter.model.Examples)1 Feature (gherkin.formatter.model.Feature)1 Scenario (gherkin.formatter.model.Scenario)1 ScenarioOutline (gherkin.formatter.model.ScenarioOutline)1 Step (gherkin.formatter.model.Step)1 Parser (gherkin.parser.Parser)1 IOException (java.io.IOException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1