use of com.alibaba.json.bvt.writeAsArray.WriteAsArray_int_public.VO in project fastjson by alibaba.
the class WriteAsArray_long_public method test_2.
public void test_2() throws Exception {
String text = "[-123 ,\"wenshao\"]";
VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
Assert.assertEquals(-123, vo2.getId());
Assert.assertEquals("wenshao", vo2.getName());
}
use of com.alibaba.json.bvt.writeAsArray.WriteAsArray_int_public.VO in project fastjson by alibaba.
the class WriteAsArray_long_public method test_0.
public void test_0() throws Exception {
VO vo = new VO();
vo.setId(123);
vo.setName("wenshao");
String text = JSON.toJSONString(vo, SerializerFeature.BeanToArray);
Assert.assertEquals("[123,\"wenshao\"]", text);
VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
Assert.assertEquals(vo.getId(), vo2.getId());
Assert.assertEquals(vo.getName(), vo2.getName());
}
use of com.alibaba.json.bvt.writeAsArray.WriteAsArray_int_public.VO in project fastjson by alibaba.
the class WriteAsArray_long_public method test_1.
public void test_1() throws Exception {
String text = "[123 ,\"wenshao\"]";
VO vo2 = JSON.parseObject(text, VO.class, Feature.SupportArrayToBean);
Assert.assertEquals(123, vo2.getId());
Assert.assertEquals("wenshao", vo2.getName());
}
use of com.alibaba.json.bvt.writeAsArray.WriteAsArray_int_public.VO in project fastjson by alibaba.
the class WriteAsArray_long_public method test_2_stream.
public void test_2_stream() throws Exception {
String text = "[-123 ,\"wenshao\"]";
JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
VO vo2 = reader.readObject(VO.class);
Assert.assertEquals(-123, vo2.getId());
Assert.assertEquals("wenshao", vo2.getName());
}
use of com.alibaba.json.bvt.writeAsArray.WriteAsArray_int_public.VO in project fastjson by alibaba.
the class WriteAsArray_long_public method test_1_stream.
public void test_1_stream() throws Exception {
String text = "[123 ,\"wenshao\"]";
JSONReader reader = new JSONReader(new StringReader(text), Feature.SupportArrayToBean);
VO vo2 = reader.readObject(VO.class);
Assert.assertEquals(123, vo2.getId());
Assert.assertEquals("wenshao", vo2.getName());
}
Aggregations