mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 19:15:27 -04:00
long circle test
This commit is contained in:
parent
1ffcf3915c
commit
638273af7a
@ -3224,7 +3224,17 @@ public class JSONObjectTest {
|
||||
RecursiveBean ObjA = new RecursiveBean("ObjA");
|
||||
RecursiveBean ObjB = new RecursiveBean("ObjB", ObjA);
|
||||
ObjA.setRef(ObjB);
|
||||
JSONObject jsonObject = new JSONObject(ObjA);
|
||||
new JSONObject(ObjA);
|
||||
fail("Expected an exception");
|
||||
}
|
||||
@Test(expected=JSONException.class)
|
||||
public void testLongRecursiveObject() {
|
||||
RecursiveBean ObjA = new RecursiveBean("ObjA");
|
||||
RecursiveBean ObjB = new RecursiveBean("ObjB", ObjA);
|
||||
RecursiveBean ObjC = new RecursiveBean("ObjB", ObjB);
|
||||
RecursiveBean ObjD = new RecursiveBean("ObjB", ObjC);
|
||||
ObjA.setRef(ObjD);
|
||||
new JSONObject(ObjB);
|
||||
fail("Expected an exception");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user