File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717package org .apache .commons .io .input ;
1818
1919import 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
2123import java .io .IOException ;
2224import 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 ) {
Original file line number Diff line number Diff line change 1717package org .apache .commons .io .input ;
1818
1919import static org .junit .jupiter .api .Assertions .assertEquals ;
20- import static org .junit .jupiter .api .Assertions .assertNotEquals ;
2120import static org .junit .jupiter .api .Assertions .assertThrows ;
2221import 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
You can’t perform that action at this time.
0 commit comments