use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultExtJSONParserTest_2 method test_error_6.
public void test_error_6() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{'a':3}");
parser.config(Feature.AllowSingleQuotes, false);
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_2.
public void test_error_2() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{a 3}");
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 DefaultJSONParserTest2 method test_4.
public void test_4() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{");
parser.config(Feature.AllowUnQuotedFieldNames, true);
parser.parse();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class FeatureParserTest method test_error_1.
public void test_error_1() throws Exception {
JSONException error = null;
try {
DefaultJSONParser parser = new DefaultJSONParser("{\"a\":'3'}");
parser.config(Feature.AllowSingleQuotes, false);
parser.parse();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONLexerTest_2 method test_2.
public void test_2() throws Exception {
Exception error = null;
try {
JSON.parseObject("{\"@type\":\"com.alibaba.json.bvt.parser.JSONLexerTest_2$A\"}", VO.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Aggregations