Class EventResult
- java.lang.Object
-
- org.apache.jackrabbit.test.api.observation.EventResult
-
- All Implemented Interfaces:
EventListener
public class EventResult extends Object implements EventListener
Utility class forEventretrieval with anEventListener.The
getEventIterator(long)andgetEvents(long)methods will block until an event is delivered and then return the events. Note, that only one of the methods can be called for an expected event delivery. Calling the 'other' method will block until the next events are delivered.
-
-
Constructor Summary
Constructors Constructor Description EventResult(PrintWriter log)Creates a newEventResult.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventIteratorgetEventIterator(long wait)Gets the events from the EventListener.Event[]getEvents(long wait)Gets the events from the EventListener.voidonEvent(EventIterator events)Called when events are delivered.
-
-
-
Constructor Detail
-
EventResult
public EventResult(PrintWriter log)
Creates a newEventResult.- Parameters:
log- log messages are written to thisLogger.
-
-
Method Detail
-
getEvents
public Event[] getEvents(long wait)
Gets the events from the EventListener. Waits at mostwaitmilliseconds for the events.If the events are not delivered within
waittime an empty array is returned and a log message is written.- Parameters:
wait- time in milliseconds to wait at most forEvents.- Returns:
Events.
-
getEventIterator
public EventIterator getEventIterator(long wait)
Gets the events from the EventListener. Waits at mostwaitmilliseconds for the events.If the events are not delivered within
waittimenullis returned and a log message is written.- Parameters:
wait- time in milliseconds to wait at most forEventIterator.- Returns:
EventIterator.
-
onEvent
public void onEvent(EventIterator events)
Called when events are delivered.- Specified by:
onEventin interfaceEventListener- Parameters:
events- the events.
-
-