public abstract class SubscriberWhiteboxVerification<T> extends WithHelperPublisher<T> implements SubscriberWhiteboxVerificationRules
Subscriber
and Subscription
specification rules.Subscriber
,
Subscription
Modifier and Type | Class and Description |
---|---|
static class |
SubscriberWhiteboxVerification.BlackboxProbe<T> |
static class |
SubscriberWhiteboxVerification.BlackboxSubscriberProxy<T>
This class is intented to be used as
Subscriber decorator and should be used in pub.subscriber(...) calls,
in order to allow intercepting calls on the underlying Subscriber . |
static interface |
SubscriberWhiteboxVerification.SubscriberProbe<T> |
static interface |
SubscriberWhiteboxVerification.SubscriberPuppet |
static interface |
SubscriberWhiteboxVerification.SubscriberPuppeteer |
static class |
SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> |
class |
SubscriberWhiteboxVerification.WhiteboxTestStage |
Modifier | Constructor and Description |
---|---|
protected |
SubscriberWhiteboxVerification(TestEnvironment env) |
createElement, createHelperPublisher
protected SubscriberWhiteboxVerification(TestEnvironment env)
public abstract org.reactivestreams.Subscriber<T> createSubscriber(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe)
Subscriber
instance to be subjected to the testing logic.
In order to be meaningfully testable your Subscriber must inform the given
`WhiteboxSubscriberProbe` of the respective events having been received.public void startPublisherExecutorService()
public void shutdownPublisherExecutorService()
public java.util.concurrent.ExecutorService publisherExecutorService()
WithHelperPublisher
Publisher
publisherExecutorService
in class WithHelperPublisher<T>
public void setUp() throws java.lang.Exception
java.lang.Exception
public void required_exerciseWhiteboxHappyPath() throws java.lang.Throwable
required_exerciseWhiteboxHappyPath
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec201_mustSignalDemandViaSubscriptionRequest() throws java.lang.Throwable
required_spec201_mustSignalDemandViaSubscriptionRequest
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec202_shouldAsynchronouslyDispatch() throws java.lang.Exception
untested_spec202_shouldAsynchronouslyDispatch
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws java.lang.Throwable
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws java.lang.Throwable
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws java.lang.Exception
untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws java.lang.Throwable
required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid() throws java.lang.Exception
untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws java.lang.Exception
untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws java.lang.Throwable
required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws java.lang.Throwable
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws java.lang.Throwable
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws java.lang.Exception
untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation() throws java.lang.Throwable
untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec213_failingOnSignalInvocation() throws java.lang.Exception
untested_spec213_failingOnSignalInvocation
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec301_mustNotBeCalledOutsideSubscriberContext() throws java.lang.Exception
untested_spec301_mustNotBeCalledOutsideSubscriberContext
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void required_spec308_requestMustRegisterGivenNumberElementsToBeProduced() throws java.lang.Throwable
required_spec308_requestMustRegisterGivenNumberElementsToBeProduced
in interface SubscriberWhiteboxVerificationRules
java.lang.Throwable
public void untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber() throws java.lang.Exception
untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError() throws java.lang.Exception
untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws java.lang.Exception
untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError() throws java.lang.Exception
untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws java.lang.Exception
untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber
in interface SubscriberWhiteboxVerificationRules
java.lang.Exception
public void subscriberTest(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
SubscriberWhiteboxVerification.WhiteboxTestStage
over to the test.
The test stage is, like in a puppet show, used to orchestrate what each participant should do.
Since this is a whitebox test, this allows the stage to completely control when and how to signal / expect signals.java.lang.Throwable
public void subscriberTestWithoutSetup(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
SubscriberWhiteboxVerification.WhiteboxTestStage
without performing any additional setup,
like the subscriberTest(SubscriberWhiteboxVerification.TestStageTestRun)
would.
Use this method to write tests in which you need full control over when and how the initial subscribe
is signalled.java.lang.Throwable
public void optionalSubscriberTestWithoutSetup(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
java.lang.Throwable
public void notVerified()
public void notVerified(java.lang.String msg)