use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DateParserTest method test_date_error_0.
public void test_date_error_0() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("true");
parser.parseObject(java.util.Date.class);
parser.close();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultExtJSONParserTest_0 method test_error_2.
public void test_error_2() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{\"errorValue\":33}");
parser.parseArray(User.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultExtJSONParserTest_0 method test_error_3.
public void test_error_3() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{\"age\"33}");
parser.parseArray(User.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultExtJSONParserTest_2 method test_error_3.
public void test_error_3() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{");
parser.config(Feature.AllowUnQuotedFieldNames, true);
parser.parseObject(A.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultExtJSONParserTest_2 method test_error_5.
public void test_error_5() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{a:3}");
parser.config(Feature.AllowUnQuotedFieldNames, false);
parser.parseObject(A.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
Aggregations