Package com.alibaba.json.bvt.writeAsArray.WriteAsArray_enum_public

Examples of com.alibaba.json.bvt.writeAsArray.WriteAsArray_enum_public.VO


    public void test_0() throws Exception {
        A a = new A();
        a.setId(123);
        a.setName("wenshao");
       
        VO vo = new VO();
        vo.setA(a);

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[[123,\"wenshao\"]]", text);
       
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }
View Full Code Here


    public void test_0() throws Exception {
        A a = new A();
        a.setId(123);
        a.setName("wenshao");
       
        VO vo = new VO();
        vo.setA(a);

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[[123,\"wenshao\"]]", text);
       
        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getA().getId(), vo2.getA().getId());
        Assert.assertEquals(vo.getA().getName(), vo2.getA().getName());
    }
View Full Code Here

    public void test_0() throws Exception {
        A a = new A();
        a.setId(123);
        a.setName("wenshao");

        VO vo = new VO();
        vo.setId(1001);
        vo.setValue(a);

        String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
        Assert.assertEquals("[1001,[123,\"wenshao\"]]", text);

        VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
        Assert.assertEquals(vo.getValue().getId(), vo2.getValue().getId());
        Assert.assertEquals(vo.getValue().getName(), vo2.getValue().getName());
    }
View Full Code Here

TOP

Related Classes of com.alibaba.json.bvt.writeAsArray.WriteAsArray_enum_public.VO

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.