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 } |