Search in sources :

Example 1 with Plugins

use of io.cucumber.core.plugin.Plugins in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method handles_null_summary_printer_backward_compatible.

@Test
void handles_null_summary_printer_backward_compatible() {
    RuntimeOptions options = parser.parse("--plugin", "null_summary", "--glue", "somewhere").build();
    Plugins plugins = new Plugins(new PluginFactory(), options);
    plugins.setEventBusOnEventListenerPlugins(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
    assertAll(() -> assertThat(logRecordListener.getLogRecords().get(0).getMessage(), is("Use '--no-summary' instead of '-p/--plugin null_summary'. '-p/--plugin null_summary' will be removed in a future release.")), () -> assertThat(plugins.getPlugins(), not(hasItem(plugin("io.cucumber.core.plugin.DefaultSummaryPrinter")))));
}
Also used : TimeServiceEventBus(io.cucumber.core.runtime.TimeServiceEventBus) PluginFactory(io.cucumber.core.plugin.PluginFactory) Plugins(io.cucumber.core.plugin.Plugins) Test(org.junit.jupiter.api.Test)

Example 2 with Plugins

use of io.cucumber.core.plugin.Plugins in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method creates_no_formatter_by_default.

@Test
void creates_no_formatter_by_default() {
    RuntimeOptions options = parser.parse().build();
    Plugins plugins = new Plugins(new PluginFactory(), options);
    plugins.setEventBusOnEventListenerPlugins(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
    assertThat(plugins.getPlugins(), is(empty()));
}
Also used : TimeServiceEventBus(io.cucumber.core.runtime.TimeServiceEventBus) PluginFactory(io.cucumber.core.plugin.PluginFactory) Plugins(io.cucumber.core.plugin.Plugins) Test(org.junit.jupiter.api.Test)

Example 3 with Plugins

use of io.cucumber.core.plugin.Plugins in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method creates_default_summary_printer_if_not_disabled.

@Test
void creates_default_summary_printer_if_not_disabled() {
    RuntimeOptions options = parser.parse().addDefaultSummaryPrinterIfNotDisabled().build();
    Plugins plugins = new Plugins(new PluginFactory(), options);
    plugins.setEventBusOnEventListenerPlugins(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
    assertThat(plugins.getPlugins(), hasItem(plugin("io.cucumber.core.plugin.DefaultSummaryPrinter")));
}
Also used : TimeServiceEventBus(io.cucumber.core.runtime.TimeServiceEventBus) PluginFactory(io.cucumber.core.plugin.PluginFactory) Plugins(io.cucumber.core.plugin.Plugins) Test(org.junit.jupiter.api.Test)

Example 4 with Plugins

use of io.cucumber.core.plugin.Plugins in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method replaces_incompatible_intellij_idea_plugin.

@Test
void replaces_incompatible_intellij_idea_plugin() {
    RuntimeOptions options = parser.parse("--plugin", "org.jetbrains.plugins.cucumber.java.run.CucumberJvm3SMFormatter").build();
    Plugins plugins = new Plugins(new PluginFactory(), options);
    plugins.setEventBusOnEventListenerPlugins(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
    assertThat(plugins.getPlugins(), not(hasItem(plugin("io.cucumber.core.plugin.PrettyPrinter"))));
}
Also used : TimeServiceEventBus(io.cucumber.core.runtime.TimeServiceEventBus) PluginFactory(io.cucumber.core.plugin.PluginFactory) Plugins(io.cucumber.core.plugin.Plugins) Test(org.junit.jupiter.api.Test)

Example 5 with Plugins

use of io.cucumber.core.plugin.Plugins in project cucumber-jvm by cucumber.

the class CommandlineOptionsParserTest method disables_default_summary_printer.

@Test
void disables_default_summary_printer() {
    RuntimeOptions options = parser.parse("--no-summary", "--glue", "somewhere").addDefaultSummaryPrinterIfNotDisabled().build();
    Plugins plugins = new Plugins(new PluginFactory(), options);
    plugins.setEventBusOnEventListenerPlugins(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
    assertAll(() -> assertThat(plugins.getPlugins(), not(hasItem(plugin("io.cucumber.core.plugin.DefaultSummaryPrinter")))));
}
Also used : TimeServiceEventBus(io.cucumber.core.runtime.TimeServiceEventBus) PluginFactory(io.cucumber.core.plugin.PluginFactory) Plugins(io.cucumber.core.plugin.Plugins) Test(org.junit.jupiter.api.Test)

Aggregations

PluginFactory (io.cucumber.core.plugin.PluginFactory)13 Plugins (io.cucumber.core.plugin.Plugins)13 TimeServiceEventBus (io.cucumber.core.runtime.TimeServiceEventBus)13 Test (org.junit.jupiter.api.Test)12 EventBus (io.cucumber.core.eventbus.EventBus)1 BackendServiceLoader (io.cucumber.core.runtime.BackendServiceLoader)1 BackendSupplier (io.cucumber.core.runtime.BackendSupplier)1 CucumberExecutionContext (io.cucumber.core.runtime.CucumberExecutionContext)1 ExitStatus (io.cucumber.core.runtime.ExitStatus)1 ObjectFactoryServiceLoader (io.cucumber.core.runtime.ObjectFactoryServiceLoader)1 ObjectFactorySupplier (io.cucumber.core.runtime.ObjectFactorySupplier)1 RunnerSupplier (io.cucumber.core.runtime.RunnerSupplier)1 SingletonObjectFactorySupplier (io.cucumber.core.runtime.SingletonObjectFactorySupplier)1 SingletonRunnerSupplier (io.cucumber.core.runtime.SingletonRunnerSupplier)1 ThreadLocalObjectFactorySupplier (io.cucumber.core.runtime.ThreadLocalObjectFactorySupplier)1 ThreadLocalRunnerSupplier (io.cucumber.core.runtime.ThreadLocalRunnerSupplier)1 Plugin (io.cucumber.plugin.Plugin)1