Class EventHelper
- java.lang.Object
-
- org.apache.sling.commons.testing.jcr.EventHelper
-
- All Implemented Interfaces:
javax.jcr.observation.EventListener
public class EventHelper extends Object implements javax.jcr.observation.EventListener
Used by tests to wait until JCR notification events have been delivered.
-
-
Field Summary
Fields Modifier and Type Field Description static StringWAIT_NODE_FOLDERstatic StringWAIT_NODE_NODE
-
Constructor Summary
Constructors Constructor Description EventHelper(javax.jcr.Session s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Remove the event listener from the observation listener.voidonEvent(javax.jcr.observation.EventIterator it)voidwaitForEvents(long timeoutMsec)To make sure observation events have been delivered, create or delete a a node and wait for the corresponding events to be received.
-
-
-
Field Detail
-
WAIT_NODE_FOLDER
public static final String WAIT_NODE_FOLDER
- See Also:
- Constant Field Values
-
WAIT_NODE_NODE
public static final String WAIT_NODE_NODE
-
-
Method Detail
-
onEvent
public void onEvent(javax.jcr.observation.EventIterator it)
- Specified by:
onEventin interfacejavax.jcr.observation.EventListener
-
waitForEvents
public void waitForEvents(long timeoutMsec) throws javax.jcr.RepositoryExceptionTo make sure observation events have been delivered, create or delete a a node and wait for the corresponding events to be received.- Throws:
javax.jcr.RepositoryException
-
dispose
public void dispose()
Remove the event listener from the observation listener.
-
-