Skip to content

Commit e32b436

Browse files
committed
Sort members
1 parent 7b9ad18 commit e32b436

2 files changed

Lines changed: 29 additions & 29 deletions

File tree

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

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,28 @@ public void testReadBufferOffsetLength() throws IOException {
105105
assertEquals(-1, stream.read(b, 0, b.length), "read(b, off, len)");
106106
}
107107

108-
@Test
109-
public void testResetBeforeEndCtor() throws IOException {
110-
try (final AutoCloseInputStream inputStream = new AutoCloseInputStream(new ByteArrayInputStream("1234".getBytes()))) {
111-
testResetBeforeEnd(inputStream);
112-
}
108+
private void testResetBeforeEnd(final AutoCloseInputStream inputStream) throws IOException {
109+
inputStream.mark(1);
110+
assertEquals('1', inputStream.read());
111+
inputStream.reset();
112+
assertEquals('1', inputStream.read());
113+
assertEquals('2', inputStream.read());
114+
inputStream.reset();
115+
assertEquals('1', inputStream.read());
116+
assertEquals('2', inputStream.read());
117+
assertEquals('3', inputStream.read());
118+
inputStream.reset();
119+
assertEquals('1', inputStream.read());
120+
assertEquals('2', inputStream.read());
121+
assertEquals('3', inputStream.read());
122+
assertEquals('4', inputStream.read());
123+
inputStream.reset();
124+
assertEquals('1', inputStream.read());
113125
}
114126

115127
@Test
116-
public void testResetBeforeEndSetInputStream() throws IOException {
117-
try (final AutoCloseInputStream inputStream = AutoCloseInputStream.builder().setInputStream(new ByteArrayInputStream("1234".getBytes())).get()) {
128+
public void testResetBeforeEndCtor() throws IOException {
129+
try (final AutoCloseInputStream inputStream = new AutoCloseInputStream(new ByteArrayInputStream("1234".getBytes()))) {
118130
testResetBeforeEnd(inputStream);
119131
}
120132
}
@@ -133,23 +145,11 @@ public void testResetBeforeEndSetCharSequence() throws IOException {
133145
}
134146
}
135147

136-
private void testResetBeforeEnd(final AutoCloseInputStream inputStream) throws IOException {
137-
inputStream.mark(1);
138-
assertEquals('1', inputStream.read());
139-
inputStream.reset();
140-
assertEquals('1', inputStream.read());
141-
assertEquals('2', inputStream.read());
142-
inputStream.reset();
143-
assertEquals('1', inputStream.read());
144-
assertEquals('2', inputStream.read());
145-
assertEquals('3', inputStream.read());
146-
inputStream.reset();
147-
assertEquals('1', inputStream.read());
148-
assertEquals('2', inputStream.read());
149-
assertEquals('3', inputStream.read());
150-
assertEquals('4', inputStream.read());
151-
inputStream.reset();
152-
assertEquals('1', inputStream.read());
148+
@Test
149+
public void testResetBeforeEndSetInputStream() throws IOException {
150+
try (final AutoCloseInputStream inputStream = AutoCloseInputStream.builder().setInputStream(new ByteArrayInputStream("1234".getBytes())).get()) {
151+
testResetBeforeEnd(inputStream);
152+
}
153153
}
154154

155155
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ protected void testConstructorFileInput() throws IOException {
205205
}
206206
}
207207

208+
@Test
209+
protected void testConstructorFileInputNull() {
210+
assertThrows(NullPointerException.class, () -> new XmlStreamReader((File) null));
211+
}
212+
208213
@Test
209214
protected void testConstructorFileInputOpenOptions() throws IOException {
210215
try (XmlStreamReader reader = new XmlStreamReader(new File("pom.xml"))) {
@@ -215,11 +220,6 @@ protected void testConstructorFileInputOpenOptions() throws IOException {
215220
}
216221
}
217222

218-
@Test
219-
protected void testConstructorFileInputNull() {
220-
assertThrows(NullPointerException.class, () -> new XmlStreamReader((File) null));
221-
}
222-
223223
@Test
224224
protected void testConstructorInputStreamInput() throws IOException {
225225
final Path path = Paths.get("pom.xml");

0 commit comments

Comments
 (0)