Interface SubscriberWhiteboxVerification.SubscriberPuppet

  • Enclosing class:
    SubscriberWhiteboxVerification<T>

    public static interface SubscriberWhiteboxVerification.SubscriberPuppet
    Implement this puppet in your Whitebox style tests. The test suite will invoke the specific trigger/signal methods requesting you to execute the specific action. Since this is a whitebox style test, you're allowed and expected to use knowladge about your implementation to make implement these calls.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void signalCancel()
      Trigger cancel() on your Subscriber.
      void triggerRequest​(long elements)
      Ensure that at least elements are eventually requested by your Subscriber, if it hasn't already requested that many elements.
    • Method Detail

      • triggerRequest

        void triggerRequest​(long elements)
        Ensure that at least elements are eventually requested by your Subscriber, if it hasn't already requested that many elements.

        This does not necessarily have to correlate 1:1 with a Subscription.request(elements) call, but the sum of the elements requested by your Subscriber must eventually be at least the the sum of the elements triggered to be requested by all the invocations of this method.

        Additionally, subscribers are permitted to delay requesting elements until previous requests for elements have been fulfilled. For example, a subscriber that only requests one element at a time may fulfill the request made by this method by requesting one element elements times, waiting for each element to arrive before the next request is made.

        Before sending any element to the subscriber, the TCK must wait for the subscriber to request that element, and must be prepared for the subscriber to only request one element at a time, it is not enough for the TCK to simply invoke this method before sending elements.

        An invocation of signalCancel() may be coalesced into any elements that have not yet been requested, such that only a cancel signal is emitted.

      • signalCancel

        void signalCancel()
        Trigger cancel() on your Subscriber.

        An invocation of this method may be coalesced into any outstanding requests, as requested by triggerRequest(long), such that only a cancel signal is emitted.