public final class TimeServiceEventBus extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<Class<? extends Event>,List<EventHandler>> |
handlers |
Constructor and Description |
---|
TimeServiceEventBus(TimeService stopWatch) |
Modifier and Type | Method and Description |
---|---|
Long |
getTime() |
<T extends Event> |
registerHandlerFor(Class<T> eventType,
EventHandler<T> handler)
Registers an event handler for a specific event.
|
<T extends Event> |
removeHandlerFor(Class<T> eventType,
EventHandler<T> handler)
Unregister an event handler for a specific event
|
void |
send(Event event) |
void |
sendAll(Iterable<Event> queue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
registerHandlerFor, removeHandlerFor
protected Map<Class<? extends Event>,List<EventHandler>> handlers
public TimeServiceEventBus(TimeService stopWatch)
public Long getTime()
public final <T extends Event> void registerHandlerFor(Class<T> eventType, EventHandler<T> handler)
EventPublisher
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.
TestCaseStarted
- sent before starting the execution of a Test Case(/Pickle/Scenario), contains the Test Case
TestStepStarted
- sent before starting the execution of a Test Step, contains the Test Step
EmbedEvent
- calling scenario.embed in a hook triggers this event.
WriteEvent
- calling scenario.write 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.
registerHandlerFor
in interface EventPublisher
T
- the event typeeventType
- the event type for which the handler is being registeredhandler
- the event handlerEvent
public final <T extends Event> void removeHandlerFor(Class<T> eventType, EventHandler<T> handler)
EventPublisher
removeHandlerFor
in interface EventPublisher
T
- the event typeeventType
- the event type for which the handler is being registeredhandler
- the event handlerCopyright © 2019. All rights reserved.