Skip to content

Commit 07835c4

Browse files
committed
Fix some recent test failures.
1 parent 223641f commit 07835c4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.ByteArrayOutputStream;
2929
import java.io.File;
3030
import java.io.IOException;
31+
import java.util.concurrent.ExecutionException;
3132
import java.util.concurrent.Future;
3233

3334
import static junit.framework.Assert.assertTrue;
@@ -253,7 +254,14 @@ public void testCloseMasterInvalidDerived() throws Exception {
253254
derived.get().get();
254255
fail("Expected closed AHC");
255256
} catch (IOException e) {
256-
// expected
257+
// 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();
257265
}
258266
}
259267

0 commit comments

Comments
 (0)