File tree Expand file tree Collapse file tree
src/test/java/org/json/junit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3224,7 +3224,17 @@ public void testSimpleRecursiveObject() {
32243224 RecursiveBean ObjA = new RecursiveBean ("ObjA" );
32253225 RecursiveBean ObjB = new RecursiveBean ("ObjB" , ObjA );
32263226 ObjA .setRef (ObjB );
3227- JSONObject jsonObject = new JSONObject (ObjA );
3227+ new JSONObject (ObjA );
3228+ fail ("Expected an exception" );
3229+ }
3230+ @ Test (expected =JSONException .class )
3231+ public void testLongRecursiveObject () {
3232+ RecursiveBean ObjA = new RecursiveBean ("ObjA" );
3233+ RecursiveBean ObjB = new RecursiveBean ("ObjB" , ObjA );
3234+ RecursiveBean ObjC = new RecursiveBean ("ObjB" , ObjB );
3235+ RecursiveBean ObjD = new RecursiveBean ("ObjB" , ObjC );
3236+ ObjA .setRef (ObjD );
3237+ new JSONObject (ObjB );
32283238 fail ("Expected an exception" );
32293239 }
32303240
You can’t perform that action at this time.
0 commit comments