Package org.reactivestreams.tck
Class SubscriberWhiteboxVerification<T>
- java.lang.Object
-
- org.reactivestreams.tck.WithHelperPublisher<T>
-
- org.reactivestreams.tck.SubscriberWhiteboxVerification<T>
-
- All Implemented Interfaces:
SubscriberWhiteboxVerificationRules
public abstract class SubscriberWhiteboxVerification<T> extends WithHelperPublisher<T> implements SubscriberWhiteboxVerificationRules
Provides whitebox style tests for verifyingSubscriberandSubscriptionspecification rules.- See Also:
Subscriber,Subscription
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubscriberWhiteboxVerification.BlackboxProbe<T>static classSubscriberWhiteboxVerification.BlackboxSubscriberProxy<T>This class is intented to be used asSubscriberdecorator and should be used inpub.subscriber(...)calls, in order to allow intercepting calls on the underlyingSubscriber.static interfaceSubscriberWhiteboxVerification.SubscriberProbe<T>static interfaceSubscriberWhiteboxVerification.SubscriberPuppetImplement this puppet in your Whitebox style tests.static interfaceSubscriberWhiteboxVerification.SubscriberPuppeteerstatic classSubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T>classSubscriberWhiteboxVerification.WhiteboxTestStage
-
Constructor Summary
Constructors Modifier Constructor Description protectedSubscriberWhiteboxVerification(TestEnvironment env)
-
Method Summary
-
Methods inherited from class org.reactivestreams.tck.WithHelperPublisher
createElement, createHelperPublisher
-
-
-
-
Constructor Detail
-
SubscriberWhiteboxVerification
protected SubscriberWhiteboxVerification(TestEnvironment env)
-
-
Method Detail
-
createSubscriber
public abstract org.reactivestreams.Subscriber<T> createSubscriber(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe)
This is the main method you must implement in your test incarnation. It must create a newSubscriberinstance 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.
-
startPublisherExecutorService
@BeforeClass public void startPublisherExecutorService()
-
shutdownPublisherExecutorService
@AfterClass public void shutdownPublisherExecutorService()
-
publisherExecutorService
public java.util.concurrent.ExecutorService publisherExecutorService()
Description copied from class:WithHelperPublisherExecutorService to be used by the provided helperPublisher- Specified by:
publisherExecutorServicein classWithHelperPublisher<T>
-
setUp
@BeforeMethod public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
required_exerciseWhiteboxHappyPath
public void required_exerciseWhiteboxHappyPath() throws java.lang.Throwable
- Specified by:
required_exerciseWhiteboxHappyPathin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec201_mustSignalDemandViaSubscriptionRequest
public void required_spec201_mustSignalDemandViaSubscriptionRequest() throws java.lang.Throwable
- Specified by:
required_spec201_mustSignalDemandViaSubscriptionRequestin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec202_shouldAsynchronouslyDispatch
public void untested_spec202_shouldAsynchronouslyDispatch() throws java.lang.Exception
- Specified by:
untested_spec202_shouldAsynchronouslyDispatchin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete
public void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws java.lang.Throwable
- Specified by:
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnCompletein interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError
public void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws java.lang.Throwable
- Specified by:
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnErrorin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError
public void untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws java.lang.Exception
- Specified by:
untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnErrorin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal
public void required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws java.lang.Throwable
- Specified by:
required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignalin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid
public void untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid() throws java.lang.Exception
- Specified by:
untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValidin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization
public void untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws java.lang.Exception
- Specified by:
untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronizationin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel
public void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws java.lang.Throwable
- Specified by:
required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancelin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall
public void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws java.lang.Throwable
- Specified by:
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCallin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall
public void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
- Specified by:
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCallin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall
public void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws java.lang.Throwable
- Specified by:
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCallin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall
public void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
- Specified by:
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCallin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents
public void untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws java.lang.Exception
- Specified by:
untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEventsin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation
public void untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation() throws java.lang.Throwable
- Specified by:
untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolationin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec213_failingOnSignalInvocation
public void untested_spec213_failingOnSignalInvocation() throws java.lang.Exception
- Specified by:
untested_spec213_failingOnSignalInvocationin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
- Specified by:
required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNullin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
- Specified by:
required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNullin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull
public void required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
- Specified by:
required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNullin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec301_mustNotBeCalledOutsideSubscriberContext
public void untested_spec301_mustNotBeCalledOutsideSubscriberContext() throws java.lang.Exception
- Specified by:
untested_spec301_mustNotBeCalledOutsideSubscriberContextin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
required_spec308_requestMustRegisterGivenNumberElementsToBeProduced
public void required_spec308_requestMustRegisterGivenNumberElementsToBeProduced() throws java.lang.Throwable
- Specified by:
required_spec308_requestMustRegisterGivenNumberElementsToBeProducedin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Throwable
-
untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber
public void untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber() throws java.lang.Exception
- Specified by:
untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriberin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError
public void untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError() throws java.lang.Exception
- Specified by:
untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnErrorin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists
public void untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws java.lang.Exception
- Specified by:
untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExistsin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError
public void untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError() throws java.lang.Exception
- Specified by:
untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnErrorin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber
public void untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws java.lang.Exception
- Specified by:
untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriberin interfaceSubscriberWhiteboxVerificationRules- Throws:
java.lang.Exception
-
subscriberTest
public void subscriberTest(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
Prepares subscriber and publisher pair (by subscribing the first to the latter), and then hands over the testsSubscriberWhiteboxVerification.WhiteboxTestStageover 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.- Throws:
java.lang.Throwable
-
subscriberTestWithoutSetup
public void subscriberTestWithoutSetup(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
Provides aSubscriberWhiteboxVerification.WhiteboxTestStagewithout performing any additional setup, like thesubscriberTest(SubscriberWhiteboxVerification.TestStageTestRun)would. Use this method to write tests in which you need full control over when and how the initialsubscribeis signalled.- Throws:
java.lang.Throwable
-
optionalSubscriberTestWithoutSetup
public void optionalSubscriberTestWithoutSetup(org.reactivestreams.tck.SubscriberWhiteboxVerification.TestStageTestRun body) throws java.lang.Throwable
Test for feature that MAY be implemented. This test will be marked as SKIPPED if it fails.- Throws:
java.lang.Throwable
-
notVerified
public void notVerified()
-
notVerified
public void notVerified(java.lang.String msg)
-
-