test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java
branchhttp-client-branch
changeset 55859 4ca3e578b9c4
parent 55857 89c904d57ebe
child 55861 0683f22cf2b9
--- a/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java	Wed Nov 22 16:27:08 2017 +0000
+++ b/test/jdk/java/net/httpclient/BufferingSubscriberCancelTest.java	Wed Nov 22 21:29:20 2017 +0000
@@ -35,6 +35,7 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import static java.lang.Long.MAX_VALUE;
+import static java.lang.Long.MIN_VALUE;
 import static java.lang.System.out;
 import static java.nio.ByteBuffer.wrap;
 import static java.util.concurrent.TimeUnit.SECONDS;
@@ -68,7 +69,6 @@
         BodySubscriber subscriber = buffering(exposingSubscriber, bufferSize);
         publisher.subscribe(subscriber);
         gate.await(30, SECONDS);
-       // while (publisher.getNumberOfSubscribers() != 0)
         assertEqualsWithRetry(publisher::getNumberOfSubscribers, 1);
         exposingSubscriber.subscription.cancel();
         assertEqualsWithRetry(publisher::getNumberOfSubscribers, 0);
@@ -80,6 +80,7 @@
         s.cancel(); s.request(MAX_VALUE); s.cancel(); s.cancel();
         s.cancel(); s.cancel(); s.cancel(); s.cancel();
         s.request(MAX_VALUE); s.request(MAX_VALUE); s.request(MAX_VALUE);
+        s.request(-1); s.request(-100); s.request(MIN_VALUE);
         assertEqualsWithRetry(publisher::getNumberOfSubscribers, 0);
     }