< prev index next >

test/jdk/java/net/httpclient/CustomResponseSubscriber.java

Print this page
@@ -24,10 +24,11 @@
  /*
   * @test
   * @summary Tests response body subscribers's onComplete is not invoked before onSubscribe
   * @library /test/lib /test/jdk/java/net/httpclient/lib
   * @build jdk.test.lib.net.SimpleSSLContext jdk.httpclient.test.lib.http2.Http2TestServer
+  *        jdk.httpclient.test.lib.common.TestServerConfigurator
   * @run testng/othervm CustomResponseSubscriber
   */
  
  import java.io.IOException;
  import java.io.InputStream;

@@ -41,19 +42,20 @@
  import java.util.concurrent.Executors;
  import java.util.concurrent.Flow;
  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.HttpHeaders;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.http.HttpResponse.BodyHandler;
  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 javax.net.ssl.SSLContext;
  import jdk.test.lib.net.SimpleSSLContext;

@@ -198,11 +200,11 @@
          httpTestServer.createContext("/http1/chunk", h1_chunkHandler);
          httpURI_fixed = "http://" + serverAuthority(httpTestServer) + "/http1/fixed";
          httpURI_chunk = "http://" + serverAuthority(httpTestServer) + "/http1/chunk";
  
          httpsTestServer = HttpsServer.create(sa, 0);
-         httpsTestServer.setHttpsConfigurator(new HttpsConfigurator(sslContext));
+         httpsTestServer.setHttpsConfigurator(new TestServerConfigurator(sa.getAddress(), sslContext));
          httpsTestServer.createContext("/https1/fixed", h1_fixedLengthHandler);
          httpsTestServer.createContext("/https1/chunk", h1_chunkHandler);
          httpsURI_fixed = "https://" + serverAuthority(httpsTestServer) + "/https1/fixed";
          httpsURI_chunk = "https://" + serverAuthority(httpsTestServer) + "/https1/chunk";
  
< prev index next >