Package com.taobao.metamorphosis.utils.codec

Examples of com.taobao.metamorphosis.utils.codec.Serializer.encodeObject()


    public void testJavaEncoder() throws Exception {
        final Serializer encoder = CodecBuilder.buildSerializer(Codec_Type.JAVA);
        byte buf[] = null;

        for (int i = 0; i < 100000; i++) {
            buf = encoder.encodeObject(this.msg);
        }

        Assert.assertTrue(buf != null && buf.length > 0);
    }
View Full Code Here


    @Test
    public void testJavaDecoder() throws Exception {
        final Serializer encoder = CodecBuilder.buildSerializer(Codec_Type.JAVA);
        final Deserializer decoder = CodecBuilder.buildDeserializer(Codec_Type.JAVA);
        final byte buf[] = encoder.encodeObject(this.msg);
        final Message entity1 = (Message) decoder.decodeObject(buf);

        Assert.assertEquals(this.msg, entity1);
    }
View Full Code Here

    public void testHessianEncoder() throws IOException {
        final Serializer encoder = CodecBuilder.buildSerializer(Codec_Type.HESSIAN1);
        byte buf[] = null;

        for (int i = 0; i < 100000; i++) {
            buf = encoder.encodeObject(this.msg);
        }

        Assert.assertTrue(buf != null && buf.length > 0);
    }
View Full Code Here

    @Test
    public void testHessianDecoder() throws Exception {
        final Deserializer decoder = CodecBuilder.buildDeserializer(Codec_Type.HESSIAN1);
        final Serializer encoder = CodecBuilder.buildSerializer(Codec_Type.HESSIAN1);

        final byte buf[] = encoder.encodeObject(this.msg);
        final Message entity1 = (Message) decoder.decodeObject(buf);

        Assert.assertEquals(this.msg, entity1);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.