use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultJSONParserTest_comma method test_getInput.
public void test_getInput() {
String text = "{,,}";
char[] chars = text.toCharArray();
DefaultJSONParser parser = new DefaultJSONParser(chars, chars.length, ParserConfig.getGlobalInstance(), 0);
JSONException error = null;
try {
parser.parseObject();
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class DefaultJSONParserTest_error method test_error_2.
public void test_error_2() {
String text = "{\"obj\":[]]}";
char[] chars = text.toCharArray();
DefaultJSONParser parser = new DefaultJSONParser(chars, chars.length, ParserConfig.getGlobalInstance(), 0);
JSONException error = null;
try {
parser.parseObject();
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_colon method test_7.
public void test_7() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("true");
lexer.nextTokenWithColon();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_false method test_scan_false_5.
public void test_scan_false_5() throws Exception {
JSONException error = null;
try {
JSONScanner lexer = new JSONScanner("falsz");
lexer.scanFalse();
} catch (JSONException e) {
error = e;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.JSONException in project fastjson by alibaba.
the class JSONScannerTest_scanFieldFloat method test_error_6.
public void test_error_6() throws Exception {
JSONException error = null;
try {
String text = "{\"value\":3.2]";
JSON.parseObject(text, VO.class);
} catch (JSONException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
Aggregations