use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.
the class SerializeEnumAsJavaBeanTest_manual method setUp.
protected void setUp() throws Exception {
SerializeConfig serializeConfig = SerializeConfig.globalInstance;
serializeConfig.configEnumAsJavaBean(OrderType.class);
}
use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.
the class FeaturesTest method test_0.
public void test_0() throws Exception {
SerializeConfig config = new SerializeConfig();
config.setAsmEnable(false);
String text = JSON.toJSONString(new Entity(), config);
Assert.assertEquals("{\"value\":null}", text);
}
use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.
the class FeaturesTest2 method test_1.
public void test_1() throws Exception {
SerializeConfig config = new SerializeConfig();
config.setAsmEnable(true);
String text = JSON.toJSONString(new Entity(), config);
Assert.assertEquals("{\"value\":0}", text);
}
use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.
the class FeaturesTest3 method test_1.
public void test_1() throws Exception {
SerializeConfig config = new SerializeConfig();
config.setAsmEnable(true);
String text = JSON.toJSONString(new Entity(), config);
Assert.assertEquals("{\"value\":0}", text);
}
use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.
the class FeaturesTest4 method test_1.
public void test_1() throws Exception {
SerializeConfig config = new SerializeConfig();
config.setAsmEnable(true);
String text = JSON.toJSONString(new Entity(), config);
Assert.assertEquals("{\"value\":\"\"}", text);
}
Aggregations