Package nl.stokpop.eventscheduler.api
Class EventAdapter
- java.lang.Object
-
- nl.stokpop.eventscheduler.api.EventAdapter
-
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
EventDefault
public abstract class EventAdapter 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 java.lang.StringeventNameprotected EventPropertieseventPropertiesprotected EventLoggerloggerprotected TestContexttestContext
-
Constructor Summary
Constructors Constructor Description EventAdapter(java.lang.String eventName, TestContext testContext, EventProperties eventProperties, 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.-
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, allowedProperties
-
-
-
-
Field Detail
-
eventName
protected final java.lang.String eventName
-
testContext
protected final TestContext testContext
-
eventProperties
protected final EventProperties eventProperties
-
logger
protected final EventLogger logger
-
-
Constructor Detail
-
EventAdapter
public EventAdapter(java.lang.String eventName, TestContext testContext, EventProperties eventProperties, EventLogger logger)
-
-
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
-
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
-
-