SubscriberBlackboxVerificationpublic interface SubscriberBlackboxVerificationRules
| Modifier and Type | Method | Description |
|---|---|---|
void |
required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() |
Asks for a
Subscriber instance, expects it to call request() in
a timely manner and signals as many onNext items as the very first request
amount specified by the Subscriber. |
void |
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() |
Asks for a
Subscriber, signals an onSubscribe followed by an onComplete synchronously,
and checks if neither request nor cancel was called from within the Subscriber's
onComplete implementation. |
void |
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() |
Asks for a
Subscriber, signals an onSubscribe followed by an onError synchronously,
and checks if neither request nor cancel was called from within the Subscriber's
onComplete implementation. |
void |
required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() |
Asks for a
Subscriber, signals onSubscribe twice synchronously and expects the second Subscription gets
cancelled in a timely manner and without any calls to its request method. |
void |
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() |
Asks for a
Subscriber and expects it to handle onComplete independent of whether the Subscriber
requests items or not. |
void |
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() |
Asks for a
Subscriber, expects it to request some amount and in turn be able to receive an onComplete
synchronously from the request call without any onNext signals before that. |
void |
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() |
Asks for a
Subscriber, signals onSubscribe followed by an onError synchronously. |
void |
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() |
Asks for a
Subscriber, signals onSubscribe followed by an onError synchronously. |
void |
required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull() |
Asks for a
Subscriber, signals an onSubscribe event followed by a
onError with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onError method. |
void |
required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() |
Asks for a
Subscriber, signals an onSubscribe event followed by a
onNext with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onNext method. |
void |
required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() |
Asks for a
Subscriber and signals an onSubscribe event with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onSubscribe method. |
void |
untested_spec202_blackbox_shouldAsynchronouslyDispatch() |
Currently, this test is skipped because there is no agreed upon approach how
to detect if the
Subscriber really goes async or just responds in
a timely manner. |
void |
untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() |
Currently, this test is skipped because there is no way to check what the
Subscriber "considers"
since rule §2.3 forbids interaction from within the onError and onComplete methods. |
void |
untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() |
Currently, this test is skipped because it requires more control over the
Subscriber implementation
to make it cancel the Subscription for some external condition. |
void |
untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() |
Currently, this test is skipped because it requires more control over the
Subscriber implementation
to issue requests based on external stimulus. |
void |
untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() |
Currently, this test is skipped because there is no way to make the
Subscriber implementation
cancel the test's Subscription and check the outcome of sending onNexts after such
cancel. |
void |
untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() |
Currently, this test is skipped because it would require analyzing what the
Subscriber implementation
does. |
void |
untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() |
Currently, this test is skipped because the test for
§2.5
is in a better position to test for handling the reuse of the same Subscriber. |
void |
untested_spec213_blackbox_failingOnSignalInvocation() |
Currently, this test is skipped because it would require more control over the
Subscriber to
fail internally in response to a set of legal event emissions, not throw any exception from the Subscriber
methods and have it cancel the Subscription. |
void |
untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() |
Currently, this test is skipped because there is no agreed upon way for specifying, enforcing and testing
a
Subscriber with an arbitrary context. |
void |
untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() |
Currently, this test is skipped because element production is the responsibility of the
Publisher and
a Subscription is not expected to be the active element in an established subscription. |
void |
untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() |
Currently, this test is skipped because element production is the responsibility of the
Publisher and
a Subscription is not expected to be the active element in an established subscription. |
void |
untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() |
Currently, this test is skipped because signal production is the responsibility of the
Publisher and
a Subscription is not expected to be the active element in an established subscription. |
void |
untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() |
Currently, this test is skipped because it is the responsibility of the
Publisher deal with the case
that all subscribers have cancelled their subscription. |
void |
untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() |
Currently, this test is skipped because it requires more control over the
Subscriber implementation
thus there is no way to detect that the Subscriber called its own onError method in response
to an exception thrown from Subscription.cancel. |
void |
untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() |
Currently, this test is skipped because it requires more control over the
Subscriber implementation
thus there is no way to detect that the Subscriber called its own onError method in response
to an exception thrown from Subscription.request. |
void required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws java.lang.Throwable
Subscriber instance, expects it to call request() in
a timely manner and signals as many onNext items as the very first request
amount specified by the Subscriber.
Verifies rule: 2.1
Notes:
Subscriber implementation
should not request too much.request amount is considered.onComplete after the first set of onNext signals
has been emitted and may cause resource leak in
Subscribers that expect a finite Publisher.Subscriber and emits the requested amount regardless.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber requires external stimulus to begin requesting; override the
SubscriberBlackboxVerification.triggerRequest(org.reactivestreams.Subscriber) method
in this case,TestEnvironment has large enough timeout specified in case the Subscriber has some time-delay behavior,Subscriber requests zero or a negative value in some circumstances,Subscriber throws an unchecked exception from its onSubscribe or
onNext methods.
java.lang.Throwablevoid untested_spec202_blackbox_shouldAsynchronouslyDispatch() throws java.lang.Exception
Subscriber really goes async or just responds in
a timely manner.
Verifies rule: 2.2
java.lang.Exceptionvoid required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws java.lang.Throwable
Subscriber, signals an onSubscribe followed by an onComplete synchronously,
and checks if neither request nor cancel was called from within the Subscriber's
onComplete implementation.
Verifies rule: 2.3
Notes:
request or cancel calls in the test's own Subscription.
If this test fails, the following could be checked within the Subscriber implementation:
request or cancel in response to an onComplete
directly or indirectly,Subscriber throws an unchecked exception from its onSubscribe or
onComplete methods.
java.lang.Throwablevoid required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws java.lang.Throwable
Subscriber, signals an onSubscribe followed by an onError synchronously,
and checks if neither request nor cancel was called from within the Subscriber's
onComplete implementation.
Verifies rule: 2.3
Notes:
request or cancel calls in the test's own Subscription.
If this test fails, the following could be checked within the Subscriber implementation:
request or cancel in response to an onError
directly or indirectly,Subscriber throws an unchecked exception from its onSubscribe or
onError methods.
java.lang.Throwablevoid untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws java.lang.Exception
Subscriber "considers"
since rule §2.3 forbids interaction from within the onError and onComplete methods.
Verifies rule: 2.4
Notes:
Subscription
within a grace period but such check is still not generally decisive.java.lang.Exceptionvoid required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws java.lang.Exception
Subscriber, signals onSubscribe twice synchronously and expects the second Subscription gets
cancelled in a timely manner and without any calls to its request method.
Verifies rule: 2.5
Notes:
onSubscribe and may cause resource leak in
Subscribers that expect a finite Publisher.
If this test fails, the following could be checked within the Subscriber implementation:
Subscribe.onSubscribe implementation actually tries to detect multiple calls to it,Subscription is cancelled asynchronously and that takes longer time than
the TestEnvironment's timeout permits.java.lang.Exceptionvoid untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() throws java.lang.Exception
Subscriber implementation
to make it cancel the Subscription for some external condition.
Verifies rule: 2.6
java.lang.Exceptionvoid untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws java.lang.Exception
Subscriber implementation
to issue requests based on external stimulus.
Verifies rule: 2.7
java.lang.Exceptionvoid untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws java.lang.Throwable
Subscriber implementation
cancel the test's Subscription and check the outcome of sending onNexts after such
cancel.
Verifies rule: 2.8
java.lang.Throwablevoid required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws java.lang.Throwable
Subscriber, expects it to request some amount and in turn be able to receive an onComplete
synchronously from the request call without any onNext signals before that.
Verifies rule: 2.9
Notes:
Subscriber.Subscription.request() must be externally synchronized, otherwise
such case results probabilistically in multiple onComplete calls by the test.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws an unchecked exception from its onSubscribe or
onComplete methods.
Subscriber requires external stimulus to begin requesting; override the
SubscriberBlackboxVerification.triggerRequest(org.reactivestreams.Subscriber) method
in this case,java.lang.Throwablevoid required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
Subscriber and expects it to handle onComplete independent of whether the Subscriber
requests items or not.
Verifies rule: 2.9
Notes:
onSubscribe on the Subscriber which violates §1.9.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws an unchecked exception from its onSubscribe or
onComplete methods.
java.lang.Throwablevoid required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws java.lang.Throwable
Subscriber, signals onSubscribe followed by an onError synchronously.
Verifies rule: 2.10
Notes:
Subscriber and emits the
onError signal anyway.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws an unchecked exception from its onSubscribe or
onError methods.
java.lang.Throwablevoid required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
Subscriber, signals onSubscribe followed by an onError synchronously.
Verifies rule: 2.10
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws an unchecked exception from its onSubscribe or
onError methods.
java.lang.Throwablevoid untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws java.lang.Exception
Subscriber implementation
does.
Verifies rule: 2.11
java.lang.Exceptionvoid untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() throws java.lang.Throwable
§2.5
is in a better position to test for handling the reuse of the same Subscriber.
Verifies rule: 2.12
Notes:
Publisher's subscription behavior.
java.lang.Throwablevoid untested_spec213_blackbox_failingOnSignalInvocation() throws java.lang.Exception
Subscriber to
fail internally in response to a set of legal event emissions, not throw any exception from the Subscriber
methods and have it cancel the Subscription.
Verifies rule: 2.13
java.lang.Exceptionvoid required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Subscriber and signals an onSubscribe event with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onSubscribe method.
Verifies rule: 2.13
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws a NullPointerException from its onSubscribe method
in response to a null parameter and not some other unchecked exception or no exception at all.
java.lang.Throwablevoid required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Subscriber, signals an onSubscribe event followed by a
onNext with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onNext method.
Verifies rule: 2.13
Notes:
Subscriber and emits the onNext
signal with a null parameter anyway.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws a NullPointerException from its onNext method
in response to a null parameter and not some other unchecked exception or no exception at all.
java.lang.Throwablevoid required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Subscriber, signals an onSubscribe event followed by a
onError with null as a parameter and
expects an immediate NullPointerException to be thrown by the Subscriber.onError method.
Verifies rule: 2.13
Notes:
Subscriber and emits the onError
signal with a null parameter anyway.
If this test fails, the following could be checked within the Subscriber implementation:
Subscriber throws a NullPointerException from its onNext method
in response to a null parameter and not some other unchecked exception or no exception at all.
java.lang.Throwablevoid untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() throws java.lang.Exception
Subscriber with an arbitrary context.
Verifies rule: 3.1
java.lang.Exceptionvoid untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() throws java.lang.Throwable
Publisher and
a Subscription is not expected to be the active element in an established subscription.
Verifies rule: 3.8
java.lang.Throwablevoid untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() throws java.lang.Exception
Publisher and
a Subscription is not expected to be the active element in an established subscription.
Verifies rule: 3.10
Notes:
java.lang.Exceptionvoid untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() throws java.lang.Exception
Publisher and
a Subscription is not expected to be the active element in an established subscription.
Verifies rule: 3.11
Notes:
java.lang.Exceptionvoid untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws java.lang.Exception
Publisher deal with the case
that all subscribers have cancelled their subscription.
Verifies rule: 3.14
Notes:
Publisher implementations
(most likely Processors) would coordinate with multiple Subscribers.java.lang.Exceptionvoid untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() throws java.lang.Exception
Subscriber implementation
thus there is no way to detect that the Subscriber called its own onError method in response
to an exception thrown from Subscription.cancel.
Verifies rule: 3.15
java.lang.Exceptionvoid untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws java.lang.Exception
Subscriber implementation
thus there is no way to detect that the Subscriber called its own onError method in response
to an exception thrown from Subscription.request.
Verifies rule: 3.16
java.lang.Exception