@Test public void testTooLongLine1() throws Exception { EmbeddedChannel ch = new EmbeddedChannel(new LineBasedFrameDecoder(16, false, false)); try { ch.writeInbound(copiedBuffer("12345678901234567890\r\nfirst\nsecond", CharsetUtil.US_ASCII)); fail(); } catch (Exception e) { assertThat(e, is(instanceOf(TooLongFrameException.class))); } ByteBuf buf = ch.readInbound(); ByteBuf buf2 = copiedBuffer("first\n", CharsetUtil.US_ASCII); assertThat(buf, is(buf2)); assertThat(ch.finish(), is(false)); buf.release(); buf2.release(); }
private void fail(final ChannelHandlerContext ctx, int length) { fail(ctx, String.valueOf(length)); }
LineBasedFrameDecoder extends ByteToMessageDecoder { private void fail(final ChannelHandlerContext ctx, int length) { fail(ctx, String.valueOf(length)); } }
LineBasedFrameDecoder extends ByteToMessageDecoder { private void fail(final ChannelHandlerContext ctx, int length) { fail(ctx, String.valueOf(length)); } LineBasedFrameDecoder(final int maxLength);  LineBasedFrameDecoder(final int maxLength, final boolean stripDelimiter, final boolean failFast); }
LineBasedFrameDecoder extends ByteToMessageDecoder { private void fail(final ChannelHandlerContext ctx, int length) { fail(ctx, String.valueOf(length)); } LineBasedFrameDecoder(final int maxLength);  LineBasedFrameDecoder(final int maxLength, final boolean stripDelimiter, final boolean failFast);  }
LineBasedFrameDecoder extends ByteToMessageDecoder { private void fail(final ChannelHandlerContext ctx, int length) { fail(ctx, String.valueOf(length)); } LineBasedFrameDecoder(final int maxLength);  LineBasedFrameDecoder(final int maxLength, final boolean stripDelimiter, final boolean failFast);   }