Skip to content

Commit 0b1d511

Browse files
committed
Added close statements for jsonReader
1 parent f65b7e7 commit 0b1d511

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

json/object-reader/src/test/java/org/javaee7/json/object/reader/JsonReaderFromStreamTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void testEmptyObject() throws JSONException {
4848

4949
assertNotNull(json);
5050
assertTrue(json.isEmpty());
51+
jsonReader.close();
5152
}
5253

5354
@Test
@@ -64,6 +65,7 @@ public void testSimpleObjectWithTwoElements() throws JSONException {
6465
assertEquals("red", json.getString("apple"));
6566
assertTrue(json.containsKey("banana"));
6667
assertEquals("yellow", json.getString("banana"));
68+
jsonReader.close();
6769
}
6870

6971
@Test
@@ -78,6 +80,7 @@ public void testArray() throws JSONException {
7880

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

8386
@Test
@@ -104,5 +107,6 @@ public void testNestedStructure() throws JSONException {
104107
+ " \"Laurence Fishburne\","
105108
+ " \"Carrie-Anne Moss\""
106109
+ " ]", jsonArr.toString(), JSONCompareMode.STRICT);
110+
jsonReader.close();
107111
}
108112
}

0 commit comments

Comments
 (0)