Skip to content

Commit 6885adf

Browse files
committed
Added close statements for parser
1 parent 0b1d511 commit 6885adf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

json/streaming-parser/src/test/java/org/javaee7/json/streaming/parser/JsonParserFromReaderTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public void testEmptyObject() throws JSONException {
3737
JsonParser parser = Json.createParser(new StringReader(json));
3838
assertEquals(JsonParser.Event.START_OBJECT, parser.next());
3939
assertEquals(JsonParser.Event.END_OBJECT, parser.next());
40+
parser.close();
4041
}
4142

4243
@Test
@@ -52,6 +53,7 @@ public void testSimpleObject() throws JSONException {
5253
assertEquals(JsonParser.Event.KEY_NAME, parser.next());
5354
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
5455
assertEquals(JsonParser.Event.END_OBJECT, parser.next());
56+
parser.close();
5557
}
5658

5759
@Test
@@ -68,6 +70,7 @@ public void testArray() throws JSONException {
6870
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
6971
assertEquals(JsonParser.Event.END_OBJECT, parser.next());
7072
assertEquals(JsonParser.Event.END_ARRAY, parser.next());
73+
parser.close();
7174
}
7275

7376
@Test
@@ -86,5 +89,6 @@ public void testNestedStructure() throws JSONException {
8689
assertEquals(JsonParser.Event.VALUE_STRING, parser.next());
8790
assertEquals(JsonParser.Event.END_ARRAY, parser.next());
8891
assertEquals(JsonParser.Event.END_OBJECT, parser.next());
92+
parser.close();
8993
}
9094
}

0 commit comments

Comments
 (0)