Fix HttpClientCodecTest.testFailsOnMissingResponse()

- AbstractCodecEmbedder does not throw an exception immediately anymore.
  It stores the caught exceptions in the product queue and throws them
  on pool() or peek().
This commit is contained in:
Trustin Lee 2012-06-03 03:32:30 -07:00
parent a94916da66
commit 3e0cbf0caa

View File

@ -68,13 +68,15 @@ public class HttpClientCodecTest {
HttpClientCodec codec = new HttpClientCodec(4096, 8192, 8192, true);
EncoderEmbedder<ChannelBuffer> encoder = new EncoderEmbedder<ChannelBuffer>(codec);
encoder.offer(new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "http://localhost/"));
assertTrue(encoder.offer(new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "http://localhost/")));
assertNotNull(encoder.poll());
assertTrue(encoder.finish());
try {
encoder.finish();
encoder.poll();
fail();
} catch (CodecException e) {
assertTrue(e.getCause() instanceof PrematureChannelClosureException);
assertTrue(e instanceof PrematureChannelClosureException);
}
}