Skip to content

Commit bd706ae

Browse files
committed
Pull up BufferedFileChannelInputStreamTest's testAvailableAfterClose()
and testAvailableAfterRead()
1 parent 31fad24 commit bd706ae

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package org.apache.commons.io.input;
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
21+
import static org.junit.jupiter.api.Assertions.assertTrue;
2022

2123
import java.io.IOException;
2224
import java.io.InputStream;
@@ -58,6 +60,22 @@ public void tearDown() throws IOException {
5860
IOUtils.close(inputStreams);
5961
}
6062

63+
@Test
64+
public void testAvailableAfterClose() throws Exception {
65+
for (final InputStream inputStream : inputStreams) {
66+
inputStream.close();
67+
assertEquals(0, inputStream.available());
68+
}
69+
}
70+
71+
@Test
72+
public void testAvailableAfterRead() throws Exception {
73+
for (final InputStream inputStream : inputStreams) {
74+
assertNotEquals(IOUtils.EOF, inputStream.read());
75+
assertTrue(inputStream.available() > 0);
76+
}
77+
}
78+
6179
@Test
6280
public void testBytesSkipped() throws IOException {
6381
for (final InputStream inputStream : inputStreams) {

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.apache.commons.io.input;
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
20-
import static org.junit.jupiter.api.Assertions.assertNotEquals;
2120
import static org.junit.jupiter.api.Assertions.assertThrows;
2221
import static org.junit.jupiter.api.Assertions.assertTrue;
2322

@@ -54,29 +53,13 @@ public void setUp() throws IOException {
5453
//@formatter:on
5554
}
5655

57-
@Test
58-
public void testAvailableAfterClose() throws Exception {
59-
for (final InputStream inputStream : inputStreams) {
60-
inputStream.close();
61-
assertEquals(0, inputStream.available());
62-
}
63-
}
64-
6556
@Test
6657
public void testAvailableAfterOpen() throws Exception {
6758
for (final InputStream inputStream : inputStreams) {
6859
assertTrue(inputStream.available() > 0);
6960
}
7061
}
7162

72-
@Test
73-
public void testAvailableAfterRead() throws Exception {
74-
for (final InputStream inputStream : inputStreams) {
75-
assertNotEquals(IOUtils.EOF, inputStream.read());
76-
assertTrue(inputStream.available() > 0);
77-
}
78-
}
79-
8063
@Test
8164
public void testBuilderGet() {
8265
// java.lang.IllegalStateException: origin == null

0 commit comments

Comments
 (0)