< prev index next >

test/jdk/java/net/httpclient/ImmutableFlowItems.java

Print this page
*** 25,10 ***
--- 25,11 ---
   * @test
   * @summary Tests response body subscribers's onNext's Lists are unmodifiable,
   *          and that the buffers are read-only
   * @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 ImmutableFlowItems
   */
  
  import java.io.IOException;
  import java.io.InputStream;

*** 41,20 ***
  import java.util.concurrent.CompletionStage;
  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 javax.net.ssl.SSLContext;
  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;
--- 42,21 ---
  import java.util.concurrent.CompletionStage;
  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.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 javax.net.ssl.SSLContext;
+ 
+ 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;

*** 187,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.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";
  
--- 189,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 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 >