use of com.alibaba.fastjson.JSONReader in project fastjson by alibaba.
the class ReaderBooleanFieldTest method test_bool_error_f1.
public void test_bool_error_f1() throws Exception {
Exception error = null;
try {
JSONReader reader = new JSONReader(new StringReader("{\"value\":fa}"));
reader.readObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONReader in project fastjson by alibaba.
the class ReaderIntFieldTest method test_int_error_1.
public void test_int_error_1() throws Exception {
Exception error = null;
try {
JSONReader reader = new JSONReader(new StringReader("{\"value\":2147483648}"));
reader.readObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONReader in project fastjson by alibaba.
the class ReaderIntFieldTest method test_int_error_1_x.
public void test_int_error_1_x() throws Exception {
Exception error = null;
try {
JSONReader reader = new JSONReader(new StringReader("{\"value\":9223372036854775808}"));
reader.readObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONReader in project fastjson by alibaba.
the class ReaderIntFieldTest method test_int_error_end.
public void test_int_error_end() throws Exception {
Exception error = null;
try {
JSONReader reader = new JSONReader(new StringReader("{\"value\":1001,\"value2\":-2001["));
reader.readObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONReader in project fastjson by alibaba.
the class ReaderIntFieldTest method test_int_error_0.
public void test_int_error_0() throws Exception {
Exception error = null;
try {
JSONReader reader = new JSONReader(new StringReader("{\"value\":1.A}"));
reader.readObject(Model.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Aggregations