use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class Bug_for_issue_537 method test_for_issue_private.
public void test_for_issue_private() throws Exception {
String text = "{\"value\":2147483649}";
Exception error = null;
try {
JSON.parseObject(text, V1.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
Assert.assertTrue(error.getMessage().contains("field : value"));
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DateTest_error method test_error_1.
public void test_error_1() throws Exception {
String text = "{1:true}";
Exception error = null;
try {
JSON.parseObject(text, Date.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DateTest_error method test_error.
public void test_error() throws Exception {
String text = "{\"value\":true}";
Exception error = null;
try {
JSON.parseObject(text, Date.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class BuilderTest_error method test_0.
public void test_0() throws Exception {
Exception error = null;
try {
JSON.parseObject("{\"id\":12304,\"name\":\"ljw\"}", VO.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DateTest_error method test_error_5.
public void test_error_5() throws Exception {
String text = "\"xxxxxxxxx\"";
Exception error = null;
try {
JSON.parseObject(text, Date.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Aggregations