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
Subscriber
implementation which can be steered by test code and asserted on.-
Field Summary
FieldsFields inherited from class org.reactivestreams.tck.TestEnvironment.TestSubscriber
env, subscription
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
expectCompletion
(long timeoutMillis) void
expectCompletion
(long timeoutMillis, String errorMsg) void
expectCompletion
(String errorMsg) <E extends Throwable>
EexpectError
(Class<E> expected) <E extends Throwable>
EexpectError
(Class<E> expected, long timeoutMillis) <E extends Throwable>
EexpectError
(Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis) <E extends Throwable>
EexpectError
(Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis, String errorMsg) <E extends Throwable>
EexpectError
(Class<E> expected, long timeoutMillis, String errorMsg) <E extends Throwable>
EexpectError
(Class<E> expected, String errorMsg) <E extends Throwable>
voidexpectErrorWithMessage
(Class<E> expected, String requiredMessagePart) <E extends Throwable>
voidexpectErrorWithMessage
(Class<E> expected, String requiredMessagePart, long timeoutMillis) <E extends Throwable>
voidexpectErrorWithMessage
(Class<E> expected, List<String> requiredMessagePartAlternatives) <E extends Throwable>
voidexpectErrorWithMessage
(Class<E> expected, List<String> requiredMessagePartAlternatives, long timeoutMillis) <E extends Throwable>
voidexpectErrorWithMessage
(Class<E> expected, List<String> requiredMessagePartAlternatives, long totalTimeoutMillis, long pollTimeoutMillis) void
expectNext
(T expected) void
expectNext
(T expected, long timeoutMillis) void
void
expectNone
(long withinMillis) void
expectNone
(long withinMillis, String errMsgPrefix) void
expectNone
(String errMsgPrefix) nextElement
(long timeoutMillis) nextElement
(long timeoutMillis, String errorMsg) nextElement
(String errorMsg) nextElementOrEndOfStream
(long timeoutMillis) nextElementOrEndOfStream
(long timeoutMillis, String errorMsg) nextElements
(long elements) nextElements
(long elements, long timeoutMillis) nextElements
(long elements, long timeoutMillis, String errorMsg) nextElements
(long elements, String errorMsg) void
Successful terminal state.void
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.void
request
(long elements) void
void
requestEndOfStream
(long timeoutMillis) void
requestEndOfStream
(long timeoutMillis, String errorMsg) void
requestEndOfStream
(String errorMsg) requestNextElement
(long timeoutMillis) requestNextElement
(long timeoutMillis, String errorMsg) requestNextElement
(String errorMsg) requestNextElementOrEndOfStream
(long timeoutMillis) requestNextElementOrEndOfStream
(long timeoutMillis, String errorMsg) requestNextElementOrEndOfStream
(String errorMsg) requestNextElements
(long elements) requestNextElements
(long elements, long timeoutMillis) requestNextElements
(long elements, long timeoutMillis, String errorMsg) Methods inherited from class org.reactivestreams.tck.TestEnvironment.TestSubscriber
cancel, onError, onSubscribe
-
Field Details
-
received
TestEnvironment.Receptacle<T> received
-
-
Constructor Details
-
ManualSubscriber
-
-
Method Details
-
onNext
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
- Throws:
InterruptedException
-
requestNextElement
- Throws:
InterruptedException
-
requestNextElement
- Throws:
InterruptedException
-
requestNextElement
- Throws:
InterruptedException
-
requestNextElementOrEndOfStream
- Throws:
InterruptedException
-
requestNextElementOrEndOfStream
- Throws:
InterruptedException
-
requestNextElementOrEndOfStream
- Throws:
InterruptedException
-
requestNextElementOrEndOfStream
public Optional<T> requestNextElementOrEndOfStream(long timeoutMillis, String errorMsg) throws InterruptedException - Throws:
InterruptedException
-
requestEndOfStream
- Throws:
InterruptedException
-
requestEndOfStream
- Throws:
InterruptedException
-
requestEndOfStream
- Throws:
InterruptedException
-
requestEndOfStream
- Throws:
InterruptedException
-
requestNextElements
- Throws:
InterruptedException
-
requestNextElements
- Throws:
InterruptedException
-
requestNextElements
public List<T> requestNextElements(long elements, long timeoutMillis, String errorMsg) throws InterruptedException - Throws:
InterruptedException
-
nextElement
- Throws:
InterruptedException
-
nextElement
- Throws:
InterruptedException
-
nextElement
- Throws:
InterruptedException
-
nextElement
- Throws:
InterruptedException
-
nextElementOrEndOfStream
- Throws:
InterruptedException
-
nextElementOrEndOfStream
- Throws:
InterruptedException
-
nextElementOrEndOfStream
public Optional<T> nextElementOrEndOfStream(long timeoutMillis, String errorMsg) throws InterruptedException - Throws:
InterruptedException
-
nextElements
- Throws:
InterruptedException
-
nextElements
- Throws:
InterruptedException
-
nextElements
- Throws:
InterruptedException
-
nextElements
public List<T> nextElements(long elements, long timeoutMillis, String errorMsg) throws InterruptedException - Throws:
InterruptedException
-
expectNext
- Throws:
InterruptedException
-
expectNext
- Throws:
InterruptedException
-
expectCompletion
- Throws:
InterruptedException
-
expectCompletion
- Throws:
InterruptedException
-
expectCompletion
- Throws:
InterruptedException
-
expectCompletion
- Throws:
InterruptedException
-
expectErrorWithMessage
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, String requiredMessagePart) throws Exception - Throws:
Exception
-
expectErrorWithMessage
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, List<String> requiredMessagePartAlternatives) throws Exception - Throws:
Exception
-
expectErrorWithMessage
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, String requiredMessagePart, long timeoutMillis) throws Exception - Throws:
Exception
-
expectErrorWithMessage
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, List<String> requiredMessagePartAlternatives, long timeoutMillis) throws Exception - Throws:
Exception
-
expectErrorWithMessage
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, List<String> requiredMessagePartAlternatives, long totalTimeoutMillis, long pollTimeoutMillis) throws Exception - Throws:
Exception
-
expectError
- Throws:
Exception
-
expectError
- Throws:
Exception
-
expectError
- Throws:
Exception
-
expectError
public <E extends Throwable> E expectError(Class<E> expected, long timeoutMillis, String errorMsg) throws Exception - Throws:
Exception
-
expectError
public <E extends Throwable> E expectError(Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis) throws Exception - Throws:
Exception
-
expectError
public <E extends Throwable> E expectError(Class<E> expected, long totalTimeoutMillis, long pollTimeoutMillis, String errorMsg) throws Exception - Throws:
Exception
-
expectNone
- Throws:
InterruptedException
-
expectNone
- Throws:
InterruptedException
-
expectNone
- Throws:
InterruptedException
-
expectNone
- Throws:
InterruptedException
-