use of com.alibaba.fastjson.parser.DefaultJSONParser in project fastjson by alibaba.
the class DefaultExtJSONParserTest_0 method test_0.
public void test_0() throws Exception {
DefaultJSONParser parser = new DefaultJSONParser("123");
Assert.assertEquals(new Integer(123), (Integer) parser.parse());
parser.config(Feature.IgnoreNotMatch, false);
}
use of com.alibaba.fastjson.parser.DefaultJSONParser in project fastjson by alibaba.
the class DefaultExtJSONParserTest_0 method test_2.
public void test_2() throws Exception {
DefaultJSONParser parser = new DefaultJSONParser("{}");
parser.parseObject(Object.class);
}
use of com.alibaba.fastjson.parser.DefaultJSONParser 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.parser.DefaultJSONParser in project fastjson by alibaba.
the class DefaultExtJSONParserTest_0 method test_3.
public void test_3() throws Exception {
DefaultJSONParser parser = new DefaultJSONParser("{}");
parser.parseObject(User.class);
}
use of com.alibaba.fastjson.parser.DefaultJSONParser 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);
}
Aggregations