test/jdk/java/net/httpclient/SmokeTest.java
branchhttp-client-branch
changeset 55807 2337a59be92a
parent 55764 34d7cc00f87a
child 55852 32f6aefec11e
equal deleted inserted replaced
55806:e8bc8370f528 55807:2337a59be92a
   421                                   .sslParameters(sslparams)
   421                                   .sslParameters(sslparams)
   422                                   .build();
   422                                   .build();
   423 
   423 
   424         HttpRequest request = HttpRequest.newBuilder(uri).GET().build();
   424         HttpRequest request = HttpRequest.newBuilder(uri).GET().build();
   425 
   425 
   426         CompletableFuture<String> fut = client.sendAsync(request, asString())
   426         CompletableFuture<String> fut = cl.sendAsync(request, asString())
   427                 .thenApply((response) -> response.body());
   427                 .thenApply((response) -> response.body());
   428 
   428 
   429         String body = fut.get(5, TimeUnit.HOURS);
   429         String body = fut.get(5, TimeUnit.HOURS);
   430 
   430 
   431         String fc = getFileContent(filename);
   431         String fc = getFileContent(filename);
   432 
   432 
   433         if (!body.equals(fc)) {
   433         if (!body.equals(fc)) {
   434             throw new RuntimeException(
   434             throw new RuntimeException(
   435                     "Body mismatch: expected [" + body + "], got [" + fc + "]");
   435                     "Body mismatch: expected [" + body + "], got [" + fc + "]");
   436         }
   436         }
   437         if (ps.count() > 1) {
   437         if (ps.count() != 1) {
   438             throw new RuntimeException("CountingProxySelector. Expected 1, got " + ps.count());
   438             throw new RuntimeException("CountingProxySelector. Expected 1, got " + ps.count());
   439         }
   439         }
   440         e.shutdownNow();
   440         e.shutdownNow();
   441         System.out.println(" OK");
   441         System.out.println(" OK");
   442     }
   442     }