test/jdk/java/net/httpclient/websocket/PendingPongTextClose.java
branchhttp-client-branch
changeset 56486 b664a887e277
parent 56451 9585061fdb04
child 56507 2294c51eae30
equal deleted inserted replaced
56483:ff806eb4a2a4 56486:b664a887e277
    38 import java.nio.ByteBuffer;
    38 import java.nio.ByteBuffer;
    39 import java.util.concurrent.CompletableFuture;
    39 import java.util.concurrent.CompletableFuture;
    40 import java.util.concurrent.TimeUnit;
    40 import java.util.concurrent.TimeUnit;
    41 import java.util.concurrent.TimeoutException;
    41 import java.util.concurrent.TimeoutException;
    42 
    42 
       
    43 import static java.net.http.HttpClient.Builder.NO_PROXY;
       
    44 import static java.net.http.HttpClient.newBuilder;
    43 import static java.net.http.HttpClient.newHttpClient;
    45 import static java.net.http.HttpClient.newHttpClient;
    44 
    46 
    45 public class PendingPongTextClose extends PendingOperations {
    47 public class PendingPongTextClose extends PendingOperations {
    46 
    48 
    47     CompletableFuture<WebSocket> cfText;
    49     CompletableFuture<WebSocket> cfText;
    51     @Test(dataProvider = "booleans")
    53     @Test(dataProvider = "booleans")
    52     public void pendingPongTextClose(boolean last) throws Exception {
    54     public void pendingPongTextClose(boolean last) throws Exception {
    53         repeatable( () -> {
    55         repeatable( () -> {
    54             server = Support.notReadingServer();
    56             server = Support.notReadingServer();
    55             server.open();
    57             server.open();
    56             webSocket = newHttpClient().newWebSocketBuilder()
    58             webSocket = newBuilder().proxy(NO_PROXY).build().newWebSocketBuilder()
    57                     .buildAsync(server.getURI(), new WebSocket.Listener() { })
    59                     .buildAsync(server.getURI(), new WebSocket.Listener() { })
    58                     .join();
    60                     .join();
    59             ByteBuffer data = ByteBuffer.allocate(125);
    61             ByteBuffer data = ByteBuffer.allocate(125);
    60             for (int i = 0; ; i++) {  // fill up the send buffer
    62             for (int i = 0; ; i++) {  // fill up the send buffer
    61                 long start = System.currentTimeMillis();
    63                 long start = System.currentTimeMillis();