test/jdk/java/net/httpclient/TimeoutBasic.java
branchhttp-client-branch
changeset 56054 352e845ae744
parent 55973 4d9b002587db
child 56082 1da51fab3032
equal deleted inserted replaced
56053:8588095e95b0 56054:352e845ae744
   151                 HttpRequest request = newRequest(uri, duration, reqVersion, method);
   151                 HttpRequest request = newRequest(uri, duration, reqVersion, method);
   152                 if (request == null) continue;
   152                 if (request == null) continue;
   153                 count++;
   153                 count++;
   154                 try {
   154                 try {
   155                     HttpResponse<?> resp = client.sendAsync(request, discard(null)).join();
   155                     HttpResponse<?> resp = client.sendAsync(request, discard(null)).join();
       
   156                     out.println("Unexpected response for: " + request);
       
   157                     out.println("\t from " + ss.getLocalSocketAddress());
       
   158                     out.println("Response is: " + resp);
       
   159                     out.println("Headers: " + resp.headers().map());
       
   160                     out.println("Body (should be null): " + resp.body());
   156                     throw new RuntimeException("Unexpected response: " + resp.statusCode());
   161                     throw new RuntimeException("Unexpected response: " + resp.statusCode());
   157                 } catch (CompletionException e) {
   162                 } catch (CompletionException e) {
   158                     if (!(e.getCause() instanceof HttpTimeoutException)) {
   163                     if (!(e.getCause() instanceof HttpTimeoutException)) {
   159                         throw new RuntimeException("Unexpected exception: " + e.getCause());
   164                         throw new RuntimeException("Unexpected exception: " + e.getCause());
   160                     } else {
   165                     } else {