Class TestEnvironment.ManualPublisher<T>
java.lang.Object
org.reactivestreams.tck.TestEnvironment.ManualPublisher<T>
- All Implemented Interfaces:
Publisher<T>
- Direct Known Subclasses:
IdentityProcessorVerification.TestSetup, SubscriberBlackboxVerification.BlackboxTestStage, SubscriberWhiteboxVerification.WhiteboxTestStage
- Enclosing class:
TestEnvironment
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TestEnvironment.Latchprotected final TestEnvironmentprotected longprotected final TestEnvironment.Receptacle<Long> protected TestEnvironment.Promise<Subscriber<? super T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidexpectCancelling(long timeoutMillis) voidexpectExactRequest(long expected) voidexpectExactRequest(long expected, long timeoutMillis) voidvoidexpectNoRequest(long timeoutMillis) longlongexpectRequest(long timeoutMillis) longexpectRequest(long timeoutMillis, String errorMessageAddendum) booleanvoidvoidvoidvoidsubscribe(Subscriber<? super T> s) RequestPublisherto start streaming data.
-
Field Details
-
env
-
pendingDemand
protected long pendingDemand -
subscriber
-
requests
-
cancelled
-
-
Constructor Details
-
ManualPublisher
-
-
Method Details
-
subscribe
Description copied from interface:PublisherRequestPublisherto start streaming data.This is a "factory method" and can be called multiple times, each time starting a new
Subscription.Each
Subscriptionwill work for only a singleSubscriber.A
Subscribershould only subscribe once to a singlePublisher.If the
Publisherrejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(Throwable).- Specified by:
subscribein interfacePublisher<T>- Parameters:
s- theSubscriberthat will consume signals from thisPublisher
-
sendNext
-
sendCompletion
public void sendCompletion() -
sendError
-
expectRequest
- Throws:
InterruptedException
-
expectRequest
- Throws:
InterruptedException
-
expectRequest
public long expectRequest(long timeoutMillis, String errorMessageAddendum) throws InterruptedException - Throws:
InterruptedException
-
expectExactRequest
- Throws:
InterruptedException
-
expectExactRequest
- Throws:
InterruptedException
-
expectNoRequest
- Throws:
InterruptedException
-
expectNoRequest
- Throws:
InterruptedException
-
expectCancelling
- Throws:
InterruptedException
-
expectCancelling
- Throws:
InterruptedException
-
isCancelled
- Throws:
InterruptedException
-