Skip to content

Commit e337e7b

Browse files
committed
Close some resources
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1582843 13f79535-47bb-0310-9956-ffa450edef68
1 parent f7703be commit e337e7b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ private void readBOMInputStreamTwice(final String resource) throws Exception {
180180
this.readFile(bomInputStream);
181181
bomInputStream.reset();
182182
this.readFile(bomInputStream);
183+
inputStream.close();
184+
bomInputStream.close();
183185
}
184186

185187
private void readFile(final BOMInputStream bomInputStream) throws Exception {
@@ -214,6 +216,7 @@ public void testClose() throws Exception {
214216

215217
in.close();
216218
del.assertCloseCalled();
219+
del.close();
217220
}
218221

219222
@Test

src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTestCase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ public void testToInputStream() throws IOException {
123123
refData = ref.toByteArray();
124124
assertEquals(8254, baoutData.length);
125125
checkByteArrays(refData, baoutData);
126+
baout.close();
127+
in.close();
126128
}
127129

128130
public void testToInputStreamWithReset() throws IOException {
@@ -155,6 +157,8 @@ public void testToInputStreamWithReset() throws IOException {
155157
refData = ref.toByteArray();
156158
assertEquals(30, baoutData.length);
157159
checkByteArrays(refData, baoutData);
160+
baout.close();
161+
in.close();
158162
}
159163

160164
public void testStream() throws Exception {
@@ -210,6 +214,8 @@ public void testStream() throws Exception {
210214
assertSame(baos1.toByteArray(), baos2.toByteArray());
211215
baos1.close();
212216
baos2.close();
217+
baout.close();
218+
baout1.close();
213219
}
214220
}
215221

0 commit comments

Comments
 (0)