use of com.alibaba.fastjson.serializer.CollectionCodec in project fastjson by alibaba.
the class CollectionSerializerTest method test_2_s.
public void test_2_s() throws Exception {
SerializeWriter out = new SerializeWriter();
CollectionCodec listSerializer = new CollectionCodec();
List<Object> list = new ArrayList<Object>();
list.add(1);
list.add(2);
listSerializer.write(new JSONSerializer(out), list, null, null, 0);
Assert.assertEquals("[1,2]", out.toString());
}
Aggregations