Package com.alibaba.json.bvt.serializer

Source Code of com.alibaba.json.bvt.serializer.PrettyFormatTest

package com.alibaba.json.bvt.serializer;

import junit.framework.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class PrettyFormatTest extends TestCase {

    public void test_0() throws Exception {
        Assert.assertEquals(0, new JSONSerializer().getIndentCount());
       
        Assert.assertEquals("[\n\t{},\n\t{}\n]", JSON.toJSONString(new Object[] { new Object(), new Object() }, SerializerFeature.PrettyFormat));
    }
}
TOP

Related Classes of com.alibaba.json.bvt.serializer.PrettyFormatTest

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.