Skip to content
Prev Previous commit
Next Next commit
Added close statements for jsonReader
  • Loading branch information
rbrinkster committed Jun 22, 2015
commit f65b7e736c6e9d5c9141a09cfaa747d2a91ad510
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void testEmptyObject() throws JSONException {

assertNotNull(json);
assertTrue(json.isEmpty());
jsonReader.close();
}

@Test
Expand All @@ -58,6 +59,7 @@ public void testSimpleObjectWithTwoElements() throws JSONException {
assertEquals("red", json.getString("apple"));
assertTrue(json.containsKey("banana"));
assertEquals("yellow", json.getString("banana"));
jsonReader.close();
}

@Test
Expand All @@ -72,6 +74,7 @@ public void testArray() throws JSONException {

JSONAssert.assertEquals("{\"apple\":\"red\"}", jsonArr.get(0).toString(), JSONCompareMode.STRICT);
JSONAssert.assertEquals("{\"banana\":\"yellow\"}", jsonArr.get(1).toString(), JSONCompareMode.STRICT);
jsonReader.close();
}

@Test
Expand Down Expand Up @@ -103,5 +106,6 @@ public void testNestedStructure() throws JSONException {
+ " \"Laurence Fishburne\","
+ " \"Carrie-Anne Moss\""
+ " ]", jsonArr.toString(), JSONCompareMode.STRICT);
jsonReader.close();
}
}