Skip to content

Commit 5477058

Browse files
committed
Add TeeInputStreamTest.testCloseHandleIOException()
1 parent ab48680 commit 5477058

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ public void testCloseBranchIOException() throws Exception {
7171
verify(goodIs, times(2)).close();
7272
}
7373

74+
@SuppressWarnings({ "resource" })
75+
@Test
76+
public void testCloseHandleIOException() throws IOException {
77+
ProxyInputStreamTest
78+
.testCloseHandleIOException(new TeeInputStream(new BrokenInputStream((Throwable) new IOException()), new ByteArrayOutputStream(), false));
79+
ProxyInputStreamTest
80+
.testCloseHandleIOException(new TeeInputStream(new BrokenInputStream((Throwable) new IOException()), new ByteArrayOutputStream(), true));
81+
}
82+
7483
/**
7584
* Tests that the branch {@code OutputStream} is closed when closing the main {@code InputStream} throws an
7685
* exception on {@link TeeInputStream#close()}, if specified to do so.

0 commit comments

Comments
 (0)