Package org.reactivestreams.tck
Class TestEnvironment.ManualSubscriber<T>
- java.lang.Object
-
- org.reactivestreams.tck.TestEnvironment.TestSubscriber<T>
-
- org.reactivestreams.tck.TestEnvironment.ManualSubscriber<T>
-
- All Implemented Interfaces:
Subscriber<T>
- Direct Known Subclasses:
TestEnvironment.ManualSubscriberWithSubscriptionSupport
- Enclosing class:
- TestEnvironment
public static class TestEnvironment.ManualSubscriber<T> extends TestEnvironment.TestSubscriber<T>
Subscriber
implementation which can be steered by test code and asserted on.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TestEnvironment.Receptacle<T>
received
-
Fields inherited from class org.reactivestreams.tck.TestEnvironment.TestSubscriber
env, subscription
-
-
Constructor Summary
Constructors Constructor Description ManualSubscriber(TestEnvironment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
expectCompletion()
void
expectCompletion(long timeoutMillis)
void
expectCompletion(long timeoutMillis, java.lang.String errorMsg)
void
expectCompletion(java.lang.String errorMsg)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected, long timeoutMillis)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis, java.lang.String errorMsg)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected, long timeoutMillis, java.lang.String errorMsg)
<E extends java.lang.Throwable>
EexpectError(java.lang.Class<E> expected, java.lang.String errorMsg)
<E extends java.lang.Throwable>
voidexpectErrorWithMessage(java.lang.Class<E> expected, java.lang.String requiredMessagePart)
<E extends java.lang.Throwable>
voidexpectErrorWithMessage(java.lang.Class<E> expected, java.lang.String requiredMessagePart, long timeoutMillis)
<E extends java.lang.Throwable>
voidexpectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives)
<E extends java.lang.Throwable>
voidexpectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives, long timeoutMillis)
<E extends java.lang.Throwable>
voidexpectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives, long totalTimeoutMillis, long pollTimeoutMillis)
void
expectNext(T expected)
void
expectNext(T expected, long timeoutMillis)
void
expectNone()
void
expectNone(long withinMillis)
void
expectNone(long withinMillis, java.lang.String errMsgPrefix)
void
expectNone(java.lang.String errMsgPrefix)
T
nextElement()
T
nextElement(long timeoutMillis)
T
nextElement(long timeoutMillis, java.lang.String errorMsg)
T
nextElement(java.lang.String errorMsg)
Optional<T>
nextElementOrEndOfStream()
Optional<T>
nextElementOrEndOfStream(long timeoutMillis)
Optional<T>
nextElementOrEndOfStream(long timeoutMillis, java.lang.String errorMsg)
java.util.List<T>
nextElements(long elements)
java.util.List<T>
nextElements(long elements, long timeoutMillis)
java.util.List<T>
nextElements(long elements, long timeoutMillis, java.lang.String errorMsg)
java.util.List<T>
nextElements(long elements, java.lang.String errorMsg)
void
onComplete()
Successful terminal state.void
onNext(T element)
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.void
request(long elements)
void
requestEndOfStream()
void
requestEndOfStream(long timeoutMillis)
void
requestEndOfStream(long timeoutMillis, java.lang.String errorMsg)
void
requestEndOfStream(java.lang.String errorMsg)
T
requestNextElement()
T
requestNextElement(long timeoutMillis)
T
requestNextElement(long timeoutMillis, java.lang.String errorMsg)
T
requestNextElement(java.lang.String errorMsg)
Optional<T>
requestNextElementOrEndOfStream()
Optional<T>
requestNextElementOrEndOfStream(long timeoutMillis)
Optional<T>
requestNextElementOrEndOfStream(long timeoutMillis, java.lang.String errorMsg)
Optional<T>
requestNextElementOrEndOfStream(java.lang.String errorMsg)
java.util.List<T>
requestNextElements(long elements)
java.util.List<T>
requestNextElements(long elements, long timeoutMillis)
java.util.List<T>
requestNextElements(long elements, long timeoutMillis, java.lang.String errorMsg)
-
Methods inherited from class org.reactivestreams.tck.TestEnvironment.TestSubscriber
cancel, onError, onSubscribe
-
-
-
-
Field Detail
-
received
TestEnvironment.Receptacle<T> received
-
-
Constructor Detail
-
ManualSubscriber
public ManualSubscriber(TestEnvironment env)
-
-
Method Detail
-
onNext
public void onNext(T element)
Description copied from interface:Subscriber
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.- Specified by:
onNext
in interfaceSubscriber<T>
- Overrides:
onNext
in classTestEnvironment.TestSubscriber<T>
- Parameters:
element
- the element signaled
-
onComplete
public void onComplete()
Description copied from interface:Subscriber
Successful terminal state.No further events will be sent even if
Subscription.request(long)
is invoked again.- Specified by:
onComplete
in interfaceSubscriber<T>
- Overrides:
onComplete
in classTestEnvironment.TestSubscriber<T>
-
request
public void request(long elements)
-
requestNextElement
public T requestNextElement() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElement
public T requestNextElement(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElement
public T requestNextElement(java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElement
public T requestNextElement(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElementOrEndOfStream
public Optional<T> requestNextElementOrEndOfStream() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElementOrEndOfStream
public Optional<T> requestNextElementOrEndOfStream(java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElementOrEndOfStream
public Optional<T> requestNextElementOrEndOfStream(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElementOrEndOfStream
public Optional<T> requestNextElementOrEndOfStream(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestEndOfStream
public void requestEndOfStream() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestEndOfStream
public void requestEndOfStream(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestEndOfStream
public void requestEndOfStream(java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestEndOfStream
public void requestEndOfStream(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElements
public java.util.List<T> requestNextElements(long elements) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElements
public java.util.List<T> requestNextElements(long elements, long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
requestNextElements
public java.util.List<T> requestNextElements(long elements, long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElement
public T nextElement() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElement
public T nextElement(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElement
public T nextElement(java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElement
public T nextElement(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElementOrEndOfStream
public Optional<T> nextElementOrEndOfStream() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElementOrEndOfStream
public Optional<T> nextElementOrEndOfStream(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElementOrEndOfStream
public Optional<T> nextElementOrEndOfStream(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElements
public java.util.List<T> nextElements(long elements) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElements
public java.util.List<T> nextElements(long elements, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElements
public java.util.List<T> nextElements(long elements, long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
nextElements
public java.util.List<T> nextElements(long elements, long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectNext
public void expectNext(T expected) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectNext
public void expectNext(T expected, long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectCompletion
public void expectCompletion() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectCompletion
public void expectCompletion(long timeoutMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectCompletion
public void expectCompletion(java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectCompletion
public void expectCompletion(long timeoutMillis, java.lang.String errorMsg) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectErrorWithMessage
public <E extends java.lang.Throwable> void expectErrorWithMessage(java.lang.Class<E> expected, java.lang.String requiredMessagePart) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectErrorWithMessage
public <E extends java.lang.Throwable> void expectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectErrorWithMessage
public <E extends java.lang.Throwable> void expectErrorWithMessage(java.lang.Class<E> expected, java.lang.String requiredMessagePart, long timeoutMillis) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectErrorWithMessage
public <E extends java.lang.Throwable> void expectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives, long timeoutMillis) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectErrorWithMessage
public <E extends java.lang.Throwable> void expectErrorWithMessage(java.lang.Class<E> expected, java.util.List<java.lang.String> requiredMessagePartAlternatives, long totalTimeoutMillis, long pollTimeoutMillis) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected, long timeoutMillis) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected, java.lang.String errorMsg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected, long timeoutMillis, java.lang.String errorMsg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectError
public <E extends java.lang.Throwable> E expectError(java.lang.Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis, java.lang.String errorMsg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
expectNone
public void expectNone() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectNone
public void expectNone(java.lang.String errMsgPrefix) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectNone
public void expectNone(long withinMillis) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
expectNone
public void expectNone(long withinMillis, java.lang.String errMsgPrefix) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-