Search in sources :

Example 1 with FastjsonSockJsMessageCodec

use of com.alibaba.fastjson.support.spring.FastjsonSockJsMessageCodec in project fastjson by alibaba.

the class FastjsonSockJsMessageCodecTest_encode method test_encode.

public void test_encode() throws Exception {
    FastjsonSockJsMessageCodec fastjsonCodec = new FastjsonSockJsMessageCodec();
    Jackson2SockJsMessageCodec jacksonCodec = new Jackson2SockJsMessageCodec();
    String v0 = "a0\"\0", v1 = "a1";
    String fastjsonResult = fastjsonCodec.encode(v0, v1);
    String jacksonResult = jacksonCodec.encode(v0, v1);
    Assert.assertEquals(jacksonResult, fastjsonResult);
}
Also used : Jackson2SockJsMessageCodec(org.springframework.web.socket.sockjs.frame.Jackson2SockJsMessageCodec) FastjsonSockJsMessageCodec(com.alibaba.fastjson.support.spring.FastjsonSockJsMessageCodec)

Aggregations

FastjsonSockJsMessageCodec (com.alibaba.fastjson.support.spring.FastjsonSockJsMessageCodec)1 Jackson2SockJsMessageCodec (org.springframework.web.socket.sockjs.frame.Jackson2SockJsMessageCodec)1