Skip to content

Commit 1f88f28

Browse files
committed
Fix test case and Grizzly impl.
1 parent 5e11b57 commit 1f88f28

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ public GrizzlyAsyncHttpProvider(final AsyncHttpClientConfig clientConfig) {
200200
public <T> ListenableFuture<T> execute(final Request request,
201201
final AsyncHandler<T> handler) throws IOException {
202202

203+
if (clientTransport.isStopped()) {
204+
throw new IOException("AsyncHttpClient has been closed.");
205+
}
203206
final ProxyServer proxy = ProxyUtils.getProxyServer(clientConfig, request);
204207
final GrizzlyResponseFuture<T> future = new GrizzlyResponseFuture<T>(this, request, handler, proxy);
205208
future.setDelegate(SafeFutureImpl.<T>create());

src/test/java/com/ning/http/client/async/SimpleAsyncHttpClientTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,6 @@ public void testCloseMasterInvalidDerived() throws Exception {
255255
fail("Expected closed AHC");
256256
} catch (IOException e) {
257257
// expected -- Seems to me that this behavior conflicts with the requirements of Future.get()
258-
} catch (ExecutionException ee) {
259-
if (!(ee.getCause() instanceof IOException)) {
260-
fail("ExecutionException thrown, but the cause was not an instance of IOException.");
261-
}
262-
} catch (Throwable t) {
263-
fail("Unexpected Exception thrown: " + t.toString());
264-
t.printStackTrace();
265258
}
266259
}
267260

0 commit comments

Comments
 (0)