Skip to content

Commit 305c003

Browse files
committed
Pull up ReadAheadInputStreamTest.testAvailableAfterOpen()
1 parent f03363e commit 305c003

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,20 @@
4040
*/
4141
public abstract class AbstractInputStreamTest {
4242

43+
static final String ARRAY_LENGTHS_NAME = "org.apache.commons.io.input.AbstractInputStreamTest#getArrayLengths";
44+
45+
static final int[] ARRAY_LENGTHS = { 0, 1, 2, 4, 8, 16, 32, 64, 128 };
46+
47+
static int[] getArrayLengths() {
48+
return ARRAY_LENGTHS;
49+
}
50+
4351
private byte[] randomBytes;
4452

4553
protected Path inputFile;
4654

4755
protected InputStream[] inputStreams;
4856

49-
static final String ARRAY_LENGTHS_NAME = "org.apache.commons.io.input.AbstractInputStreamTest#getArrayLengths";
50-
51-
static final int[] ARRAY_LENGTHS = { 0, 1, 2, 4, 8, 16, 32, 64, 128 };
52-
5357
@BeforeEach
5458
public void setUp() throws IOException {
5559
// Create a byte array of size 2 MB with random bytes
@@ -72,6 +76,13 @@ public void testAvailableAfterClose() throws Exception {
7276
}
7377
}
7478

79+
@Test
80+
public void testAvailableAfterOpen() throws Exception {
81+
for (final InputStream inputStream : inputStreams) {
82+
assertEquals(0, inputStream.available());
83+
}
84+
}
85+
7586
@Test
7687
public void testAvailableAfterRead() throws Exception {
7788
for (final InputStream inputStream : inputStreams) {
@@ -181,8 +192,4 @@ public void testSkipFromFileChannel() throws IOException {
181192
}
182193
}
183194
}
184-
185-
static int[] getArrayLengths() {
186-
return ARRAY_LENGTHS;
187-
}
188195
}

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@
1616
*/
1717
package org.apache.commons.io.input;
1818

19-
import static org.junit.jupiter.api.Assertions.assertEquals;
20-
2119
import java.io.IOException;
2220
import java.io.InputStream;
2321
import java.nio.file.StandardOpenOption;
2422

2523
import org.junit.jupiter.api.BeforeEach;
26-
import org.junit.jupiter.api.Test;
2724

2825
/**
2926
* Tests {@link ReadAheadInputStream}.
@@ -62,11 +59,4 @@ public void setUp() throws IOException {
6259
ReadAheadInputStream.builder().setPath(inputFile).setOpenOptions(StandardOpenOption.READ).get() };
6360
}
6461

65-
@Test
66-
public void testAvailableAfterOpen() throws Exception {
67-
for (final InputStream inputStream : inputStreams) {
68-
assertEquals(0, inputStream.available());
69-
}
70-
}
71-
7262
}

0 commit comments

Comments
 (0)