Class SubscriberBlackboxVerification<T>
- java.lang.Object
-
- org.reactivestreams.tck.WithHelperPublisher<T>
-
- org.reactivestreams.tck.SubscriberBlackboxVerification<T>
-
- All Implemented Interfaces:
SubscriberBlackboxVerificationRules
public abstract class SubscriberBlackboxVerification<T> extends WithHelperPublisher<T> implements SubscriberBlackboxVerificationRules
Provides tests for verifyingSubscriber
andSubscription
specification rules, without any modifications to the tested implementation (also known as "Black Box" testing). This verification is NOT able to check many of the rules of the spec, and if you want more verification of your implementation you'll have to implementorg.reactivestreams.tck.SubscriberWhiteboxVerification
instead.- See Also:
Subscriber
,Subscription
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SubscriberBlackboxVerification.BlackboxTestStage
-
Field Summary
Fields Modifier and Type Field Description protected TestEnvironment
env
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubscriberBlackboxVerification(TestEnvironment env)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
blackboxSubscriberTest(org.reactivestreams.tck.SubscriberBlackboxVerification.BlackboxTestStageTestRun body)
void
blackboxSubscriberWithoutSetupTest(org.reactivestreams.tck.SubscriberBlackboxVerification.BlackboxTestStageTestRun body)
abstract org.reactivestreams.Subscriber<T>
createSubscriber()
This is the main method you must implement in your test incarnation.void
notVerified()
java.util.concurrent.ExecutorService
publisherExecutorService()
ExecutorService to be used by the provided helperPublisher
void
required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest()
Asks for aSubscriber
instance, expects it to callrequest()
in a timely manner and signals as manyonNext
items as the very first request amount specified by theSubscriber
.void
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete()
Asks for aSubscriber
, signals anonSubscribe
followed by anonComplete
synchronously, and checks if neitherrequest
norcancel
was called from within theSubscriber
'sonComplete
implementation.void
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError()
Asks for aSubscriber
, signals anonSubscribe
followed by anonError
synchronously, and checks if neitherrequest
norcancel
was called from within theSubscriber
'sonComplete
implementation.void
required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal()
Asks for aSubscriber
, signalsonSubscribe
twice synchronously and expects the secondSubscription
gets cancelled in a timely manner and without any calls to itsrequest
method.void
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall()
Asks for aSubscriber
and expects it to handleonComplete
independent of whether theSubscriber
requests items or not.void
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall()
Asks for aSubscriber
, expects it to request some amount and in turn be able to receive anonComplete
synchronously from therequest
call without anyonNext
signals before that.void
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall()
Asks for aSubscriber
, signalsonSubscribe
followed by anonError
synchronously.void
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall()
Asks for aSubscriber
, signalsonSubscribe
followed by anonError
synchronously.void
required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull()
Asks for aSubscriber
, signals anonSubscribe
event followed by aonError
withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onError
method.void
required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull()
Asks for aSubscriber
, signals anonSubscribe
event followed by aonNext
withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onNext
method.void
required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull()
Asks for aSubscriber
and signals anonSubscribe
event withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onSubscribe
method.void
setUp()
void
shutdownPublisherExecutorService()
void
startPublisherExecutorService()
void
triggerRequest(org.reactivestreams.Subscriber<? super T> subscriber)
Override this method if the Subscriber implementation you are verifying needs an external signal before it signals demand to its Publisher.void
untested_spec202_blackbox_shouldAsynchronouslyDispatch()
Currently, this test is skipped because there is no agreed upon approach how to detect if theSubscriber
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 theSubscriber
"considers" since rule §2.3 forbids interaction from within theonError
andonComplete
methods.void
untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid()
Currently, this test is skipped because it requires more control over theSubscriber
implementation to make it cancel theSubscription
for some external condition.void
untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization()
Currently, this test is skipped because it requires more control over theSubscriber
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 theSubscriber
implementation cancel the test'sSubscription
and check the outcome of sendingonNext
s after such cancel.void
untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents()
Currently, this test is skipped because it would require analyzing what theSubscriber
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 sameSubscriber
.void
untested_spec213_blackbox_failingOnSignalInvocation()
Currently, this test is skipped because it would require more control over theSubscriber
to fail internally in response to a set of legal event emissions, not throw any exception from theSubscriber
methods and have it cancel theSubscription
.void
untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext()
Currently, this test is skipped because there is no agreed upon way for specifying, enforcing and testing aSubscriber
with an arbitrary context.void
untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced()
Currently, this test is skipped because element production is the responsibility of thePublisher
and aSubscription
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 thePublisher
and aSubscription
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 thePublisher
and aSubscription
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 thePublisher
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 theSubscriber
implementation thus there is no way to detect that theSubscriber
called its ownonError
method in response to an exception thrown fromSubscription.cancel
.void
untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber()
Currently, this test is skipped because it requires more control over theSubscriber
implementation thus there is no way to detect that theSubscriber
called its ownonError
method in response to an exception thrown fromSubscription.request
.-
Methods inherited from class org.reactivestreams.tck.WithHelperPublisher
createElement, createHelperPublisher
-
-
-
-
Field Detail
-
env
protected final TestEnvironment env
-
-
Constructor Detail
-
SubscriberBlackboxVerification
protected SubscriberBlackboxVerification(TestEnvironment env)
-
-
Method Detail
-
createSubscriber
public abstract org.reactivestreams.Subscriber<T> createSubscriber()
This is the main method you must implement in your test incarnation. It must create a newSubscriber
instance to be subjected to the testing logic.
-
triggerRequest
public void triggerRequest(org.reactivestreams.Subscriber<? super T> subscriber)
Override this method if the Subscriber implementation you are verifying needs an external signal before it signals demand to its Publisher. By default this method does nothing.
-
startPublisherExecutorService
@BeforeClass public void startPublisherExecutorService()
-
shutdownPublisherExecutorService
@AfterClass public void shutdownPublisherExecutorService()
-
publisherExecutorService
public java.util.concurrent.ExecutorService publisherExecutorService()
Description copied from class:WithHelperPublisher
ExecutorService to be used by the provided helperPublisher
- Specified by:
publisherExecutorService
in classWithHelperPublisher<T>
-
setUp
@BeforeMethod public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest
public void required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
instance, expects it to callrequest()
in a timely manner and signals as manyonNext
items as the very first request amount specified by theSubscriber
.Verifies rule: 2.1
Notes:
- This test emits the number of items requested thus the
Subscriber
implementation should not request too much. - Only the very first
request
amount is considered. - This test doesn't signal
onComplete
after the first set ofonNext
signals has been emitted and may cause resource leak inSubscriber
s that expect a finitePublisher
. - The test ignores cancellation from the
Subscriber
and emits the requested amount regardless.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
requires external stimulus to begin requesting; override thetriggerRequest(org.reactivestreams.Subscriber)
method in this case, - the
TestEnvironment
has large enough timeout specified in case theSubscriber
has some time-delay behavior, - if the
Subscriber
requests zero or a negative value in some circumstances, - if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronNext
methods.
- Specified by:
required_spec201_blackbox_mustSignalDemandViaSubscriptionRequest
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- This test emits the number of items requested thus the
-
untested_spec202_blackbox_shouldAsynchronouslyDispatch
public void untested_spec202_blackbox_shouldAsynchronouslyDispatch() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because there is no agreed upon approach how to detect if theSubscriber
really goes async or just responds in a timely manner.Verifies rule: 2.2
- Specified by:
untested_spec202_blackbox_shouldAsynchronouslyDispatch
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete
public void required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signals anonSubscribe
followed by anonComplete
synchronously, and checks if neitherrequest
norcancel
was called from within theSubscriber
'sonComplete
implementation.Verifies rule: 2.3
Notes:
- The test checks for the presensce of method named "onComplete" in the current stacktrace when handling
the
request
orcancel
calls in the test's ownSubscription
.
If this test fails, the following could be checked within the
Subscriber
implementation:- no calls happen to
request
orcancel
in response to anonComplete
directly or indirectly, - if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronComplete
methods.
- Specified by:
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- The test checks for the presensce of method named "onComplete" in the current stacktrace when handling
the
-
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError
public void required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signals anonSubscribe
followed by anonError
synchronously, and checks if neitherrequest
norcancel
was called from within theSubscriber
'sonComplete
implementation.Verifies rule: 2.3
Notes:
- The test checks for the presensce of method named "onError" in the current stacktrace when handling
the
request
orcancel
calls in the test's ownSubscription
.
If this test fails, the following could be checked within the
Subscriber
implementation:- no calls happen to
request
orcancel
in response to anonError
directly or indirectly, - if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronError
methods.
- Specified by:
required_spec203_blackbox_mustNotCallMethodsOnSubscriptionOrPublisherInOnError
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- The test checks for the presensce of method named "onError" in the current stacktrace when handling
the
-
untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError
public void untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because there is no way to check what theSubscriber
"considers" since rule §2.3 forbids interaction from within theonError
andonComplete
methods.Verifies rule: 2.4
Notes:
- It would be possible to check if there was an async interaction with the test's
Subscription
within a grace period but such check is still not generally decisive.
- Specified by:
untested_spec204_blackbox_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
- It would be possible to check if there was an async interaction with the test's
-
required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal
public void required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signalsonSubscribe
twice synchronously and expects the secondSubscription
gets cancelled in a timely manner and without any calls to itsrequest
method.Verifies rule: 2.5
Notes:
- The test doesn't signal any other events than
onSubscribe
and may cause resource leak inSubscriber
s that expect a finitePublisher
.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscribe.onSubscribe
implementation actually tries to detect multiple calls to it, - if the second
Subscription
is cancelled asynchronously and that takes longer time than theTestEnvironment
's timeout permits.
- Specified by:
required_spec205_blackbox_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
- The test doesn't signal any other events than
-
untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid
public void untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it requires more control over theSubscriber
implementation to make it cancel theSubscription
for some external condition.Verifies rule: 2.6
- Specified by:
untested_spec206_blackbox_mustCallSubscriptionCancelIfItIsNoLongerValid
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization
public void untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it requires more control over theSubscriber
implementation to issue requests based on external stimulus.Verifies rule: 2.7
- Specified by:
untested_spec207_blackbox_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel
public void untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because there is no way to make theSubscriber
implementation cancel the test'sSubscription
and check the outcome of sendingonNext
s after such cancel.Verifies rule: 2.8
- Specified by:
untested_spec208_blackbox_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
-
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall
public void required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, expects it to request some amount and in turn be able to receive anonComplete
synchronously from therequest
call without anyonNext
signals before that.Verifies rule: 2.9
Notes:
- The test ignores cancellation from the
Subscriber
. - Invalid request amounts are ignored by this test.
- Concurrent calls to the test's
Subscription.request()
must be externally synchronized, otherwise such case results probabilistically in multipleonComplete
calls by the test.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronComplete
methods. - if the
Subscriber
requires external stimulus to begin requesting; override thetriggerRequest(org.reactivestreams.Subscriber)
method in this case,
- Specified by:
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- The test ignores cancellation from the
-
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall
public void required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
and expects it to handleonComplete
independent of whether theSubscriber
requests items or not.Verifies rule: 2.9
Notes:
- Currently, the test doesn't call
onSubscribe
on theSubscriber
which violates §1.9.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronComplete
methods.
- Specified by:
required_spec209_blackbox_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- Currently, the test doesn't call
-
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall
public void required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signalsonSubscribe
followed by anonError
synchronously.Verifies rule: 2.10
Notes:
- Despite the method name, the test doesn't expect a request signal from
Subscriber
and emits theonError
signal anyway.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronError
methods.
- Specified by:
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- Despite the method name, the test doesn't expect a request signal from
-
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall
public void required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signalsonSubscribe
followed by anonError
synchronously.Verifies rule: 2.10
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws an unchecked exception from itsonSubscribe
oronError
methods.
- Specified by:
required_spec210_blackbox_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- if the
-
untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents
public void untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it would require analyzing what theSubscriber
implementation does.Verifies rule: 2.11
- Specified by:
untested_spec211_blackbox_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality
public void untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because the test for§2.5
is in a better position to test for handling the reuse of the sameSubscriber
.Verifies rule: 2.12
Notes:
- In addition to §2.5, this rule could be better verified when testing a
Publisher
's subscription behavior.
- Specified by:
untested_spec212_blackbox_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- In addition to §2.5, this rule could be better verified when testing a
-
untested_spec213_blackbox_failingOnSignalInvocation
public void untested_spec213_blackbox_failingOnSignalInvocation() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it would require more control over theSubscriber
to fail internally in response to a set of legal event emissions, not throw any exception from theSubscriber
methods and have it cancel theSubscription
.Verifies rule: 2.13
- Specified by:
untested_spec213_blackbox_failingOnSignalInvocation
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
and signals anonSubscribe
event withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onSubscribe
method.Verifies rule: 2.13
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws aNullPointerException
from itsonSubscribe
method in response to anull
parameter and not some other unchecked exception or no exception at all.
- Specified by:
required_spec213_blackbox_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- if the
-
required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signals anonSubscribe
event followed by aonNext
withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onNext
method.Verifies rule: 2.13
Notes:
- The test ignores cancellation and requests from the
Subscriber
and emits theonNext
signal with anull
parameter anyway.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws aNullPointerException
from itsonNext
method in response to anull
parameter and not some other unchecked exception or no exception at all.
- Specified by:
required_spec213_blackbox_onNext_mustThrowNullPointerExceptionWhenParametersAreNull
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- The test ignores cancellation and requests from the
-
required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Asks for aSubscriber
, signals anonSubscribe
event followed by aonError
withnull
as a parameter and expects an immediateNullPointerException
to be thrown by theSubscriber.onError
method.Verifies rule: 2.13
Notes:
- The test ignores cancellation from the
Subscriber
and emits theonError
signal with anull
parameter anyway.
If this test fails, the following could be checked within the
Subscriber
implementation:- if the
Subscriber
throws aNullPointerException
from itsonNext
method in response to anull
parameter and not some other unchecked exception or no exception at all.
- Specified by:
required_spec213_blackbox_onError_mustThrowNullPointerExceptionWhenParametersAreNull
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
- The test ignores cancellation from the
-
untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext
public void untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because there is no agreed upon way for specifying, enforcing and testing aSubscriber
with an arbitrary context.Verifies rule: 3.1
- Specified by:
untested_spec301_blackbox_mustNotBeCalledOutsideSubscriberContext
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced
public void untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced() throws java.lang.Throwable
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because element production is the responsibility of thePublisher
and aSubscription
is not expected to be the active element in an established subscription.Verifies rule: 3.8
- Specified by:
untested_spec308_blackbox_requestMustRegisterGivenNumberElementsToBeProduced
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Throwable
-
untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber
public void untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because element production is the responsibility of thePublisher
and aSubscription
is not expected to be the active element in an established subscription.Verifies rule: 3.10
Notes:
- This could be tested with a synchronous source currently not available within the TCK.
- Specified by:
untested_spec310_blackbox_requestMaySynchronouslyCallOnNextOnSubscriber
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError
public void untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because signal production is the responsibility of thePublisher
and aSubscription
is not expected to be the active element in an established subscription.Verifies rule: 3.11
Notes:
- Specified by:
untested_spec311_blackbox_requestMaySynchronouslyCallOnCompleteOrOnError
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists
public void untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it is the responsibility of thePublisher
deal with the case that all subscribers have cancelled their subscription.Verifies rule: 3.14
Notes:
- The specification lists this as an optional behavior because only some
Publisher
implementations (most likelyProcessor
s) would coordinate with multipleSubscriber
s.
- Specified by:
untested_spec314_blackbox_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
- The specification lists this as an optional behavior because only some
-
untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError
public void untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it requires more control over theSubscriber
implementation thus there is no way to detect that theSubscriber
called its ownonError
method in response to an exception thrown fromSubscription.cancel
.Verifies rule: 3.15
- Specified by:
untested_spec315_blackbox_cancelMustNotThrowExceptionAndMustSignalOnError
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber
public void untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws java.lang.Exception
Description copied from interface:SubscriberBlackboxVerificationRules
Currently, this test is skipped because it requires more control over theSubscriber
implementation thus there is no way to detect that theSubscriber
called its ownonError
method in response to an exception thrown fromSubscription.request
.Verifies rule: 3.16
- Specified by:
untested_spec316_blackbox_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber
in interfaceSubscriberBlackboxVerificationRules
- Throws:
java.lang.Exception
-
blackboxSubscriberTest
public void blackboxSubscriberTest(org.reactivestreams.tck.SubscriberBlackboxVerification.BlackboxTestStageTestRun body) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
blackboxSubscriberWithoutSetupTest
public void blackboxSubscriberWithoutSetupTest(org.reactivestreams.tck.SubscriberBlackboxVerification.BlackboxTestStageTestRun body) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
notVerified
public void notVerified()
-
-