Class PublisherVerification<T>

    • Field Detail

      • PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS_ENV

        private static final java.lang.String PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS_ENV
        See Also:
        Constant Field Values
      • DEFAULT_PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS

        private static final long DEFAULT_PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS
        See Also:
        Constant Field Values
      • publisherReferenceGCTimeoutMillis

        private final long publisherReferenceGCTimeoutMillis
        The amount of time after which a cancelled Subscriber reference should be dropped. See Rule 3.13 for details.
      • SKIPPING_NO_ERROR_PUBLISHER_AVAILABLE

        public static final java.lang.String SKIPPING_NO_ERROR_PUBLISHER_AVAILABLE
        See Also:
        Constant Field Values
      • SKIPPING_OPTIONAL_TEST_FAILED

        public static final java.lang.String SKIPPING_OPTIONAL_TEST_FAILED
        See Also:
        Constant Field Values
    • Constructor Detail

      • PublisherVerification

        public PublisherVerification​(TestEnvironment env,
                                     long publisherReferenceGCTimeoutMillis)
        Constructs a new verification class using the given env and configuration.
        Parameters:
        publisherReferenceGCTimeoutMillis - used to determine after how much time a reference to a Subscriber should be already dropped by the Publisher.
      • PublisherVerification

        public PublisherVerification​(TestEnvironment env)
        Constructs a new verification class using the given env and configuration. The value for publisherReferenceGCTimeoutMillis will be obtained by using envPublisherReferenceGCTimeoutMillis().
    • Method Detail

      • envPublisherReferenceGCTimeoutMillis

        public static long envPublisherReferenceGCTimeoutMillis()
        Tries to parse the env variable PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS as long and returns the value if present, OR its default value (DEFAULT_PUBLISHER_REFERENCE_GC_TIMEOUT_MILLIS). This value is used to determine after how much time a reference to a Subscriber should be already dropped by the Publisher.
        Throws:
        java.lang.IllegalArgumentException - when unable to parse the env variable
      • createPublisher

        public abstract Publisher<T> createPublisher​(long elements)
        This is the main method you must implement in your test incarnation. It must create a Publisher for a stream with exactly the given number of elements. If `elements` is `Long.MAX_VALUE` the produced stream must be infinite.
      • createFailedPublisher

        public abstract Publisher<T> createFailedPublisher()
        By implementing this method, additional TCK tests concerning a "failed" publishers will be run. The expected behaviour of the 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.
      • 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, return 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* (!).
      • skipStochasticTests

        public boolean skipStochasticTests()
        Override and return true in order to skip executing tests marked as Stochastic. 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.
      • boundedDepthOfOnNextAndRequestRecursion

        public long boundedDepthOfOnNextAndRequestRecursion()
        In order to verify rule 3.3 of the reactive streams spec, this number will be used to check if a Subscription actually solves the "unbounded recursion" problem by not allowing the number of recursive calls to exceed the number returned by this method.
        See Also:
        reactive streams spec, rule 3.3, required_spec303_mustNotAllowUnboundedRecursion()
      • setUp

        @BeforeMethod
        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • required_createPublisher1MustProduceAStreamOfExactly1Element

        public void required_createPublisher1MustProduceAStreamOfExactly1Element()
                                                                          throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a Publisher that should emit exactly one item and complete (both within a timeout specified by TestEnvironment.defaultTimeoutMillis()) in response to a request(1).

        The test is not executed if maxElementsFromPublisher() returns zero. If this test fails, the following could be checked within the Publisher implementation:

        • the Publisher.subscribe(Subscriber) method has actual implementation,
        • in the Publisher.subscribe(Subscriber) method, if there is an upstream Publisher, that Publisher is actually subscribed to,
        • if the Publisher is part of a chain, all elements actually issue a request() call in response to the test subscriber or by default to their upstream,
        • in the Publisher.subscribe(Subscriber) method, the Subscriber.onSubscribe is called as part of the preparation process (usually before subscribing to other Publishers),
        • if the Publisher implementation works for a consumer that calls request(1),
        • if the Publisher implementation is able to emit an onComplete without requests,
        • that the Publisher implementation does not emit more than the allowed elements (exactly one).
        Specified by:
        required_createPublisher1MustProduceAStreamOfExactly1Element in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_createPublisher3MustProduceAStreamOfExactly3Elements

        public void required_createPublisher3MustProduceAStreamOfExactly3Elements()
                                                                           throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a Publisher that should emit exactly three items and complete (all within a timeout specified by TestEnvironment.defaultTimeoutMillis()).

        The test is not executed if 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 Publisher implementation:

        • the Publisher.subscribe(Subscriber) method has actual implementation,
        • in the Publisher.subscribe(Subscriber) method, if there is an upstream Publisher, that Publisher is actually subscribed to,
        • if the Publisher is part of a chain, all elements actually issue a request() call in response to the test subscriber or by default to their upstream,
        • in the Publisher.subscribe(Subscriber) method, the Subscriber.onSubscribe is called as part of the preparation process (usually before subscribing to other Publishers),
        • if the Publisher implementation works for a subscriber that calls request(1) after consuming an item,
        • if the Publisher implementation is able to emit an onComplete without requests.
        Specified by:
        required_createPublisher3MustProduceAStreamOfExactly3Elements in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • stochastic_spec103_mustSignalOnMethodsSequentially

        public void stochastic_spec103_mustSignalOnMethodsSequentially()
                                                                throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (i.e., length 10), repeatedly subscribes to this Publisher, requests items one by one and verifies the Publisher calls the onXXX methods non-overlappingly.

        Verifies rule: 1.3

        The test is not executed if 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 in onSubscribe() triggers an asynchronous call to the other onXXX methods. In contrast, the test allows synchronous call chain of onSubscribe -> request -> onNext.

        If this test fails, the following could be checked within the Publisher implementation:

        Specified by:
        stochastic_spec103_mustSignalOnMethodsSequentially in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec104_mustSignalOnErrorWhenFails

        public void optional_spec104_mustSignalOnErrorWhenFails()
                                                         throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for an error Publisher that should call onSubscribe exactly once followed by a single call to onError() 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 Publisher implementation:

        • the Publisher.subscribe(Subscriber) method has actual implementation,
        • in the Publisher.subscribe(Subscriber) method, if there is an upstream Publisher, that Publisher is actually subscribed to,
        • if the Publisher implementation does signal an onSubscribe before signalling onError,
        • if the Publisher implementation is able to emit an onError without requests,
        • if the Publisher is non-empty as this test requires a Publisher to signal an onError eagerly.
        Specified by:
        optional_spec104_mustSignalOnErrorWhenFails in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec105_emptyStreamMustTerminateBySignallingOnComplete

        public void optional_spec105_emptyStreamMustTerminateBySignallingOnComplete()
                                                                             throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for an empty Publisher (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 onComplete signal.

        If this test fails, the following could be checked within the Publisher implementation:

        • the TestEnvironment has large enough timeout specified in case the Publisher has some time-delay behavior,
        • if the Publisher is non-empty as this test requires a Publisher without items.
        Specified by:
        optional_spec105_emptyStreamMustTerminateBySignallingOnComplete in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled

        public void required_spec107_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled()
                                                                                      throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a single-element Publisher and 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 maxElementsFromPublisher() is less than 1.

        The tests requests more items than the expected Publisher length upfront and some more items after its completion.

        If this test fails, the following could be checked within the Publisher implementation:

        • the TestEnvironment has large enough timeout specified in case the Publisher has 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_mustNotEmitFurtherSignalsOnceOnCompleteHasBeenSignalled in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • untested_spec109_subscribeShouldNotThrowNonFatalThrowable

        public void untested_spec109_subscribeShouldNotThrowNonFatalThrowable()
                                                                       throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Currently, this test is skipped because there is no common agreement on what is to be considered a fatal exception and besides, Publisher.subscribe is only allowed throw a NullPointerException and any other exception would require looking into or hooking into the implementation of the Publisher.

        Verifies rule: 1.9

        Specified by:
        untested_spec109_subscribeShouldNotThrowNonFatalThrowable in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec109_subscribeThrowNPEOnNullSubscriber

        public void required_spec109_subscribeThrowNPEOnNullSubscriber()
                                                                throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for an empty Publisher and calls subscribe on it with null that should result in a NullPointerException to 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 the Subscriber), especially if the incoming Subscriber is wrapped or stored to be used later.

        Specified by:
        required_spec109_subscribeThrowNPEOnNullSubscriber in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec109_mustIssueOnSubscribeForNonNullSubscriber

        public void required_spec109_mustIssueOnSubscribeForNonNullSubscriber()
                                                                       throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for an empty Publisher and verifies if onSubscribe signal was emitted before any other onNext, onError or onComplete signal.

        Verifies rule: 1.9

        Note that this test doesn't request anything, however, an onNext is not considered as a failure.

        If this test fails, the following could be checked within the Publisher implementation:

        • the TestEnvironment has large enough timeout specified in case the Publisher has some time-delay behavior,
        • the Publisher.subscribe(Subscriber) method has actual implementation,
        • in the Publisher.subscribe(Subscriber) method, if there is an upstream Publisher, that Publisher is actually subscribed to,
        • in the Publisher.subscribe(Subscriber) method, the Subscriber.onSubscribe is called as part of the preparation process (usually before subscribing to other Publishers).
        Specified by:
        required_spec109_mustIssueOnSubscribeForNonNullSubscriber in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe

        public void required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe()
                                                                                                                                            throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for an error Publisher that should call onSubscribe exactly once followed by a single call to onError() 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 regular onSubscribe+onError signal pair.

        If this test fails, the following could be checked within the error Publisher implementation:

        • the Publisher.subscribe(Subscriber) method has actual implementation,
        • in the Publisher.subscribe(Subscriber) method, if there is an upstream Publisher, that Publisher is actually subscribed to,
        • if the Publisher implementation is able to emit an onError without requests,
        • if the Publisher is non-empty as this test expects a Publisher without items.
        Specified by:
        required_spec109_mayRejectCallsToSubscribeIfPublisherIsUnableOrUnwillingToServeThemRejectionMustTriggerOnErrorAfterOnSubscribe in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice

        public void untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice()
                                                                                           throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Currently, this test is skipped because enforcing rule §1.10 requires unlimited retention and reference-equal checks on all incoming Subscriber which is generally infeasible, plus reusing the same Subscriber instance is better detected (or ignored) inside Subscriber.onSubscribe when the method is called multiple times.

        Verifies rule: 1.10

        Specified by:
        untested_spec110_rejectASubscriptionRequestIfTheSameSubscriberSubscribesTwice in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec111_maySupportMultiSubscribe

        public void optional_spec111_maySupportMultiSubscribe()
                                                       throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a single-element Publisher and subscribes to it twice, without consuming with either Subscriber instance (i.e., no requests are issued).

        Verifies rule: 1.11

        The test is not executed if maxElementsFromPublisher() is less than 1.

        Note that this test ignores what signals the Publisher emits. Any exception thrown through non-regular means will indicate a skipped test.

        Specified by:
        optional_spec111_maySupportMultiSubscribe in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals

        public void optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals()
                                                                                        throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a single-element Publisher and subscribes to it twice. Each Subscriber requests 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 maxElementsFromPublisher() is less than 1.

        Any exception thrown through non-regular means will indicate a skipped test.

        Specified by:
        optional_spec111_registeredSubscribersMustReceiveOnNextOrOnCompleteSignals in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne

        public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne()
                                                                                                                               throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (length 5), subscribes 3 Subscribers 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 maxElementsFromPublisher() is less than 5.

        The request pattern for the first Subscriber is (1, 1, 2, 1); for the second is (2, 3) and for the third is (3, 1, 1).

        Note that this test requires a Publisher that always emits the same signals to any Subscriber, regardless of when they subscribe and how they request elements. I.e., a "live" Publisher emitting 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 Publisher implementation:

        Specified by:
        optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingOneByOne in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront

        public void optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront()
                                                                                                                                  throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (length 3), subscribes 3 Subscribers 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 maxElementsFromPublisher() is less than 3.

        Note that this test requires a Publisher that always emits the same signals to any Subscriber, regardless of when they subscribe and how they request elements. I.e., a "live" Publisher emitting 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 Publisher implementation:

        Specified by:
        optional_spec111_multicast_mustProduceTheSameElementsInTheSameSequenceToAllOfItsSubscribersWhenRequestingManyUpfront in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • untested_spec304_requestShouldNotPerformHeavyComputations

        public void untested_spec304_requestShouldNotPerformHeavyComputations()
                                                                       throws java.lang.Exception
        Description copied from interface: PublisherVerificationRules
        Currently, this test is skipped because a request could enter into a synchronous computation via onNext legally and otherwise there is no common agreement how to detect such heavy computation reliably.

        Verifies rule: 3.4

        Specified by:
        untested_spec304_requestShouldNotPerformHeavyComputations in interface PublisherVerificationRules
        Throws:
        java.lang.Exception
      • required_spec309_requestZeroMustSignalIllegalArgumentException

        public void required_spec309_requestZeroMustSignalIllegalArgumentException()
                                                                            throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (length 10) and issues a request(0) which should trigger an onError call with an IllegalArgumentException.

        Verifies rule: 3.9

        The test is not executed if maxElementsFromPublisher() is less than 10.

        Note that this test expects the IllegalArgumentException being signalled through onError, not by throwing from request() (which is also forbidden) or signalling the error by any other means (i.e., through the Thread.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 Publisher implementation:

        Specified by:
        required_spec309_requestZeroMustSignalIllegalArgumentException in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec309_requestNegativeNumberMustSignalIllegalArgumentException

        public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentException()
                                                                                      throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (length 10) and issues a random, negative request() call which should trigger an onError call with an IllegalArgumentException.

        Verifies rule: 3.9

        The test is not executed if maxElementsFromPublisher() is less than 10.

        Note that this test expects the IllegalArgumentException being signalled through onError, not by throwing from request() (which is also forbidden) or signalling the error by any other means (i.e., through the Thread.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 Publisher implementation:

        Specified by:
        required_spec309_requestNegativeNumberMustSignalIllegalArgumentException in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber

        public void required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber()
                                                                                                   throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a short Publisher (length 3) requests and consumes one element from it, cancels the Subscription , calls System.gc() and then checks if all references to the test Subscriber has been dropped (by checking the WeakReference has been emptied).

        Verifies rule: 3.13

        The test is not executed if maxElementsFromPublisher() is less than 3.

        If this test fails, the following could be checked within the Publisher implementation:

        • the TestEnvironment has large enough timeout specified in case the Publisher has some time-delay behavior,
        • make sure the PublisherVerificationRules.required_createPublisher1MustProduceAStreamOfExactly1Element() and PublisherVerificationRules.required_createPublisher3MustProduceAStreamOfExactly3Elements() tests pass,
        • the cancellation indicator flag is properly persisted (may require volatile) and checked as part of the signal emission process.
        • the Publisher stores the Subscriber reference somewhere which is then not cleaned up when the Subscriber is cancelled. Note that this may happen on many code paths in a Publisher, for example in an emission loop that terminates because of the cancel signal or because reaching a terminal state. Note also that eagerly nulling Subscriber references 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 fresh Subscriber instances where each of them only references their downstream Subscriber thus the chain can get GC'd when the reference to the final Subscriber is dropped).
        Specified by:
        required_spec313_cancelMustMakeThePublisherEventuallyDropAllReferencesToTheSubscriber in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue

        public void required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue()
                                                                               throws java.lang.Throwable
        Description copied from interface: PublisherVerificationRules
        Asks for a very long Publisher (up to Integer.MAX_VALUE), requests Long.MAX_VALUE - 1 after 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 maxElementsFromPublisher() is less than Integer.MAX_VALUE.

        The request pattern is one request(1) upfront and ten request(Long.MAX_VALUE - 1) after.

        If this test fails, the following could be checked within the Publisher implementation:

        Specified by:
        required_spec317_mustNotSignalOnErrorWhenPendingAboveLongMaxValue in interface PublisherVerificationRules
        Throws:
        java.lang.Throwable
      • activePublisherTest

        public void activePublisherTest​(long elements,
                                        boolean completionSignalRequired,
                                        PublisherVerification.PublisherTestRun<T> body)
                                 throws java.lang.Throwable
        Test for feature that SHOULD/MUST be implemented, using a live publisher.
        Parameters:
        elements - the number of elements the Publisher under test must be able to emit to run this test
        completionSignalRequired - true if an onComplete signal is required by this test to run. If the tested Publisher is unable to signal completion, tests requireing onComplete signals will be skipped. To signal if your Publisher is able to signal completion see maxElementsFromPublisher().
        Throws:
        java.lang.Throwable
      • optionalActivePublisherTest

        public void optionalActivePublisherTest​(long elements,
                                                boolean completionSignalRequired,
                                                PublisherVerification.PublisherTestRun<T> body)
                                         throws java.lang.Throwable
        Test for feature that MAY be implemented. This test will be marked as SKIPPED if it fails.
        Parameters:
        elements - the number of elements the Publisher under test must be able to emit to run this test
        completionSignalRequired - true if an onComplete signal is required by this test to run. If the tested Publisher is unable to signal completion, tests requireing onComplete signals will be skipped. To signal if your Publisher is able to signal completion see maxElementsFromPublisher().
        Throws:
        java.lang.Throwable
      • whenHasErrorPublisherTest

        public void whenHasErrorPublisherTest​(PublisherVerification.PublisherTestRun<T> body)
                                       throws java.lang.Throwable
        Additional test for Publisher in error state
        Throws:
        java.lang.Throwable
      • stochasticTest

        public void stochasticTest​(int n,
                                   Function<java.lang.Integer,​java.lang.Void> body)
                            throws java.lang.Throwable
        Executes a given test body n times. All the test runs must pass in order for the stochastic test to pass.
        Throws:
        java.lang.Throwable
      • notVerified

        public void notVerified()
      • publisherUnableToSignalOnComplete

        public long publisherUnableToSignalOnComplete()
        Return this value from maxElementsFromPublisher() to mark that the given Publisher, is not able to signal completion. For example it is strictly a time-bound or unbounded source of data. Returning this value from maxElementsFromPublisher() will result in skipping all TCK tests which require onComplete signals!
      • notVerified

        public void notVerified​(java.lang.String message)