package com.alibaba.json.bvt.serializer.jsonp;

import java.util.ArrayList;
import java.util.HashMap;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.JSONPObject;


public class JSONPObjectTest extends TestCase {
    public void test_jsonp() throws Exception {
        JSONPObject jsonp = new JSONPObject("checkValid");
        jsonp.addParameter(new HashMap<String, Object>());
        jsonp.addParameter(new ArrayList<Object>());
        
        String text = jsonp.toString();
        
        Assert.assertEquals("checkValid({},[])", text);
    }
}

@@ -586,10 +586,592 @@
 ;%0A    %7D%0A
+    %0A    public void test_jsonp_1() throws Exception %7B%0A        JSONPObject jsonp = new JSONPObject();%0A        jsonp.setFunction(%22checkValid%22);%0A        jsonp.addParameter(new HashMap%3CString, Object%3E());%0A        jsonp.addParameter(new ArrayList%3CObject%3E());%0A        %0A        Assert.assertEquals(%22checkValid%22, jsonp.getFunction());%0A        Assert.assertEquals(2, jsonp.getParameters().size());%0A        %0A        String text = jsonp.toString();%0A        %0A        Assert.assertEquals(%22checkValid(%7B%7D,%5B%5D)%22, text);%0A        Assert.assertEquals(%22checkValid(%7B%7D,%5B%5D)%22, jsonp.toJSONString());%0A    %7D%0A
 %7D%0A

add jsonp test