Package nl.stokpop.eventscheduler.api
Class EventAdapter<T extends EventContext>
- java.lang.Object
-
- nl.stokpop.eventscheduler.api.EventAdapter<T>
-
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
EventDefault
public abstract class EventAdapter<T extends EventContext> extends java.lang.Object implements Event
Adapter class with empty method implementations of the Event interface. Extend this class so you only have to implement the methods that are used. Always provide a proper name for an Event for traceability.
-
-
Field Summary
Fields Modifier and Type Field Description protected TeventContextprotected EventMessageBuseventMessageBusprotected EventLoggerlogger
-
Constructor Summary
Constructors Constructor Description EventAdapter(T context, EventLogger logger)Deprecated.EventAdapter(T context, EventMessageBus messageBus, EventLogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortTest()Called for test abort.voidafterTest()Called after the test run is done.voidbeforeTest()Called before the test run starts.EventCheckcheck()Called to check test results (for example the requirements are checked).voidcustomEvent(CustomEvent customEvent)Called for each custom event, according to the custom even schedule.java.lang.StringgetName()voidkeepAlive()Called for each keep alive event for this test run.static java.util.Set<java.lang.String>setOf(java.lang.String... items)Convenience method for the allowed properties or events.voidstartTest()Called when test run actually starts.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.stokpop.eventscheduler.api.Event
allowedCustomEvents
-
-
-
-
Field Detail
-
eventContext
protected final T extends EventContext eventContext
-
logger
protected final EventLogger logger
-
eventMessageBus
protected final EventMessageBus eventMessageBus
-
-
Constructor Detail
-
EventAdapter
public EventAdapter(T context, EventMessageBus messageBus, EventLogger logger)
-
EventAdapter
@Deprecated public EventAdapter(T context, EventLogger logger)
Deprecated.
-
-
Method Detail
-
beforeTest
public void beforeTest()
Description copied from interface:EventCalled before the test run starts. You can for instance cleanup the test environment and/or restart the server under test.- Specified by:
beforeTestin interfaceEvent
-
startTest
public void startTest()
Description copied from interface:EventCalled when test run actually starts.
-
afterTest
public void afterTest()
Description copied from interface:EventCalled after the test run is done. Use for instance to start creating a report of some sort or remove the test environment.
-
keepAlive
public void keepAlive()
Description copied from interface:EventCalled for each keep alive event for this test run.
-
abortTest
public void abortTest()
Description copied from interface:EventCalled for test abort.
-
check
public EventCheck check()
Description copied from interface:EventCalled to check test results (for example the requirements are checked). Can be used to have a test run fail or succeed in continuous integration setups.
-
customEvent
public void customEvent(CustomEvent customEvent)
Description copied from interface:EventCalled for each custom event, according to the custom even schedule.- Specified by:
customEventin interfaceEvent- Parameters:
customEvent- the custom event, use to execute specific behaviour in the event handler
-
getName
public final java.lang.String getName()
-
setOf
public static java.util.Set<java.lang.String> setOf(java.lang.String... items)
Convenience method for the allowed properties or events.- Parameters:
items- the allowed props or events- Returns:
- unmodifiable and ordered set of items
-
-