public abstract class IdentityProcessorVerification<T> extends WithHelperPublisher<T> implements SubscriberWhiteboxVerificationRules, PublisherVerificationRules
| Modifier and Type | Class and Description |
|---|---|
class |
IdentityProcessorVerification.ManualSubscriberWithErrorCollection<A> |
class |
IdentityProcessorVerification.TestSetup |
| Constructor and Description |
|---|
IdentityProcessorVerification(TestEnvironment env)
Test class must specify the expected time it takes for the publisher to
shut itself down when the the last downstream
Subscription is cancelled. |
IdentityProcessorVerification(TestEnvironment env,
long publisherReferenceGCTimeoutMillis)
Test class must specify the expected time it takes for the publisher to
shut itself down when the the last downstream
Subscription is cancelled. |
IdentityProcessorVerification(TestEnvironment env,
long publisherReferenceGCTimeoutMillis,
int processorBufferSize)
Test class must specify the expected time it takes for the publisher to
shut itself down when the the last downstream
Subscription is cancelled. |
createElement, createHelperPublisher, publisherExecutorServicepublic IdentityProcessorVerification(TestEnvironment env)
Subscription is cancelled.
The processor will be required to be able to buffer TestEnvironment.TEST_BUFFER_SIZE elements.public IdentityProcessorVerification(TestEnvironment env, long publisherReferenceGCTimeoutMillis)
Subscription is cancelled.
The processor will be required to be able to buffer TestEnvironment.TEST_BUFFER_SIZE elements.publisherReferenceGCTimeoutMillis - used to determine after how much time a reference to a Subscriber should be already dropped by the Publisher.public IdentityProcessorVerification(TestEnvironment env, long publisherReferenceGCTimeoutMillis, int processorBufferSize)
Subscription is cancelled.publisherReferenceGCTimeoutMillis - used to determine after how much time a reference to a Subscriber should be already dropped by the Publisher.processorBufferSize - number of elements the processor is required to be able to buffer.public abstract org.reactivestreams.Processor<T,T> createIdentityProcessor(int bufferSize)
bufferSize - number of elements the processor is required to be able to buffer.public abstract org.reactivestreams.Publisher<T> createFailedPublisher()
Publisher returned by this method is hand out a subscription,
followed by signalling onError on it, as specified by Rule 1.9.
If you ignore these additional tests, return null from this method.public long maxElementsFromPublisher()
1 from this method.
Defaults to Long.MAX_VALUE - 1, meaning that the Publisher can be produce a huge but NOT an unbounded number of elements.
To mark your Publisher will *never* signal an onComplete override this method and return Long.MAX_VALUE,
which will result in *skipping all tests which require an onComplete to be triggered* (!).public long boundedDepthOfOnNextAndRequestRecursion()
Subscription actually solves the "unbounded recursion" problem by not allowing the number of
recursive calls to exceed the number returned by this method.public boolean skipStochasticTests()
true in order to skip executing tests marked as Stochastic.
Such tests MAY sometimes fail even though the implpublic long maxSupportedSubscribers()
Publisher under test to support multiple Subscribers,
yet the spec does not require all publishers to be able to do so, thus – if an implementation
supports only a limited number of subscribers (e.g. only 1 subscriber, also known as "no fanout")
you MUST return that number from this method by overriding it.public void setUp() throws java.lang.Exception
java.lang.Exceptionpublic org.reactivestreams.Publisher<T> createPublisher(long elements)
public void required_validate_maxElementsFromPublisher() throws java.lang.Exception
required_validate_maxElementsFromPublisher in interface PublisherVerificationRulesjava.lang.Exceptionpublic void required_validate_boundedDepthOfOnNextAndRequestRecursion() throws java.lang.Exception
required_validate_boundedDepthOfOnNextAndRequestRecursion in interface PublisherVerificationRulesjava.lang.Exceptionpublic void required_createPublisher1MustProduceAStreamOfExactly1Element() throws java.lang.Throwable
required_createPublisher1MustProduceAStreamOfExactly1Element in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_createPublisher3MustProduceAStreamOfExactly3Elements() throws java.lang.Throwable
required_createPublisher3MustProduceAStreamOfExactly3Elements in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements() throws java.lang.Throwable
required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec102_maySignalLessThanRequestedAndTerminateSubscription() throws java.lang.Throwable
required_spec102_maySignalLessThanRequestedAndTerminateSubscription in interface PublisherVerificationRulesjava.lang.Throwablepublic void stochastic_spec103_mustSignalOnMethodsSequentially() throws java.lang.Throwable
stochastic_spec103_mustSignalOnMethodsSequentially in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec104_mustSignalOnErrorWhenFails() throws java.lang.Throwable
optional_spec104_mustSignalOnErrorWhenFails in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates() throws java.lang.Throwable
required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec105_emptyStreamMustTerminateBySignallingOnComplete() throws java.lang.Throwable
optional_spec105_emptyStreamMustTerminateBySignallingOnComplete in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled() throws java.lang.Throwable
untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled() throws java.lang.Throwable
required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled() throws java.lang.Throwable
untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals() throws java.lang.Throwable
untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec109_subscribeShouldNotThrowNonFatalThrowable() throws java.lang.Throwable
untested_spec109_subscribeShouldNotThrowNonFatalThrowable in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec109_subscribeThrowNPEOnNullSubscriber() throws java.lang.Throwable
required_spec109_subscribeThrowNPEOnNullSubscriber in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe() throws java.lang.Throwable
required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec109_mustIssueOnSubscribeForNonNullSubscriber() throws java.lang.Throwable
required_spec109_mustIssueOnSubscribeForNonNullSubscriber in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice() throws java.lang.Throwable
untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec111_maySupportMultiSubscribe() throws java.lang.Throwable
optional_spec111_maySupportMultiSubscribe in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne() throws java.lang.Throwable
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront() throws java.lang.Throwable
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront in interface PublisherVerificationRulesjava.lang.Throwablepublic void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected() throws java.lang.Throwable
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe() throws java.lang.Throwable
required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec303_mustNotAllowUnboundedRecursion() throws java.lang.Throwable
required_spec303_mustNotAllowUnboundedRecursion in interface PublisherVerificationRulesjava.lang.Throwablepublic void untested_spec304_requestShouldNotPerformHeavyComputations() throws java.lang.Exception
untested_spec304_requestShouldNotPerformHeavyComputations in interface PublisherVerificationRulesjava.lang.Exceptionpublic void untested_spec305_cancelMustNotSynchronouslyPerformHeavyCompuatation() throws java.lang.Exception
untested_spec305_cancelMustNotSynchronouslyPerformHeavyCompuatation in interface PublisherVerificationRulesjava.lang.Exceptionpublic void required_spec306_afterSubscriptionIsCancelledRequestMustBeNops() throws java.lang.Throwable
required_spec306_afterSubscriptionIsCancelledRequestMustBeNops in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops() throws java.lang.Throwable
required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec309_requestZeroMustSignalIllegalArgumentException() throws java.lang.Throwable
required_spec309_requestZeroMustSignalIllegalArgumentException in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() throws java.lang.Throwable
required_spec309_requestNegativeNumberMustSignalIllegalArgumentException in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling() throws java.lang.Throwable
required_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber() throws java.lang.Throwable
required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec317_mustSupportAPendingElementCountUpToLongMaxValue() throws java.lang.Throwable
required_spec317_mustSupportAPendingElementCountUpToLongMaxValue in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue() throws java.lang.Throwable
required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue() throws java.lang.Throwable
required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue in interface PublisherVerificationRulesjava.lang.Throwablepublic void required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError() throws java.lang.Throwable
java.lang.Throwablepublic org.reactivestreams.Subscriber<T> createSubscriber(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe)
public void mustImmediatelyPassOnOnErrorEventsReceivedFromItsUpstreamToItsDownstream() throws java.lang.Exception
java.lang.Exceptionpublic void required_exerciseWhiteboxHappyPath() throws java.lang.Throwable
required_exerciseWhiteboxHappyPath in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec201_mustSignalDemandViaSubscriptionRequest() throws java.lang.Throwable
required_spec201_mustSignalDemandViaSubscriptionRequest in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec202_shouldAsynchronouslyDispatch() throws java.lang.Exception
untested_spec202_shouldAsynchronouslyDispatch in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete() throws java.lang.Throwable
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError() throws java.lang.Throwable
required_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError() throws java.lang.Exception
untested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal() throws java.lang.Throwable
required_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid() throws java.lang.Exception
untested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization() throws java.lang.Exception
untested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws java.lang.Throwable
required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall() throws java.lang.Throwable
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
required_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall() throws java.lang.Throwable
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws java.lang.Throwable
required_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents() throws java.lang.Exception
untested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation() throws java.lang.Throwable
untested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec213_failingOnSignalInvocation() throws java.lang.Exception
untested_spec213_failingOnSignalInvocation in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull() throws java.lang.Throwable
required_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec301_mustNotBeCalledOutsideSubscriberContext() throws java.lang.Exception
untested_spec301_mustNotBeCalledOutsideSubscriberContext in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_spec308_requestMustRegisterGivenNumberElementsToBeProduced() throws java.lang.Throwable
required_spec308_requestMustRegisterGivenNumberElementsToBeProduced in interface SubscriberWhiteboxVerificationRulesjava.lang.Throwablepublic void untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber() throws java.lang.Exception
untested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError() throws java.lang.Exception
untested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists() throws java.lang.Exception
untested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError() throws java.lang.Exception
untested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber() throws java.lang.Exception
untested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber in interface SubscriberWhiteboxVerificationRulesjava.lang.Exceptionpublic void required_mustRequestFromUpstreamForElementsThatHaveBeenRequestedLongAgo() throws java.lang.Throwable
java.lang.Throwablepublic void notVerified()
public void notVerified(java.lang.String message)
public void optionalMultipleSubscribersTest(long requiredSubscribersSupport, Function<java.lang.Long,IdentityProcessorVerification.TestSetup> body) throws java.lang.Throwable
java.lang.Throwable