Package com.alibaba.fastjson

Examples of com.alibaba.fastjson.JSON


public class Bug_7 extends TestCase {

    public void test_floatArray() throws Exception {
        float[] a = new float[] { 1, 2 };
        String text = JSON.toJSONString(a);
        JSON json = (JSON) JSON.parse(text);
        Assert.assertEquals("[1.0,2.0]", json.toJSONString());
    }
View Full Code Here


    }

    public void test_doubleArray() throws Exception {
        double[] a = new double[] { 1, 2 };
        String text = JSON.toJSONString(a);
        JSON json = (JSON) JSON.parse(text);
        Assert.assertEquals("[1.0,2.0]", json.toJSONString());
    }
View Full Code Here

    public void test_bigintegerArray() throws Exception {
        BigInteger[] a = new BigInteger[] { new BigInteger("214748364812"), new BigInteger("2147483648123") };
        String text = JSON.toJSONString(a);
        Assert.assertEquals("[214748364812,2147483648123]", text);
        JSON json = (JSON) JSON.parse(text);
        Assert.assertEquals("[214748364812,2147483648123]", json.toJSONString());
    }
View Full Code Here

public class Issue146 extends TestCase {

    public void test_for_issue() throws Exception {
        VO vo = new VO();
        JSON json = JSON.parseObject("{}");
        vo.setName(json);
        String s = JSON.toJSONString(vo, SerializerFeature.WriteClassName);
        System.out.println(s);
        JSON.parseObject(s);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.JSON

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.