Package io.cucumber.core.eventbus
Class AbstractEventPublisher
java.lang.Object
io.cucumber.core.eventbus.AbstractEventPublisher
- All Implemented Interfaces:
EventPublisher
- Direct Known Subclasses:
AbstractEventBus,CanonicalOrderEventPublisher
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <T> voidregisterHandlerFor(Class<T> eventType, EventHandler<T> handler) Registers an event handler for a specific event.final <T> voidremoveHandlerFor(Class<T> eventType, EventHandler<T> handler) Unregister an event handler for a specific eventprotected <T> voidsend(T event) Send a single event.protected <T> voidSend all events.
-
Field Details
-
handlers
-
-
Constructor Details
-
AbstractEventPublisher
public AbstractEventPublisher()
-
-
Method Details
-
registerHandlerFor
Description copied from interface:EventPublisherRegisters an event handler for a specific event.The available events types are:
Event- all events.TestRunStarted- the first event sent.TestSourceRead- sent for each feature file read, contains the feature file source.SnippetsSuggestedEvent- sent for each step that could not be matched to a step definition, contains the raw snippets for the step.StepDefinedEvent- sent for each step definition as it is loaded, contains the StepDefinitionTestCaseStarted- sent before starting the execution of a Test Case(/Pickle/Scenario), contains the Test CaseTestStepStarted- sent before starting the execution of a Test Step, contains the Test StepEmbedEvent- calling scenario.attach in a hook triggers this event.WriteEvent- calling scenario.log in a hook triggers this event.TestStepFinished- sent after the execution of a Test Step, contains the Test Step and its Result.TestCaseFinished- sent after the execution of a Test Case(/Pickle/Scenario), contains the Test Case and its Result.TestRunFinished- the last event sent.
- Specified by:
registerHandlerForin interfaceEventPublisher- Type Parameters:
T- the event type- Parameters:
eventType- the event type for which the handler is being registeredhandler- the event handler- See Also:
-
removeHandlerFor
Description copied from interface:EventPublisherUnregister an event handler for a specific event- Specified by:
removeHandlerForin interfaceEventPublisher- Type Parameters:
T- the event type- Parameters:
eventType- the event type for which the handler is being registeredhandler- the event handler
-
sendAll
Send all events.May be overridden, but must be called.
-
send
protected <T> void send(T event) Send a single event.May be overridden, but must be called.
-