use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class Issue87 method test_for_issue.
public void test_for_issue() throws Exception {
TestObject to = new TestObject();
to.add("test1");
to.add("test2");
String text = JSON.toJSONString(to);
System.out.println(text);
JSONObject jo = JSON.parseObject(text);
to = JSON.toJavaObject(jo, TestObject.class);
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class Issue87_hashset method test_for_issue.
public void test_for_issue() throws Exception {
TestObject to = new TestObject();
to.add("test1");
to.add("test2");
String text = JSON.toJSONString(to);
System.out.println(text);
JSONObject jo = JSON.parseObject(text);
to = JSON.toJavaObject(jo, TestObject.class);
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class Issue94 method test_for_issue.
public void test_for_issue() throws Exception {
JSONObject o = new JSONObject();
o.put("line", "{\"1\":}");
o.toString();
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class Issue780 method test_for_issue.
public void test_for_issue() throws Exception {
JSONObject json = new JSONObject();
json.put("robj", "{abc: 123}");
JSONObject robj = json.getJSONObject("robj");
assertEquals(123, robj.get("abc"));
}
use of com.alibaba.fastjson.JSONObject in project fastjson by alibaba.
the class Issue793 method test_for_issue.
public void test_for_issue() throws Exception {
String text = "{ \"code\": 1000, \"data\": \"success\", \"game_data\": [], \"member_list\": [], \"message\": \"\\u6210\\u529f\" }";
JSONObject json = JSON.parseObject(text);
assertEquals(1000, json.get("code"));
}
Aggregations