Class FlowPublisherVerification<T>

  • All Implemented Interfaces:
    PublisherVerificationRules

    public abstract class FlowPublisherVerification<T>
    extends PublisherVerification<T>
    Provides tests for verifying a Java 9+ Flow.Publisher specification rules.
    See Also:
    Flow.Publisher
    • Constructor Detail

      • FlowPublisherVerification

        public FlowPublisherVerification​(TestEnvironment env,
                                         long publisherReferenceGCTimeoutMillis)
      • FlowPublisherVerification

        public FlowPublisherVerification​(TestEnvironment env)
    • Method Detail

      • createPublisher

        public final Publisher<T> createPublisher​(long elements)
        Description copied from class: PublisherVerification
        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.
        Specified by:
        createPublisher in class PublisherVerification<T>
      • createFlowPublisher

        public abstract java.util.concurrent.Flow.Publisher<T> createFlowPublisher​(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 final Publisher<T> createFailedPublisher()
        Description copied from class: PublisherVerification
        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.
        Specified by:
        createFailedPublisher in class PublisherVerification<T>
      • createFailedFlowPublisher

        public abstract java.util.concurrent.Flow.Publisher<T> createFailedFlowPublisher()
        By implementing this method, additional TCK tests concerning a "failed" publishers will be run. The expected behaviour of the Flow.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.