Skip to content

Commit 25f2f0b

Browse files
committed
Make tests compile
1 parent ab88def commit 25f2f0b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ void test(String uri) throws Exception {
123123
System.out.printf("connection window: %s, stream window: %s, will make %s requests%n",
124124
connectionWindowSize, windowSize, max);
125125

126-
try (HttpClient client = HttpClient.newBuilder().sslContext(sslContext).build()) {
126+
HttpClient client = HttpClient.newBuilder().sslContext(sslContext).build();
127+
{
127128
String label = null;
128129

129130
Throwable t = null;
@@ -153,7 +154,8 @@ void test(String uri) throws Exception {
153154
} catch (AssertionError ass) {
154155
// since we won't pull all responses, the client
155156
// will not exit unless we ask it to shutdown now.
156-
client.shutdownNow();
157+
// HttpClient does not implement shutdownNow in 17.
158+
//client.shutdownNow();
157159
throw ass;
158160
}
159161
}
@@ -181,7 +183,8 @@ void test(String uri) throws Exception {
181183
} catch (AssertionError t1) {
182184
// since we won't pull all responses, the client
183185
// will not exit unless we ask it to shutdown now.
184-
client.shutdownNow();
186+
// HttpClient does not implement shutdownNow in 17.
187+
//client.shutdownNow();
185188
throw t1;
186189
} catch (Throwable t0) {
187190
System.out.println("Got EXPECTED: " + t0);
@@ -194,7 +197,8 @@ void test(String uri) throws Exception {
194197
} catch (AssertionError e) {
195198
// since we won't pull all responses, the client
196199
// will not exit unless we ask it to shutdown now.
197-
client.shutdownNow();
200+
// HttpClient does not implement shutdownNow in 17.
201+
//client.shutdownNow();
198202
throw e;
199203
}
200204
}

test/jdk/java/net/httpclient/http2/StreamFlowControlTest.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @bug 8342075
2727
* @library /test/lib /test/jdk/java/net/httpclient/lib
2828
* @build jdk.httpclient.test.lib.http2.Http2TestServer jdk.test.lib.net.SimpleSSLContext
29+
* jdk.httpclient.test.lib.common.TestServerConfigurator
2930
* @run testng/othervm -Djdk.internal.httpclient.debug=true
3031
* -Djdk.httpclient.connectionWindowSize=65535
3132
* -Djdk.httpclient.windowsize=16384
@@ -142,13 +143,15 @@ void test(String uri,
142143
assertDetailMessage(ioe, i);
143144
} finally {
144145
if (!sameClient && client != null) {
145-
client.close();
146+
// HttpClient does not implement close in 17.
147+
//client.close();
146148
client = null;
147149
}
148150
}
149151
}
150152
} finally {
151-
if (sameClient && client != null) client.close();
153+
// HttpClient does not implement close in 17.
154+
//if (sameClient && client != null) client.close();
152155
}
153156

154157
}
@@ -203,14 +206,16 @@ void testAsync(String uri,
203206
t = t0;
204207
} finally {
205208
if (!sameClient && client != null) {
206-
client.close();
209+
// HttpClient does not implement close in 17.
210+
//client.close();
207211
client = null;
208212
}
209213
}
210214
assertDetailMessage(t, i);
211215
}
212216
} finally {
213-
if (sameClient && client != null) client.close();
217+
// HttpClient does not implement close in 17.
218+
//if (sameClient && client != null) client.close();
214219
}
215220
}
216221

0 commit comments

Comments
 (0)