< prev index next >

test/jdk/java/net/httpclient/ConcurrentResponses.java

Print this page
@@ -26,10 +26,11 @@
   * @bug 8195823
   * @summary Buffers given to response body subscribers should not contain
   *          unprocessed HTTP data
   * @library /test/lib /test/jdk/java/net/httpclient/lib
   * @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext
+  *        jdk.httpclient.test.lib.common.TestServerConfigurator
   * @run testng/othervm
   *      -Djdk.tracePinnedThreads=full
   *      -Djdk.httpclient.HttpClient.log=headers,errors,channel
   *      ConcurrentResponses
   */

@@ -53,19 +54,20 @@
  import java.util.stream.IntStream;
  import javax.net.ssl.SSLContext;
  import com.sun.net.httpserver.HttpExchange;
  import com.sun.net.httpserver.HttpHandler;
  import com.sun.net.httpserver.HttpServer;
- import com.sun.net.httpserver.HttpsConfigurator;
  import com.sun.net.httpserver.HttpsServer;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.http.HttpResponse.BodyHandler;
  import java.net.http.HttpResponse.BodyHandlers;
  import java.net.http.HttpResponse.BodySubscriber;
  import java.net.http.HttpResponse.BodySubscribers;
+ 
+ import jdk.httpclient.test.lib.common.TestServerConfigurator;
  import jdk.httpclient.test.lib.http2.Http2TestServer;
  import jdk.httpclient.test.lib.http2.Http2TestExchange;
  import jdk.httpclient.test.lib.http2.Http2Handler;
  import jdk.test.lib.net.SimpleSSLContext;
  import org.testng.annotations.AfterTest;

@@ -289,11 +291,11 @@
          httpFixedURI = "http://" + serverAuthority(httpTestServer) + "/http1/fixed";
          httpTestServer.createContext("/http1/chunked", new Http1ChunkedHandler());
          httpChunkedURI = "http://" + serverAuthority(httpTestServer) + "/http1/chunked";
  
          httpsTestServer = HttpsServer.create(sa, 0);
-         httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext));
+         httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext));
          httpsTestServer.createContext("/https1/fixed", new Http1FixedHandler());
          httpsFixedURI = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed";
          httpsTestServer.createContext("/https1/chunked", new Http1ChunkedHandler());
          httpsChunkedURI = "https://" + serverAuthority(httpsTestServer) + "/https1/chunked";
  
< prev index next >