test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/SubscriberWhiteboxVerification.java
changeset 58907 2507757e9ef7
parent 55546 3ae57bbf9585
equal deleted inserted replaced
58906:d58a21542c04 58907:2507757e9ef7
   276   public void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws Throwable {
   276   public void required_spec208_mustBePreparedToReceiveOnNextSignalsAfterHavingCalledSubscriptionCancel() throws Throwable {
   277     subscriberTest(new TestStageTestRun() {
   277     subscriberTest(new TestStageTestRun() {
   278       @Override
   278       @Override
   279       public void run(WhiteboxTestStage stage) throws InterruptedException {
   279       public void run(WhiteboxTestStage stage) throws InterruptedException {
   280         stage.puppet().triggerRequest(1);
   280         stage.puppet().triggerRequest(1);
       
   281         stage.expectRequest();
   281         stage.puppet().signalCancel();
   282         stage.puppet().signalCancel();
   282         stage.expectRequest();
   283         stage.expectCancelling();
   283         stage.signalNext();
   284         stage.signalNext();
   284 
   285 
   285         stage.puppet().triggerRequest(1);
   286         stage.puppet().triggerRequest(1);
   286         stage.puppet().triggerRequest(1);
   287         stage.puppet().triggerRequest(1);
   287 
   288 
   822      * next request is made.
   823      * next request is made.
   823      * <p>
   824      * <p>
   824      * Before sending any element to the subscriber, the TCK must wait for the subscriber to request that element, and
   825      * Before sending any element to the subscriber, the TCK must wait for the subscriber to request that element, and
   825      * must be prepared for the subscriber to only request one element at a time, it is not enough for the TCK to
   826      * must be prepared for the subscriber to only request one element at a time, it is not enough for the TCK to
   826      * simply invoke this method before sending elements.
   827      * simply invoke this method before sending elements.
       
   828      * <p>
       
   829      * An invocation of {@link #signalCancel()} may be coalesced into any elements that have not yet been requested,
       
   830      * such that only a cancel signal is emitted.
   827      */
   831      */
   828     void triggerRequest(long elements);
   832     void triggerRequest(long elements);
   829 
   833 
   830     /**
   834     /**
   831      * Trigger {@code cancel()} on your {@link Subscriber}
   835      * Trigger {@code cancel()} on your {@link Subscriber}.
       
   836      * <p>
       
   837      * An invocation of this method may be coalesced into any outstanding requests, as requested by
       
   838      *{@link #triggerRequest(long)}, such that only a cancel signal is emitted.
   832      */
   839      */
   833     void signalCancel();
   840     void signalCancel();
   834   }
   841   }
   835 
   842 
   836   public void notVerified() {
   843   public void notVerified() {