Skip to content

Commit db86ede

Browse files
committed
Sort members
1 parent 5d26b46 commit db86ede

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,6 @@ private void readFile(final BOMInputStream bomInputStream) throws Exception {
207207
} while (bytes > 0);
208208
}
209209

210-
@Test
211-
public void testAvailableWithBOMAfterOpen() throws Exception {
212-
final byte[] data = { 'A', 'B', 'C', 'D' };
213-
try (InputStream in = BOMInputStream.builder().setInputStream(createUtf8Input(data, true)).get()) {
214-
assertEquals(7, in.available());
215-
}
216-
}
217-
218210
@Test
219211
public void testAvailableWithBOMAfterClose() throws Exception {
220212
final byte[] data = { 'A', 'B', 'C', 'D' };
@@ -227,14 +219,11 @@ public void testAvailableWithBOMAfterClose() throws Exception {
227219
}
228220

229221
@Test
230-
public void testReadAfterClose() throws Exception {
222+
public void testAvailableWithBOMAfterOpen() throws Exception {
231223
final byte[] data = { 'A', 'B', 'C', 'D' };
232-
final InputStream shadow;
233224
try (InputStream in = BOMInputStream.builder().setInputStream(createUtf8Input(data, true)).get()) {
234225
assertEquals(7, in.available());
235-
shadow = in;
236226
}
237-
assertEquals(IOUtils.EOF, shadow.read());
238227
}
239228

240229
@Test
@@ -437,6 +426,17 @@ public void testNoBoms() throws Exception {
437426
.close());
438427
}
439428

429+
@Test
430+
public void testReadAfterClose() throws Exception {
431+
final byte[] data = { 'A', 'B', 'C', 'D' };
432+
final InputStream shadow;
433+
try (InputStream in = BOMInputStream.builder().setInputStream(createUtf8Input(data, true)).get()) {
434+
assertEquals(7, in.available());
435+
shadow = in;
436+
}
437+
assertEquals(IOUtils.EOF, shadow.read());
438+
}
439+
440440
@Test
441441
public void testReadEmpty() throws Exception {
442442
final byte[] data = {};

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,6 @@ public void testAvailableAfterClose() throws IOException {
9090
}
9191
}
9292

93-
@Test
94-
public void testReasdAfterClose() throws IOException {
95-
try (InputStream inputStream = createInputStream()) {
96-
inputStream.close();
97-
assertEquals(IOUtils.EOF, inputStream.read());
98-
}
99-
}
100-
10193
@Test
10294
public void testAvailableAfterOpen() throws IOException {
10395
try (InputStream inputStream = createInputStream()) {
@@ -309,6 +301,14 @@ public void testReadZeroEmptyString() throws Exception {
309301
}
310302
}
311303

304+
@Test
305+
public void testReasdAfterClose() throws IOException {
306+
try (InputStream inputStream = createInputStream()) {
307+
inputStream.close();
308+
assertEquals(IOUtils.EOF, inputStream.read());
309+
}
310+
}
311+
312312
@Test
313313
public void testResetCharset() {
314314
assertNotNull(ReaderInputStream.builder().setReader(new StringReader("\uD800")).setCharset((Charset) null).getCharset());

0 commit comments

Comments
 (0)