Package com.alibaba.json.bvt.serializer

Source Code of com.alibaba.json.bvt.serializer.RefTest$A

package com.alibaba.json.bvt.serializer;

import junit.framework.TestCase;

import org.junit.Assert;

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

public class RefTest extends TestCase {
   
    public void test_ref() throws Exception {
        JSONSerializer ser = new JSONSerializer();
        Assert.assertNull(ser.getSerialContext(null));
       
        Assert.assertFalse(ser.containsReference(null));
    }
   
    public void test_array_ref() throws Exception {
        JSON.toJSONString(new A[] {new A()}, SerializerFeature.DisableCircularReferenceDetect);
    }

    public class A {

        private A a;

        public A getA() {
            return a;
        }

        public void setA(A a) {
            this.a = a;
        }

    }
}
TOP

Related Classes of com.alibaba.json.bvt.serializer.RefTest$A

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.