use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_scanFieldInt method test_error_4.
public void test_error_4() throws Exception {
JSONException error = null;
try {
String text = "{\"value\":δΈ}";
JSON.parseObject(text, VO.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_scanFieldStringArray method test_string_error_3.
public void test_string_error_3() throws Exception {
JSONException error = null;
try {
String text = "{\"value\":[\"1\"]}}";
JSON.parseObject(text, VO.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_scanFieldStringArray method test_string_error.
public void test_string_error() throws Exception {
JSONException error = null;
try {
String text = "{\"value\":{}}";
JSON.parseObject(text, VO.class);
} catch (JSONException e) {
error = e;
}
//Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_scanFieldStringArray method test_string_error_4.
public void test_string_error_4() throws Exception {
JSONException error = null;
try {
String text = "{\"value\":[\"1\"]]";
JSON.parseObject(text, VO.class);
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_singQuoteString method test_error_1.
public void test_error_1() throws Exception {
Exception error = null;
try {
JSONScanner lexer = new JSONScanner("'k\\k'");
lexer.config(Feature.AllowSingleQuotes, true);
lexer.nextToken();
Assert.assertEquals(JSONToken.ERROR, lexer.token());
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Aggregations