Class IdentityProcessorVerification<T>
- java.lang.Object
-
- org.reactivestreams.tck.WithHelperPublisher<T>
-
- org.reactivestreams.tck.IdentityProcessorVerification<T>
-
- All Implemented Interfaces:
PublisherVerificationRules,SubscriberWhiteboxVerificationRules
public abstract class IdentityProcessorVerification<T> extends WithHelperPublisher<T> implements SubscriberWhiteboxVerificationRules, PublisherVerificationRules
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classIdentityProcessorVerification.ManualSubscriberWithErrorCollection<A>classIdentityProcessorVerification.TestSetup
-
Constructor Summary
Constructors Constructor Description IdentityProcessorVerification(TestEnvironment env)Test class must specify the expected time it takes for the publisher to shut itself down when the the last downstreamSubscriptionis 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 downstreamSubscriptionis 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 downstreamSubscriptionis cancelled.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longboundedDepthOfOnNextAndRequestRecursion()In order to verify rule 3.3 of the reactive streams spec, this number will be used to check if aSubscriptionactually solves the "unbounded recursion" problem by not allowing the number of recursive calls to exceed the number returned by this method.abstract org.reactivestreams.Publisher<T>createFailedPublisher()By implementing this method, additional TCK tests concerning a "failed" publishers will be run.abstract org.reactivestreams.Processor<T,T>createIdentityProcessor(int bufferSize)This is the main method you must implement in your test incarnation.org.reactivestreams.Publisher<T>createPublisher(long elements)org.reactivestreams.Subscriber<T>createSubscriber(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe)booleandoesCoordinatedEmission()Override this method and returntrueif theProcessorreturned by thecreateIdentityProcessor(int)coordinates itsSubscribers request amounts and only delivers onNext signals if all Subscribers have indicated (via their Subscription#request(long)) they are ready to receive elements.longmaxElementsFromPublisher()Override and return lower value if your Publisher is only able to produce a known number of elements.longmaxSupportedSubscribers()Describes the tested implementation in terms of how many subscribers they can support.voidmustImmediatelyPassOnOnErrorEventsReceivedFromItsUpstreamToItsDownstream()voidnotVerified()voidnotVerified(java.lang.String message)voidoptional_spec104_mustSignalOnErrorWhenFails()Asks for an errorPublisherthat should callonSubscribeexactly once followed by a single call toonError()without receiving any requests and otherwise not throwing any exception.voidoptional_spec105_emptyStreamMustTerminateBySignallingOnComplete()Asks for an emptyPublisher(i.e., length 0) and verifies it completes in a timely manner.voidoptional_spec111_maySupportMultiSubscribe()Asks for a single-elementPublisherand subscribes to it twice, without consuming with eitherSubscriberinstance (i.e., no requests are issued).voidoptional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront()Asks for a shortPublisher(length 3), subscribes 3Subscribers to it, requests more than the length items upfront with each and verifies they all received the same items in the same order (but does not verify they all complete).voidoptional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected()Asks for a shortPublisher(length 3), subscribes 3Subscribers to it, requests more than the length items upfront with each and verifies they all received the same items in the same order followed by anonCompletesignal.voidoptional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne()Asks for a shortPublisher(length 5), subscribes 3Subscribers to it, requests with different patterns and checks if all 3 received the same events in the same order.voidoptional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals()Asks for a single-elementPublisherand subscribes to it twice.voidoptional_spec309_requestNegativeNumberMaySignalIllegalArgumentExceptionWithSpecificMessage()Asks for a shortPublisher(length 10) and issues a random, negativerequest()call which should trigger anonErrorcall with anIllegalArgumentException.voidoptionalMultipleSubscribersTest(long requiredSubscribersSupport, Function<java.lang.Long,IdentityProcessorVerification.TestSetup> body)Test for feature that REQUIRES multiple subscribers to be supported by Publisher.voidrequired_createPublisher1MustProduceAStreamOfExactly1Element()Asks for aPublisherthat should emit exactly one item and complete (both within a timeout specified byTestEnvironment.defaultTimeoutMillis()) in response to a request(1).voidrequired_createPublisher3MustProduceAStreamOfExactly3Elements()Asks for aPublisherthat should emit exactly three items and complete (all within a timeout specified byTestEnvironment.defaultTimeoutMillis()).voidrequired_exerciseWhiteboxHappyPath()voidrequired_mustRequestFromUpstreamForElementsThatHaveBeenRequestedLongAgo()Asks for aProcessorthat supports at least 2Subscribers at once and checks requests fromSubscribers will eventually lead to requests towards the upstream of theProcessor.voidrequired_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements()Asks for aPublisherthat responds to a request pattern of 0 (not requesting upfront), 1, 1 and 2 in a timely manner.voidrequired_spec102_maySignalLessThanRequestedAndTerminateSubscription()Asks for a shortPublisherand verifies that requesting once and with more than the length (but bounded) results in the correct number of items to be emitted (i.e., length 3 and request 10) followed by anonCompletesignal.voidrequired_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError()Asks for aProcessorthat supports at least 2Subscribers at once and checks if twoSubscribers receive the same items and a terminalException.voidrequired_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates()Asks for a shortPublisher(i.e., length 3) and verifies, after requesting one by one, the sequence completes normally.voidrequired_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled()Asks for a single-elementPublisherand checks if requesting after the terminal event doesn't lead to more items or terminal signals to be emitted.voidrequired_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe()Asks for an errorPublisherthat should callonSubscribeexactly once followed by a single call toonError()without receiving any requests.voidrequired_spec109_mustIssueOnSubscribeForNonNullSubscriber()Asks for an emptyPublisherand verifies ifonSubscribesignal was emitted before any otheronNext,onErrororonCompletesignal.voidrequired_spec109_subscribeThrowNPEOnNullSubscriber()Asks for an emptyPublisherand callssubscribeon it withnullthat should result in aNullPointerExceptionto be thrown.voidrequired_spec201_mustSignalDemandViaSubscriptionRequest()voidrequired_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnComplete()voidrequired_spec203_mustNotCallMethodsOnSubscriptionOrPublisherInOnError()voidrequired_spec205_mustCallSubscriptionCancelIfItAlreadyHasAnSubscriptionAndReceivesAnotherOnSubscribeSignal()voidrequired_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel()voidrequired_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithoutPrecedingRequestCall()voidrequired_spec209_mustBePreparedToReceiveAnOnCompleteSignalWithPrecedingRequestCall()voidrequired_spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall()voidrequired_spec210_mustBePreparedToReceiveAnOnErrorSignalWithPrecedingRequestCall()voidrequired_spec213_onError_mustThrowNullPointerExceptionWhenParametersAreNull()voidrequired_spec213_onNext_mustThrowNullPointerExceptionWhenParametersAreNull()voidrequired_spec213_onSubscribe_mustThrowNullPointerExceptionWhenParametersAreNull()voidrequired_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe()Asks for a shortPublisher(length 6), requests several times from withinonSubscribeand then requests one-by-one fromonNext.voidrequired_spec303_mustNotAllowUnboundedRecursion()Asks for aPublisherwith length equal to the value returned byPublisherVerificationRules.required_validate_boundedDepthOfOnNextAndRequestRecursion()plus 1, callsrequest(1)externally and then from withinonNextand checks if the stack depth did not increase beyond the amount permitted byPublisherVerificationRules.required_validate_boundedDepthOfOnNextAndRequestRecursion().voidrequired_spec306_afterSubscriptionIsCancelledRequestMustBeNops()Asks for a shortPublisher(length 3) and verifies that cancelling without requesting anything, then requesting items should result in no signals to be emitted.voidrequired_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops()Asks for a single-elementPublisherand verifies that without requesting anything, cancelling the sequence multiple times should result in no signals to be emitted and should result in an thrown exception.voidrequired_spec308_requestMustRegisterGivenNumberElementsToBeProduced()voidrequired_spec309_requestNegativeNumberMustSignalIllegalArgumentException()Asks for a shortPublisher(length 10) and issues a random, negativerequest()call which should trigger anonErrorcall with anIllegalArgumentException.voidrequired_spec309_requestZeroMustSignalIllegalArgumentException()Asks for a shortPublisher(length 10) and issues arequest(0)which should trigger anonErrorcall with anIllegalArgumentException.voidrequired_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling()Asks for a shortPublisher(length 20), requests some items (less than the length), consumes one item then cancels the sequence and verifies the publisher emitted at most the requested amount and stopped emitting (or terminated).voidrequired_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber()Asks for a shortPublisher(length 3) requests and consumes one element from it, cancels theSubscription, callsSystem.gc()and then checks if all references to the testSubscriberhas been dropped (by checking theWeakReferencehas been emptied).voidrequired_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue()Asks for a very longPublisher(up toInteger.MAX_VALUE), requestsLong.MAX_VALUE - 1after each received item and expects no failure due to a potential overflow in the pending emission count while consuming 10 items and cancelling the sequence.voidrequired_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue()Asks for a shortPublisher(length 3) and requestsLong.MAX_VALUEfrom it in total (split across twoLong.MAX_VALUE / 2and onerequest(1)), verifying that thePublisheremits all of its items and completes normally.voidrequired_spec317_mustSupportAPendingElementCountUpToLongMaxValue()Asks for a shortPublisher(length 3) and requestsLong.MAX_VALUEfrom it, verifying that thePublisheremits all of its items and completes normally and does not keep spinning attempting to fulfill theLong.MAX_VALUEdemand by some means.voidrequired_validate_boundedDepthOfOnNextAndRequestRecursion()Validates that the override ofPublisherVerification.boundedDepthOfOnNextAndRequestRecursion()returns a positive value.voidrequired_validate_maxElementsFromPublisher()Validates that the override ofPublisherVerification.maxElementsFromPublisher()returns a non-negative value.voidsetUp()booleanskipStochasticTests()Override and returntruein order to skip executing tests marked asStochastic.voidstochastic_spec103_mustSignalOnMethodsSequentially()Asks for a shortPublisher(i.e., length 10), repeatedly subscribes to thisPublisher, requests items one by one and verifies thePublishercalls theonXXXmethods non-overlappingly.voiduntested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled()Currently, this test is skipped because it is unclear this rule can be effectively checked on aPublisherinstance without looking into or hooking into the implementation of it.voiduntested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled()Currently, this test is skipped, although it is possible to validate an errorPublisheralong the same lines asPublisherVerificationRules.required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled().voiduntested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals()Currently, this test is skipped because there was no agreement on how to verify its "eventually" requirement.voiduntested_spec109_subscribeShouldNotThrowNonFatalThrowable()Currently, this test is skipped because there is no common agreement on what is to be considered a fatal exception and besides,Publisher.subscribeis only allowed throw aNullPointerExceptionand any other exception would require looking into or hooking into the implementation of thePublisher.voiduntested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice()Currently, this test is skipped because enforcing rule §1.10 requires unlimited retention and reference-equal checks on all incomingSubscriberwhich is generally infeasible, plus reusing the sameSubscriberinstance is better detected (or ignored) insideSubscriber.onSubscribewhen the method is called multiple times.voiduntested_spec202_shouldAsynchronouslyDispatch()voiduntested_spec204_mustConsiderTheSubscriptionAsCancelledInAfterRecievingOnCompleteOrOnError()voiduntested_spec206_mustCallSubscriptionCancelIfItIsNoLongerValid()voiduntested_spec207_mustEnsureAllCallsOnItsSubscriptionTakePlaceFromTheSameThreadOrTakeCareOfSynchronization()voiduntested_spec211_mustMakeSureThatAllCallsOnItsMethodsHappenBeforeTheProcessingOfTheRespectiveEvents()voiduntested_spec212_mustNotCallOnSubscribeMoreThanOnceBasedOnObjectEquality_specViolation()voiduntested_spec213_failingOnSignalInvocation()voiduntested_spec301_mustNotBeCalledOutsideSubscriberContext()voiduntested_spec304_requestShouldNotPerformHeavyComputations()Currently, this test is skipped because arequestcould enter into a synchronous computation viaonNextlegally and otherwise there is no common agreement how to detect such heavy computation reliably.voiduntested_spec305_cancelMustNotSynchronouslyPerformHeavyComputation()Currently, this test is skipped because there is no reliable agreed upon way to detect a heavy computation.voiduntested_spec310_requestMaySynchronouslyCallOnNextOnSubscriber()voiduntested_spec311_requestMaySynchronouslyCallOnCompleteOrOnError()voiduntested_spec314_cancelMayCauseThePublisherToShutdownIfNoOtherSubscriptionExists()voiduntested_spec315_cancelMustNotThrowExceptionAndMustSignalOnError()voiduntested_spec316_requestMustNotThrowExceptionAndMustOnErrorTheSubscriber()-
Methods inherited from class org.reactivestreams.tck.WithHelperPublisher
createElement, createHelperPublisher, publisherExecutorService
-
-
-
-
Constructor Detail
-
IdentityProcessorVerification
public IdentityProcessorVerification(TestEnvironment env)
Test class must specify the expected time it takes for the publisher to shut itself down when the the last downstreamSubscriptionis cancelled. The processor will be required to be able to bufferTestEnvironment.TEST_BUFFER_SIZEelements.
-
IdentityProcessorVerification
public 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 downstreamSubscriptionis cancelled. The processor will be required to be able to bufferTestEnvironment.TEST_BUFFER_SIZEelements.- Parameters:
publisherReferenceGCTimeoutMillis- used to determine after how much time a reference to a Subscriber should be already dropped by the Publisher.
-
IdentityProcessorVerification
public 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 downstreamSubscriptionis cancelled.- Parameters:
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.
-
-
Method Detail
-
createIdentityProcessor
public abstract org.reactivestreams.Processor<T,T> createIdentityProcessor(int bufferSize)
This is the main method you must implement in your test incarnation. It must create aProcessor, which simply forwards all stream elements from its upstream to its downstream. It must be able to internally buffer the given number of elements.- Parameters:
bufferSize- number of elements the processor is required to be able to buffer.
-
createFailedPublisher
public abstract org.reactivestreams.Publisher<T> createFailedPublisher()
By implementing this method, additional TCK tests concerning a "failed" publishers will be run. The expected behaviour of thePublisherreturned by this method is hand out a subscription, followed by signallingonErroron it, as specified by Rule 1.9. If you want to ignore these additional tests, returnnullfrom this method.
-
maxElementsFromPublisher
public long maxElementsFromPublisher()
Override and return lower value if your Publisher is only able to produce a known number of elements. For example, if it is designed to return at-most-one element, return1from this method. Defaults toLong.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 anonCompleteoverride this method and returnLong.MAX_VALUE, which will result in *skipping all tests which require an onComplete to be triggered* (!).
-
boundedDepthOfOnNextAndRequestRecursion
public long boundedDepthOfOnNextAndRequestRecursion()
In order to verify rule 3.3 of the reactive streams spec, this number will be used to check if aSubscriptionactually solves the "unbounded recursion" problem by not allowing the number of recursive calls to exceed the number returned by this method.
-
skipStochasticTests
public boolean skipStochasticTests()
Override and returntruein order to skip executing tests marked asStochastic. Stochastic in this case means that the Rule is impossible or infeasible to deterministically verify— usually this means that this test case can yield false positives ("be green") even if for some case, the given implementation may violate the tested behaviour.
-
maxSupportedSubscribers
public long maxSupportedSubscribers()
Describes the tested implementation in terms of how many subscribers they can support. Some tests require thePublisherunder 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.
-
doesCoordinatedEmission
public boolean doesCoordinatedEmission()
Override this method and returntrueif theProcessorreturned by thecreateIdentityProcessor(int)coordinates itsSubscribers request amounts and only delivers onNext signals if all Subscribers have indicated (via their Subscription#request(long)) they are ready to receive elements.
-
setUp
@BeforeMethod public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
createPublisher
public org.reactivestreams.Publisher<T> createPublisher(long elements)
-
required_validate_maxElementsFromPublisher
public void required_validate_maxElementsFromPublisher() throws java.lang.Exception
Description copied from interface:PublisherVerificationRulesValidates that the override ofPublisherVerification.maxElementsFromPublisher()returns a non-negative value.- Specified by:
required_validate_maxElementsFromPublisherin interfacePublisherVerificationRules- Throws:
java.lang.Exception
-
required_validate_boundedDepthOfOnNextAndRequestRecursion
public void required_validate_boundedDepthOfOnNextAndRequestRecursion() throws java.lang.Exception
Description copied from interface:PublisherVerificationRulesValidates that the override ofPublisherVerification.boundedDepthOfOnNextAndRequestRecursion()returns a positive value.- Specified by:
required_validate_boundedDepthOfOnNextAndRequestRecursionin interfacePublisherVerificationRules- Throws:
java.lang.Exception
-
required_createPublisher1MustProduceAStreamOfExactly1Element
public void required_createPublisher1MustProduceAStreamOfExactly1Element() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for aPublisherthat should emit exactly one item and complete (both within a timeout specified byTestEnvironment.defaultTimeoutMillis()) in response to a request(1).The test is not executed if
PublisherVerification.maxElementsFromPublisher()returns zero. If this test fails, the following could be checked within thePublisherimplementation:- the
Publisher.subscribe(Subscriber)method has actual implementation, - in the
Publisher.subscribe(Subscriber)method, if there is an upstreamPublisher, thatPublisheris actually subscribed to, - if the
Publisheris part of a chain, all elements actually issue arequest()call in response to the test subscriber or by default to their upstream, - in the
Publisher.subscribe(Subscriber)method, theSubscriber.onSubscribeis called as part of the preparation process (usually before subscribing to otherPublishers), - if the
Publisherimplementation works for a consumer that callsrequest(1), - if the
Publisherimplementation is able to emit anonCompletewithout requests, - that the
Publisherimplementation does not emit more than the allowed elements (exactly one).
- Specified by:
required_createPublisher1MustProduceAStreamOfExactly1Elementin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_createPublisher3MustProduceAStreamOfExactly3Elements
public void required_createPublisher3MustProduceAStreamOfExactly3Elements() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for aPublisherthat should emit exactly three items and complete (all within a timeout specified byTestEnvironment.defaultTimeoutMillis()).The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.The tests requests one-by-one and verifies each single response item arrives in time.
If this test fails, the following could be checked within the
Publisherimplementation:- the
Publisher.subscribe(Subscriber)method has actual implementation, - in the
Publisher.subscribe(Subscriber)method, if there is an upstreamPublisher, thatPublisheris actually subscribed to, - if the
Publisheris part of a chain, all elements actually issue arequest()call in response to the test subscriber or by default to their upstream, - in the
Publisher.subscribe(Subscriber)method, theSubscriber.onSubscribeis called as part of the preparation process (usually before subscribing to otherPublishers), - if the
Publisherimplementation works for a subscriber that callsrequest(1)after consuming an item, - if the
Publisherimplementation is able to emit anonCompletewithout requests.
- Specified by:
required_createPublisher3MustProduceAStreamOfExactly3Elementsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements
public void required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for aPublisherthat responds to a request pattern of 0 (not requesting upfront), 1, 1 and 2 in a timely manner.Verifies rule: 1.1
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 5.This test ensures that the
Publisherimplementation correctly responds torequest()calls that in total are less than the number of elements thisPublishercould emit (thus the completion event won't be emitted).If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElementsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec102_maySignalLessThanRequestedAndTerminateSubscription
public void required_spec102_maySignalLessThanRequestedAndTerminateSubscription() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisherand verifies that requesting once and with more than the length (but bounded) results in the correct number of items to be emitted (i.e., length 3 and request 10) followed by anonCompletesignal.Verifies rule: 1.2
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.This test ensures that the
Publisherimplementation can deal with larger requests than the number of items it can produce.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass.
- Specified by:
required_spec102_maySignalLessThanRequestedAndTerminateSubscriptionin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
stochastic_spec103_mustSignalOnMethodsSequentially
public void stochastic_spec103_mustSignalOnMethodsSequentially() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(i.e., length 10), repeatedly subscribes to thisPublisher, requests items one by one and verifies thePublishercalls theonXXXmethods non-overlappingly.Verifies rule: 1.3
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 10.Note that this test is probabilistic, that is, may not capture any concurrent invocation in a {code Publisher} implementation. Note also that this test is sensitive to cases when a
request()call inonSubscribe()triggers an asynchronous call to the otheronXXXmethods. In contrast, the test allows synchronous call chain ofonSubscribe -> request -> onNext.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if a
request()call fromonSubscribe()could trigger an asynchronous call toonNext()and if so, make sure suchrequest()calls are deferred until the call toonSubscribe()returns normally.
- Specified by:
stochastic_spec103_mustSignalOnMethodsSequentiallyin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
optional_spec104_mustSignalOnErrorWhenFails
public void optional_spec104_mustSignalOnErrorWhenFails() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for an errorPublisherthat should callonSubscribeexactly once followed by a single call toonError()without receiving any requests and otherwise not throwing any exception.Verifies rule: 1.4
The test is not executed if
PublisherVerification.createErrorPublisher()returns null.If this test fails, the following could be checked within the error
Publisherimplementation:- the
Publisher.subscribe(Subscriber)method has actual implementation, - in the
Publisher.subscribe(Subscriber)method, if there is an upstreamPublisher, thatPublisheris actually subscribed to, - if the
Publisherimplementation does signal anonSubscribebefore signallingonError, - if the
Publisherimplementation is able to emit anonErrorwithout requests, - if the
Publisheris non-empty as this test requires aPublisherto signal anonErroreagerly.
- Specified by:
optional_spec104_mustSignalOnErrorWhenFailsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates
public void required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminates() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(i.e., length 3) and verifies, after requesting one by one, the sequence completes normally.Verifies rule: 1.5
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.Note that the tests requests 1 after the items have been received and before expecting an
onCompletesignal.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass,
- Specified by:
required_spec105_mustSignalOnCompleteWhenFiniteStreamTerminatesin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
optional_spec105_emptyStreamMustTerminateBySignallingOnComplete
public void optional_spec105_emptyStreamMustTerminateBySignallingOnComplete() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for an emptyPublisher(i.e., length 0) and verifies it completes in a timely manner.Verifies rule: 1.5
Note that the tests requests 1 before expecting an
onCompletesignal.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - if the
Publisheris non-empty as this test requires aPublisherwithout items.
- Specified by:
optional_spec105_emptyStreamMustTerminateBySignallingOnCompletein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled
public void untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because it is unclear this rule can be effectively checked on aPublisherinstance without looking into or hooking into the implementation of it.Verifies rule: 1.6
- Specified by:
untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalledin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled
public void required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a single-elementPublisherand checks if requesting after the terminal event doesn't lead to more items or terminal signals to be emitted.Verifies rule: 1.7
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 1.The tests requests more items than the expected
Publisherlength upfront and some more items after its completion.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - the indication for the terminal state is properly persisted and a request call can't trigger emission of more items or another terminal signal.
- Specified by:
required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalledin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled
public void untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalled() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped, although it is possible to validate an errorPublisheralong the same lines asPublisherVerificationRules.required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled().Verifies rule: 1.7
- Specified by:
untested_spec107_mustNotEmitFurtherSignalsOnceOnErrorHasBeenSignalledin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals
public void untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignals() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because there was no agreement on how to verify its "eventually" requirement.Verifies rule: 1.8
- Specified by:
untested_spec108_possiblyCanceledSubscriptionShouldNotReceiveOnErrorOrOnCompleteSignalsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
untested_spec109_subscribeShouldNotThrowNonFatalThrowable
public void untested_spec109_subscribeShouldNotThrowNonFatalThrowable() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because there is no common agreement on what is to be considered a fatal exception and besides,Publisher.subscribeis only allowed throw aNullPointerExceptionand any other exception would require looking into or hooking into the implementation of thePublisher.Verifies rule: 1.9
- Specified by:
untested_spec109_subscribeShouldNotThrowNonFatalThrowablein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
required_spec109_subscribeThrowNPEOnNullSubscriber
public void required_spec109_subscribeThrowNPEOnNullSubscriber() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for an emptyPublisherand callssubscribeon it withnullthat should result in aNullPointerExceptionto be thrown.Verifies rule: 1.9
If this test fails, check if the
subscribe()implementation has an explicit null check (or a method dereference on theSubscriber), especially if the incomingSubscriberis wrapped or stored to be used later.- Specified by:
required_spec109_subscribeThrowNPEOnNullSubscriberin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe
public void required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for an errorPublisherthat should callonSubscribeexactly once followed by a single call toonError()without receiving any requests.Verifies rule: 1.9
The test is not executed if
PublisherVerification.createErrorPublisher()returns null.The difference between this test and
PublisherVerificationRules.optional_spec104_mustSignalOnErrorWhenFails()is that there is no explicit verification if exceptions were thrown in addition to the regularonSubscribe+onErrorsignal pair.If this test fails, the following could be checked within the error
Publisherimplementation:- the
Publisher.subscribe(Subscriber)method has actual implementation, - in the
Publisher.subscribe(Subscriber)method, if there is an upstreamPublisher, thatPublisheris actually subscribed to, - if the
Publisherimplementation is able to emit anonErrorwithout requests, - if the
Publisheris non-empty as this test expects aPublisherwithout items.
- Specified by:
required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec109_mustIssueOnSubscribeForNonNullSubscriber
public void required_spec109_mustIssueOnSubscribeForNonNullSubscriber() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for an emptyPublisherand verifies ifonSubscribesignal was emitted before any otheronNext,onErrororonCompletesignal.Verifies rule: 1.9
Note that this test doesn't request anything, however, an
onNextis not considered as a failure.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - the
Publisher.subscribe(Subscriber)method has actual implementation, - in the
Publisher.subscribe(Subscriber)method, if there is an upstreamPublisher, thatPublisheris actually subscribed to, - in the
Publisher.subscribe(Subscriber)method, theSubscriber.onSubscribeis called as part of the preparation process (usually before subscribing to otherPublishers).
- Specified by:
required_spec109_mustIssueOnSubscribeForNonNullSubscriberin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice
public void untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because enforcing rule §1.10 requires unlimited retention and reference-equal checks on all incomingSubscriberwhich is generally infeasible, plus reusing the sameSubscriberinstance is better detected (or ignored) insideSubscriber.onSubscribewhen the method is called multiple times.Verifies rule: 1.10
- Specified by:
untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwicein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
optional_spec111_maySupportMultiSubscribe
public void optional_spec111_maySupportMultiSubscribe() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a single-elementPublisherand subscribes to it twice, without consuming with eitherSubscriberinstance (i.e., no requests are issued).Verifies rule: 1.11
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 1.Note that this test ignores what signals the
Publisheremits. Any exception thrown through non-regular means will indicate a skipped test.- Specified by:
optional_spec111_maySupportMultiSubscribein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals
public void optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a single-elementPublisherand subscribes to it twice. EachSubscriberrequests for 1 element and checks if onNext or onComplete signals was received.Verifies rule: 1.11, and depends on valid implementation of rule 1.5 in order to verify this.
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 1.Any exception thrown through non-regular means will indicate a skipped test.
- Specified by:
optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignalsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
-
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 5), subscribes 3Subscribers to it, requests with different patterns and checks if all 3 received the same events in the same order.Verifies rule: 1.11
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 5.The request pattern for the first
Subscriberis (1, 1, 2, 1); for the second is (2, 3) and for the third is (3, 1, 1).Note that this test requires a
Publisherthat always emits the same signals to anySubscriber, regardless of when they subscribe and how they request elements. I.e., a "live"Publisheremitting the current time would not pass this test.Note that this test is optional and may appear skipped even if the behavior should be actually supported by the
Publisher, see the skip message for an indication of this.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOnein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3), subscribes 3Subscribers to it, requests more than the length items upfront with each and verifies they all received the same items in the same order (but does not verify they all complete).Verifies rule: 1.11
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.Note that this test requires a
Publisherthat always emits the same signals to anySubscriber, regardless of when they subscribe and how they request elements. I.e., a "live"Publisheremitting the current time would not pass this test.Note that this test is optional and may appear skipped even if the behavior should be actually supported by the
Publisher, see the skip message for an indication of this.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected
public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpected() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3), subscribes 3Subscribers to it, requests more than the length items upfront with each and verifies they all received the same items in the same order followed by anonCompletesignal.Verifies rule: 1.11
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.Note that this test requires a
Publisherthat always emits the same signals to anySubscriber, regardless of when they subscribe and how they request elements. I.e., a "live"Publisheremitting the current time would not pass this test.Note that this test is optional and may appear skipped even if the behavior should be actually supported by the
Publisher, see the skip message for an indication of this.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfrontAndCompleteAsExpectedin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe
public void required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribe() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 6), requests several times from withinonSubscribeand then requests one-by-one fromonNext.Verifies rule: 3.2
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 6.The request pattern is 3 x 1 from within
onSubscribeand one from within eachonNextinvocation.The test consumes the
Publisherbut otherwise doesn't verify thePublishercompletes (however, it checks for errors).If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
required_spec302_mustAllowSynchronousRequestCallsFromOnNextAndOnSubscribein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec303_mustNotAllowUnboundedRecursion
public void required_spec303_mustNotAllowUnboundedRecursion() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for aPublisherwith length equal to the value returned byPublisherVerificationRules.required_validate_boundedDepthOfOnNextAndRequestRecursion()plus 1, callsrequest(1)externally and then from withinonNextand checks if the stack depth did not increase beyond the amount permitted byPublisherVerificationRules.required_validate_boundedDepthOfOnNextAndRequestRecursion().Verifies rule: 3.3
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less thanPublisherVerificationRules.required_validate_boundedDepthOfOnNextAndRequestRecursion()plus 1.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the implementation doesn't allow unbounded recursion when
request()is called from withinonNext, i.e., the lack of reentrant-safe state machine around the request amount (such as a for loop with a bound on the parameternthat callsonNext).
- Specified by:
required_spec303_mustNotAllowUnboundedRecursionin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
untested_spec304_requestShouldNotPerformHeavyComputations
public void untested_spec304_requestShouldNotPerformHeavyComputations() throws java.lang.Exception
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because arequestcould enter into a synchronous computation viaonNextlegally and otherwise there is no common agreement how to detect such heavy computation reliably.Verifies rule: 3.4
- Specified by:
untested_spec304_requestShouldNotPerformHeavyComputationsin interfacePublisherVerificationRules- Throws:
java.lang.Exception
-
untested_spec305_cancelMustNotSynchronouslyPerformHeavyComputation
public void untested_spec305_cancelMustNotSynchronouslyPerformHeavyComputation() throws java.lang.Exception
Description copied from interface:PublisherVerificationRulesCurrently, this test is skipped because there is no reliable agreed upon way to detect a heavy computation.Verifies rule: 3.5
- Specified by:
untested_spec305_cancelMustNotSynchronouslyPerformHeavyComputationin interfacePublisherVerificationRules- Throws:
java.lang.Exception
-
required_spec306_afterSubscriptionIsCancelledRequestMustBeNops
public void required_spec306_afterSubscriptionIsCancelledRequestMustBeNops() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3) and verifies that cancelling without requesting anything, then requesting items should result in no signals to be emitted.Verifies rule: 3.6
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.The post-cancellation request pattern is (1, 1, 1).
If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the cancellation indicator flag is properly persisted (may require volatile) and checked as part of the signal emission process.
- Specified by:
required_spec306_afterSubscriptionIsCancelledRequestMustBeNopsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops
public void required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNops() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a single-elementPublisherand verifies that without requesting anything, cancelling the sequence multiple times should result in no signals to be emitted and should result in an thrown exception.Verifies rule: 3.7
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 1.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the cancellation indicator flag is properly persisted (may require volatile) and checked as part of the signal emission process.
- Specified by:
required_spec307_afterSubscriptionIsCancelledAdditionalCancelationsMustBeNopsin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec309_requestZeroMustSignalIllegalArgumentException
public void required_spec309_requestZeroMustSignalIllegalArgumentException() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 10) and issues arequest(0)which should trigger anonErrorcall with anIllegalArgumentException.Verifies rule: 3.9
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 10.Note that this test expects the
IllegalArgumentExceptionbeing signalled throughonError, not by throwing fromrequest()(which is also forbidden) or signalling the error by any other means (i.e., through theThread.currentThread().getUncaughtExceptionHandler()for example).Note also that requesting and emission may happen concurrently and honoring this rule may require extra coordination within the
Publisher.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the
Publishercan emit anonErrorin this particular case, even if there was no prior and legalrequestcall and even if thePublisherwould like to emit items first before emitting anonErrorin general.
- Specified by:
required_spec309_requestZeroMustSignalIllegalArgumentExceptionin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec309_requestNegativeNumberMustSignalIllegalArgumentException
public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 10) and issues a random, negativerequest()call which should trigger anonErrorcall with anIllegalArgumentException.Verifies rule: 3.9
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 10.Note that this test expects the
IllegalArgumentExceptionbeing signalled throughonError, not by throwing fromrequest()(which is also forbidden) or signalling the error by any other means (i.e., through theThread.currentThread().getUncaughtExceptionHandler()for example).Note also that requesting and emission may happen concurrently and honoring this rule may require extra coordination within the
Publisher.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the
Publishercan emit anonErrorin this particular case, even if there was no prior and legalrequestcall and even if thePublisherwould like to emit items first before emitting anonErrorin general.
- Specified by:
required_spec309_requestNegativeNumberMustSignalIllegalArgumentExceptionin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
optional_spec309_requestNegativeNumberMaySignalIllegalArgumentExceptionWithSpecificMessage
public void optional_spec309_requestNegativeNumberMaySignalIllegalArgumentExceptionWithSpecificMessage() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 10) and issues a random, negativerequest()call which should trigger anonErrorcall with anIllegalArgumentException.Verifies rule: 3.9
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 10.Note that this test expects the
IllegalArgumentExceptionbeing signalled throughonError, not by throwing fromrequest()(which is also forbidden) or signalling the error by any other means (i.e., through theThread.currentThread().getUncaughtExceptionHandler()for example).Note also that requesting and emission may happen concurrently and honoring this rule may require extra coordination within the
Publisher.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the
Publishercan emit anonErrorin this particular case, even if there was no prior and legalrequestcall and even if thePublisherwould like to emit items first before emitting anonErrorin general.
- Specified by:
optional_spec309_requestNegativeNumberMaySignalIllegalArgumentExceptionWithSpecificMessagein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling
public void required_spec312_cancelMustMakeThePublisherToEventuallyStopSignaling() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 20), requests some items (less than the length), consumes one item then cancels the sequence and verifies the publisher emitted at most the requested amount and stopped emitting (or terminated).Verifies rule: 3.12
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 20.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the cancellation indicator flag is properly persisted (may require volatile) and checked as part of the signal emission process.
- Specified by:
required_spec312_cancelMustMakeThePublisherToEventuallyStopSignalingin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber
public void required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3) requests and consumes one element from it, cancels theSubscription, callsSystem.gc()and then checks if all references to the testSubscriberhas been dropped (by checking theWeakReferencehas been emptied).Verifies rule: 3.13
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - the cancellation indicator flag is properly persisted (may require volatile) and checked as part of the signal emission process.
- the
Publisherstores theSubscriberreference somewhere which is then not cleaned up when theSubscriberis cancelled. Note that this may happen on many code paths in aPublisher, for example in an emission loop that terminates because of thecancelsignal or because reaching a terminal state. Note also that eagerly nullingSubscriberreferences may not be necessary for this test to pass in case there is a self-contained chain of them (i.e.,Publisher.subscribe()creates a chain of freshSubscriberinstances where each of them only references their downstreamSubscriberthus the chain can get GC'd when the reference to the finalSubscriberis dropped).
- Specified by:
required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriberin interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec317_mustSupportAPendingElementCountUpToLongMaxValue
public void required_spec317_mustSupportAPendingElementCountUpToLongMaxValue() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3) and requestsLong.MAX_VALUEfrom it, verifying that thePublisheremits all of its items and completes normally and does not keep spinning attempting to fulfill theLong.MAX_VALUEdemand by some means.Verifies rule: 3.17
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
required_spec317_mustSupportAPendingElementCountUpToLongMaxValuein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue
public void required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValue() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a shortPublisher(length 3) and requestsLong.MAX_VALUEfrom it in total (split across twoLong.MAX_VALUE / 2and onerequest(1)), verifying that thePublisheremits all of its items and completes normally.Verifies rule: 3.17
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less than 3.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherimplements adding individual request amounts together properly (not overflowing into zero or negative pending request amounts) or not properly deducing the number of emitted items from the pending amount, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
required_spec317_mustSupportACumulativePendingElementCountUpToLongMaxValuein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue
public void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue() throws java.lang.Throwable
Description copied from interface:PublisherVerificationRulesAsks for a very longPublisher(up toInteger.MAX_VALUE), requestsLong.MAX_VALUE - 1after each received item and expects no failure due to a potential overflow in the pending emission count while consuming 10 items and cancelling the sequence.Verifies rule: 3.17
The test is not executed if
PublisherVerification.maxElementsFromPublisher()is less thanInteger.MAX_VALUE.The request pattern is one
request(1)upfront and tenrequest(Long.MAX_VALUE - 1)after.If this test fails, the following could be checked within the
Publisherimplementation:- the
TestEnvironmenthas large enough timeout specified in case thePublisherhas some time-delay behavior, - make sure the
PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element()andPublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements()tests pass, - if the
Publisherimplementation considers the cumulative request amount it receives, - if the
Publisherimplements adding individual request amounts together properly (not overflowing into zero or negative pending request amounts) or not properly deducing the number of emitted items from the pending amount, - if the
Publisherdoesn't lose anyrequest()signal and the state transition from idle -> emitting or emitting -> keep emitting works properly.
- Specified by:
required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValuein interfacePublisherVerificationRules- Throws:
java.lang.Throwable
- the
-
required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError
public void required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError() throws java.lang.Throwable
Asks for aProcessorthat supports at least 2Subscribers at once and checks if twoSubscribers receive the same items and a terminalException.If the
Processorrequests and/or emits items only when all of itsSubscribers have requested, overridedoesCoordinatedEmission()and returntrueto indicate this property.Verifies rule: 1.4 with multiple
Subscribers.The test is not executed if
maxSupportedSubscribers()is less than 2.If this test fails, the following could be checked within the
Processorimplementation:- The
TestEnvironmenthas large enough timeout specified in case theProcessorhas some time-delay behavior. - The
Processoris able to fulfill requests of itsSubscribers independently of each other's requests or else overridedoesCoordinatedEmission()and returntrueto indicate the testSubscribers both have to request first.
- Throws:
java.lang.Throwable
- The
-
createSubscriber
public org.reactivestreams.Subscriber<T> createSubscriber(SubscriberWhiteboxVerification.WhiteboxSubscriberProbe<T> probe)
-
mustImmediatelyPassOnOnErrorEventsReceivedFromItsUpstreamToItsDownstream
public void mustImmediatelyPassOnOnErrorEventsReceivedFromItsUpstreamToItsDownstream() 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
-
required_mustRequestFromUpstreamForElementsThatHaveBeenRequestedLongAgo
public void required_mustRequestFromUpstreamForElementsThatHaveBeenRequestedLongAgo() throws java.lang.Throwable
Asks for aProcessorthat supports at least 2Subscribers at once and checks requests fromSubscribers will eventually lead to requests towards the upstream of theProcessor.If the
Processorrequests and/or emits items only when all of itsSubscribers have requested, overridedoesCoordinatedEmission()and returntrueto indicate this property.Verifies rule: 2.1 with multiple
Subscribers.The test is not executed if
maxSupportedSubscribers()is less than 2.If this test fails, the following could be checked within the
Processorimplementation:- The
TestEnvironmenthas large enough timeout specified in case theProcessorhas some time-delay behavior. - The
Processoris able to fulfill requests of itsSubscribers independently of each other's requests or else overridedoesCoordinatedEmission()and returntrueto indicate the testSubscribers both have to request first.
- Throws:
java.lang.Throwable
- The
-
notVerified
public void notVerified()
-
notVerified
public void notVerified(java.lang.String message)
-
optionalMultipleSubscribersTest
public void optionalMultipleSubscribersTest(long requiredSubscribersSupport, Function<java.lang.Long,IdentityProcessorVerification.TestSetup> body) throws java.lang.Throwable
Test for feature that REQUIRES multiple subscribers to be supported by Publisher.- Throws:
java.lang.Throwable
-
-