public class TextLineEncoderTest {
@Test
public void testEncode() throws Exception {
TextLineEncoder encoder = new TextLineEncoder(Charset.forName("UTF-8"), LineDelimiter.WINDOWS);
ProtocolCodecSession session = new ProtocolCodecSession();
ProtocolEncoderOutput out = session.getEncoderOutput();
encoder.encode(session, "ABC", out);
assertEquals(1, session.getEncoderOutputQueue().size());
IoBuffer buf = (IoBuffer) session.getEncoderOutputQueue().poll();
assertEquals(5, buf.remaining());