Skip to content

Commit 03cafa0

Browse files
committed
resolve rejected chunks
1 parent 347a39a commit 03cafa0

23 files changed

Lines changed: 27 additions & 48 deletions

test/jdk/java/net/httpclient/AbstractThrowingSubscribers.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,10 +759,6 @@ public static void setup() throws Exception {
759759
System.out.println(now() + "setup");
760760
System.err.println(now() + "setup");
761761

762-
sslContext = new SimpleSSLContext().get();
763-
if (sslContext == null)
764-
throw new AssertionError("Unexpected null sslContext");
765-
766762
// HTTP/1.1
767763
HttpTestHandler h1_fixedLengthHandler = new HTTP_FixedLengthHandler();
768764
HttpTestHandler h1_chunkHandler = new HTTP_ChunkedHandler();

test/jdk/java/net/httpclient/AsyncExecutorShutdown.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class AsyncExecutorShutdown implements HttpServerAdapters {
9494
}
9595
static final Random RANDOM = RandomFactory.getRandom();
9696

97-
SSLContext sslContext;
97+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
9898
HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ]
9999
HttpTestServer httpsTestServer; // HTTPS/1.1
100100
HttpTestServer http2TestServer; // HTTP/2 ( h2c )
@@ -314,9 +314,6 @@ void testSequential(String uriString) throws Exception {
314314
@BeforeTest
315315
public void setup() throws Exception {
316316
out.println("\n**** Setup ****\n");
317-
sslContext = new SimpleSSLContext().get();
318-
if (sslContext == null)
319-
throw new AssertionError("Unexpected null sslContext");
320317

321318
httpTestServer = HttpTestServer.create(HTTP_1_1);
322319
httpTestServer.addHandler(new ServerRequestHandler(), "/http1/exec/");

test/jdk/java/net/httpclient/BasicAuthTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static void test(Version version, boolean secure) throws Exception {
6868

6969
ExecutorService e = Executors.newCachedThreadPool();
7070
Handler h = new Handler();
71-
SSLContext sslContext = secure ? new SimpleSSLContext().get() : null;
71+
SSLContext sslContext = secure ? SimpleSSLContext.findSSLContext() : null;
7272
HttpTestServer server = HttpTestServer.create(version, sslContext, e);
7373
HttpTestContext serverContext = server.addHandler(h,"/test/");
7474
ServerAuth sa = new ServerAuth("foo realm");

test/jdk/java/net/httpclient/CancelledResponse2.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class CancelledResponse2 {
6868

6969
HttpTestServer h2TestServer;
7070
URI h2TestServerURI;
71-
private SSLContext sslContext;
71+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
7272
private static final Random random = RandomFactory.getRandom();
7373
private static final int MAX_CLIENT_DELAY = 160;
7474

@@ -113,7 +113,6 @@ public void test(Version version, URI uri) throws Exception {
113113

114114
@BeforeTest
115115
public void setup() throws IOException {
116-
sslContext = new SimpleSSLContext().get();
117116
h2TestServer = HttpTestServer.create(HTTP_2, sslContext);
118117
h2TestServer.addHandler(new CancelledResponseHandler(), "/h2");
119118
h2TestServerURI = URI.create("https://" + h2TestServer.serverAuthority() + "/h2");

test/jdk/java/net/httpclient/ContentLengthHeaderTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public class ContentLengthHeaderTest implements HttpServerAdapters {
7878

7979
@BeforeTest
8080
public void setup() throws IOException, URISyntaxException {
81-
sslContext = new SimpleSSLContext().get();
8281
testContentLengthServerH1 = HttpTestServer.create(HTTP_1_1);
8382
testContentLengthServerH2 = HttpTestServer.create(HTTP_2, sslContext);
8483

test/jdk/java/net/httpclient/EscapedOctetsInURI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
public class EscapedOctetsInURI implements HttpServerAdapters {
6868

69-
SSLContext sslContext;
69+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
7070
HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ]
7171
HttpTestServer httpsTestServer; // HTTPS/1.1
7272
HttpTestServer http2TestServer; // HTTP/2 ( h2c )

test/jdk/java/net/httpclient/ExecutorShutdown.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class ExecutorShutdown implements HttpServerAdapters {
9090
}
9191
static final Random RANDOM = RandomFactory.getRandom();
9292

93-
SSLContext sslContext;
93+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
9494
HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ]
9595
HttpTestServer httpsTestServer; // HTTPS/1.1
9696
HttpTestServer http2TestServer; // HTTP/2 ( h2c )

test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
public class FlowAdapterPublisherTest implements HttpServerAdapters {
6868

69-
SSLContext sslContext;
69+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
7070
HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ]
7171
HttpTestServer httpsTestServer; // HTTPS/1.1
7272
HttpTestServer http2TestServer; // HTTP/2 ( h2c )

test/jdk/java/net/httpclient/FlowAdapterSubscriberTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
public class FlowAdapterSubscriberTest implements HttpServerAdapters {
7575

76-
SSLContext sslContext;
76+
private static final SSLContext sslContext = SimpleSSLContext.findSSLContext();
7777
HttpTestServer httpTestServer; // HTTP/1.1 [ 4 servers ]
7878
HttpTestServer httpsTestServer; // HTTPS/1.1
7979
HttpTestServer http2TestServer; // HTTP/2 ( h2c )

test/jdk/java/net/httpclient/HeadTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ private void doTest(HttpRequest request, int expResp) throws Exception {
148148

149149
@BeforeTest
150150
public void setup() throws Exception {
151-
sslContext = new SimpleSSLContext().get();
152-
if (sslContext == null)
153-
throw new AssertionError("Unexpected null sslContext");
154-
155151
InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0);
156152

157153
httpTestServer = HttpTestServer.create(HTTP_1_1);

0 commit comments

Comments
 (0)