assertTrue(out.getMessageQueue().poll() instanceof HttpEndOfContent);
}
@Test
public void testDIRMINA965NoContent() throws Exception {
AbstractProtocolDecoderOutput out = new AbstractProtocolDecoderOutput() {
public void flush(NextFilter nextFilter, IoSession session) {
}
};
IoBuffer buffer = IoBuffer.allocate(0).setAutoExpand(true);
buffer.putString("GET / HTTP/1.1\r\nHost: ", encoder);
buffer.rewind();
while (buffer.hasRemaining()) {
decoder.decode(session, buffer, out);
}
buffer = IoBuffer.allocate(0).setAutoExpand(true);
buffer.putString("dummy\r\n\r\n", encoder);
buffer.rewind();
while (buffer.hasRemaining()) {
decoder.decode(session, buffer, out);
}
assertEquals(2, out.getMessageQueue().size());
assertTrue(out.getMessageQueue().poll() instanceof HttpRequest);
assertTrue(out.getMessageQueue().poll() instanceof HttpEndOfContent);
}