use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class JSONObjectTest_get method test_get.
public void test_get() throws Exception {
JSONObject obj = JSON.parseObject("{id:123}");
Assert.assertEquals(123, obj.getObject("id", Object.class));
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class JSONObjectTest_getDate method test_get_empty.
public void test_get_empty() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", "");
Assert.assertEquals("", obj.get("value"));
Assert.assertNull(obj.getDate("value"));
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class JSONObjectTest_getObj method test_get_empty.
public void test_get_empty() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", "");
Assert.assertEquals("", obj.get("value"));
Assert.assertNull(obj.getObject("value", Model.class));
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class JSONObjectTest_getObj method test_get_null.
public void test_get_null() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", "null");
Assert.assertEquals("null", obj.get("value"));
Assert.assertNull(obj.getObject("value", Model.class));
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class JSONObjectTest_getObj_2 method test_get_empty.
public void test_get_empty() throws Exception {
JSONObject obj = new JSONObject();
obj.put("value", "");
Assert.assertEquals("", obj.get("value"));
Assert.assertNull(obj.getObject("value", Model.class));
}
Aggregations