Package com.alibaba.json.bvt.util

Source Code of com.alibaba.json.bvt.util.CloneTest_0

package com.alibaba.json.bvt.util;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class CloneTest_0 extends TestCase {
  public void test_0() throws Exception  {
    JSONObject o = new JSONObject();
    o.put("a", new JSONArray());
   
    JSONObject o1 = o.clone();
   
    Assert.assertEquals(o, o1);
    Assert.assertNotSame(o, o1);
   
    Assert.assertEquals(o.get("a"), o1.get("a"));
    Assert.assertNotSame(o.get("a"), o1.get("a"));
  }
}
TOP

Related Classes of com.alibaba.json.bvt.util.CloneTest_0

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.