This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 99a3ab7b71ce63d8ad608c1fea2ba8e4ec50de83 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Tue Jul 26 09:10:13 2022 -0400 Add missing RandomAccessFileInputStream test --- .../io/input/RandomAccessFileInputStreamTest.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java b/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java index 7622e61b..45e1d019 100644 --- a/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java +++ b/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java @@ -57,7 +57,7 @@ public class RandomAccessFileInputStreamTest { } @Test - public void testCtorCloseOnCloseFalse() throws IOException { + public void testConstructorCloseOnCloseFalse() throws IOException { try (RandomAccessFile file = createRandomAccessFile()) { try (RandomAccessFileInputStream inputStream = new RandomAccessFileInputStream(file, false)) { assertFalse(inputStream.isCloseOnClose()); @@ -67,7 +67,7 @@ public class RandomAccessFileInputStreamTest { } @Test - public void testCtorCloseOnCloseTrue() throws IOException { + public void testConstructorCloseOnCloseTrue() throws IOException { try (RandomAccessFile file = createRandomAccessFile()) { try (RandomAccessFileInputStream inputStream = new RandomAccessFileInputStream(file, true)) { assertTrue(inputStream.isCloseOnClose()); @@ -77,7 +77,17 @@ public class RandomAccessFileInputStreamTest { } @Test - public void testCtorNullFile() { + public void testConstructorFile() throws IOException { + try (RandomAccessFile file = createRandomAccessFile()) { + try (RandomAccessFileInputStream inputStream = new RandomAccessFileInputStream(file)) { + assertFalse(inputStream.isCloseOnClose()); + } + file.read(); + } + } + + @Test + public void testConstructorFileNull() { assertThrows(NullPointerException.class, () -> new RandomAccessFileInputStream(null)); }