Class SupportSubscriber
java.lang.Object
com.espertech.esper.runtime.client.scopetest.SupportSubscriber
Subscriber for that retains the events it receives for use in assertions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAsserts that exactly one insert stream event was received and no remove stream events, resets the listener clearing all state and returns the received event.Asserts that exactly one remove stream event was received and no insert stream events, resets the listener clearing all state and returns the received event.boolean
Returns true if the subscriber was invoked at least once and clears the invocation flag.Object[]
Returns the last array of events (insert stream) that were received and resets the subscriber.com.espertech.esper.common.internal.collection.UniformPair<Object[]>
Returns a pair of insert and remove stream event arrays considering the all invocations.Object[]
Returns the last array of events (insert stream) that were received.Object[]
Returns the last array of remove-stream events that were received.Get a list of all insert-stream event arrays received.Object[]
Returns an event array that represents all insert-stream events received so far.Get a list of all remove-stream event arrays received.Object[]
Returns an event array that represents all remove-stream events received so far.boolean
Returns true if the subscriber was invoked at least once.void
reset()
Reset subscriber, clearing all associated state.void
Receive events.
-
Constructor Details
-
SupportSubscriber
public SupportSubscriber()Ctor.
-
-
Method Details
-
update
Receive events.- Parameters:
newData
- insert streamoldData
- remove stream
-
reset
public void reset()Reset subscriber, clearing all associated state. -
getLastNewData
Returns the last array of events (insert stream) that were received.- Returns:
- insert stream events or null if either a null value was received or when no events have been received since the last reset
-
getAndResetLastNewData
Returns the last array of events (insert stream) that were received and resets the subscriber.- Returns:
- insert stream events or null if either a null value was received or when no events have been received since the last reset
-
assertOneGetNewAndReset
Asserts that exactly one insert stream event was received and no remove stream events, resets the listener clearing all state and returns the received event.- Returns:
- single insert-stream event
-
assertOneGetOldAndReset
Asserts that exactly one remove stream event was received and no insert stream events, resets the listener clearing all state and returns the received event.- Returns:
- single remove-stream event
-
getLastOldData
Returns the last array of remove-stream events that were received.- Returns:
- remove stream events or null if either a null value was received or when no events have been received since the last reset
-
getNewDataList
Get a list of all insert-stream event arrays received.- Returns:
- list of event arrays
-
getOldDataList
Get a list of all remove-stream event arrays received.- Returns:
- list of event arrays
-
isInvoked
public boolean isInvoked()Returns true if the subscriber was invoked at least once.- Returns:
- invoked flag
-
getAndClearIsInvoked
public boolean getAndClearIsInvoked()Returns true if the subscriber was invoked at least once and clears the invocation flag.- Returns:
- invoked flag
-
getNewDataListFlattened
Returns an event array that represents all insert-stream events received so far.- Returns:
- event array
-
getOldDataListFlattened
Returns an event array that represents all remove-stream events received so far.- Returns:
- event array
-
getDataListsFlattened
Returns a pair of insert and remove stream event arrays considering the all invocations.- Returns:
- pair of event arrays, the first in the pair is the insert stream data, the second in the pair is the remove stream data
-