Package org.apache.mina.filter.codec

Examples of org.apache.mina.filter.codec.ProtocolEncoderOutput


    @Test
    public void testEncoder() throws Exception {
        final String expected = "1234";

        ProtocolCodecSession session = new ProtocolCodecSession();
        ProtocolEncoderOutput out = session.getEncoderOutput();

        ProtocolEncoder encoder = new ObjectSerializationEncoder();
        encoder.encode(session, expected, out);

        assertEquals(1, session.getEncoderOutputQueue().size());
View Full Code Here


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());
View Full Code Here

public class ObjectSerializationTest extends TestCase {
    public void testEncoder() throws Exception {
        final String expected = "1234";

        ProtocolCodecSession session = new ProtocolCodecSession();
        ProtocolEncoderOutput out = session.getEncoderOutput();

        ProtocolEncoder encoder = new ObjectSerializationEncoder();
        encoder.encode(session, expected, out);

        Assert.assertEquals(1, session.getEncoderOutputQueue().size());
View Full Code Here

public class ObjectSerializationTest extends TestCase {
    public void testEncoder() throws Exception {
        final String expected = "1234";

        ProtocolCodecSession session = new ProtocolCodecSession();
        ProtocolEncoderOutput out = session.getEncoderOutput();

        ProtocolEncoder encoder = new ObjectSerializationEncoder();
        encoder.encode(session, expected, out);

        Assert.assertEquals(1, session.getEncoderOutputQueue().size());
View Full Code Here

    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);
        Assert.assertEquals(1, session.getEncoderOutputQueue().size());
        IoBuffer buf = (IoBuffer) session.getEncoderOutputQueue().poll();
        Assert.assertEquals(5, buf.remaining());
View Full Code Here

TOP

Related Classes of org.apache.mina.filter.codec.ProtocolEncoderOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.