@@ -0,0 +1,1958 @@
+package com.alibaba.json.bvt.parser;%0A%0Aimport java.util.List;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.junit.Assert;%0A%0Aimport com.alibaba.fastjson.JSON;%0Aimport com.alibaba.fastjson.TypeReference;%0A%0Apublic class GenericTest2 extends TestCase %7B%0A%09public void test_for_bingyang() throws Exception %7B%0A%09%09String text = %22%7B%5C%22count%5C%22:123,%5C%22index%5C%22:7,%5C%22items%5C%22:%5B%7B%5C%22id%5C%22:234,%5C%22latitude%5C%22:2.5,%5C%22longtitude%5C%22:3.7%7D%5D%7D%22;%0A%09%09PageBean%3CActiveBase%3E pageBean = JSON.parseObject(text, new TypeReference%3CPageBean%3CActiveBase%3E%3E() %7B%7D);%0A%09%09Assert.assertNotNull(pageBean);%0A%09%09Assert.assertEquals(123, pageBean.getCount());%0A%09%09Assert.assertEquals(7, pageBean.getIndex());%0A%09%09Assert.assertNotNull(pageBean.getItems());%0A%09%09Assert.assertEquals(1, pageBean.getItems().size());%0A%09%09ActiveBase active = pageBean.getItems().get(0);%0A%09%09Assert.assertEquals(new Integer(234), active.getId());%0A%09%09Assert.assertTrue(3.7D == active.getLongtitude());%0A%09%09Assert.assertTrue(2.5D == active.getLatitude());%0A%09%7D%0A%0A%09public static class ActiveBase extends BaseModel %7B%0A%09%09private double latitude;%0A%09%09private double longtitude;%0A%09%09public double getLatitude() %7B%0A%09%09%09return latitude;%0A%09%09%7D%0A%09%09public void setLatitude(double latitude) %7B%0A%09%09%09this.latitude = latitude;%0A%09%09%7D%0A%09%09public double getLongtitude() %7B%0A%09%09%09return longtitude;%0A%09%09%7D%0A%09%09public void setLongtitude(double longtitude) %7B%0A%09%09%09this.longtitude = longtitude;%0A%09%09%7D%0A%09%7D%0A%0A%09public static class BaseModel %7B%0A%09%09private Integer id;%0A%0A%09%09public Integer getId() %7B%0A%09%09%09return id;%0A%09%09%7D%0A%0A%09%09public void setId(Integer id) %7B%0A%09%09%09this.id = id;%0A%09%09%7D%0A%09%7D%0A%0A%09public static class PageBean%3CT%3E %7B%0A%09%09private int count;%0A%09%09private int index;%0A%09%09private List%3CT%3E items;%0A%0A%09%09public int getCount() %7B%0A%09%09%09return count;%0A%09%09%7D%0A%0A%09%09public void setCount(int count) %7B%0A%09%09%09this.count = count;%0A%09%09%7D%0A%0A%09%09public int getIndex() %7B%0A%09%09%09return index;%0A%09%09%7D%0A%0A%09%09public void setIndex(int index) %7B%0A%09%09%09this.index = index;%0A%09%09%7D%0A%0A%09%09public List%3CT%3E getItems() %7B%0A%09%09%09return items;%0A%09%09%7D%0A%0A%09%09public void setItems(List%3CT%3E items) %7B%0A%09%09%09this.items = items;%0A%09%09%7D%0A%0A%09%7D%0A%7D%0A

add GenericTestCase