1717package org .apache .commons .io .output ;
1818
1919import static org .junit .jupiter .api .Assertions .assertEquals ;
20- import static org .junit .jupiter .api .Assertions .assertTrue ;
2120import static org .junit .jupiter .api .Assertions .fail ;
2221import static org .mockito .Mockito .mock ;
2322import static org .mockito .Mockito .verify ;
@@ -51,7 +50,6 @@ public void testArrayIOExceptionOnAppendChar1() throws IOException {
5150 assertEquals (1 , e .getCauseList ().size ());
5251 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
5352 }
54- tw .close ();
5553 }
5654
5755 @ Test
@@ -68,7 +66,6 @@ public void testArrayIOExceptionOnAppendChar2() throws IOException {
6866 assertEquals (1 , e .getCauseList ().size ());
6967 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
7068 }
71- tw .close ();
7269 }
7370
7471 @ Test
@@ -85,7 +82,6 @@ public void testArrayIOExceptionOnAppendCharSequence1() throws IOException {
8582 assertEquals (1 , e .getCauseList ().size ());
8683 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
8784 }
88- tw .close ();
8985 }
9086
9187 @ Test
@@ -102,7 +98,6 @@ public void testArrayIOExceptionOnAppendCharSequence2() throws IOException {
10298 assertEquals (1 , e .getCauseList ().size ());
10399 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
104100 }
105- tw .close ();
106101 }
107102
108103 @ Test
@@ -119,7 +114,6 @@ public void testArrayIOExceptionOnAppendCharSequenceIntInt1() throws IOException
119114 assertEquals (1 , e .getCauseList ().size ());
120115 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
121116 }
122- tw .close ();
123117 }
124118
125119 @ Test
@@ -136,7 +130,6 @@ public void testArrayIOExceptionOnAppendCharSequenceIntInt2() throws IOException
136130 assertEquals (1 , e .getCauseList ().size ());
137131 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
138132 }
139- tw .close ();
140133 }
141134
142135 @ Test
@@ -152,7 +145,6 @@ public void testArrayIOExceptionOnClose1() throws IOException {
152145 assertEquals (1 , e .getCauseList ().size ());
153146 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
154147 }
155- tw .close ();
156148 }
157149
158150 @ Test
@@ -168,7 +160,6 @@ public void testArrayIOExceptionOnClose2() throws IOException {
168160 assertEquals (1 , e .getCauseList ().size ());
169161 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
170162 }
171- tw .close ();
172163 }
173164
174165 @ Test
@@ -184,7 +175,6 @@ public void testArrayIOExceptionOnFlush1() throws IOException {
184175 assertEquals (1 , e .getCauseList ().size ());
185176 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
186177 }
187- tw .close ();
188178 }
189179
190180 @ Test
@@ -200,7 +190,6 @@ public void testArrayIOExceptionOnFlush2() throws IOException {
200190 assertEquals (1 , e .getCauseList ().size ());
201191 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
202192 }
203- tw .close ();
204193 }
205194
206195 @ Test
@@ -217,7 +206,6 @@ public void testArrayIOExceptionOnWriteCharArray1() throws IOException {
217206 assertEquals (1 , e .getCauseList ().size ());
218207 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
219208 }
220- tw .close ();
221209 }
222210
223211 @ Test
@@ -234,7 +222,6 @@ public void testArrayIOExceptionOnWriteCharArray2() throws IOException {
234222 assertEquals (1 , e .getCauseList ().size ());
235223 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
236224 }
237- tw .close ();
238225 }
239226
240227 @ Test
@@ -251,7 +238,6 @@ public void testArrayIOExceptionOnWriteCharArrayIntInt1() throws IOException {
251238 assertEquals (1 , e .getCauseList ().size ());
252239 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
253240 }
254- tw .close ();
255241 }
256242
257243 @ Test
@@ -268,7 +254,6 @@ public void testArrayIOExceptionOnWriteCharArrayIntInt2() throws IOException {
268254 assertEquals (1 , e .getCauseList ().size ());
269255 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
270256 }
271- tw .close ();
272257 }
273258
274259 @ Test
@@ -285,7 +270,6 @@ public void testArrayIOExceptionOnWriteInt1() throws IOException {
285270 assertEquals (1 , e .getCauseList ().size ());
286271 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
287272 }
288- tw .close ();
289273 }
290274
291275 @ Test
@@ -302,7 +286,6 @@ public void testArrayIOExceptionOnWriteInt2() throws IOException {
302286 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
303287
304288 }
305- tw .close ();
306289 }
307290
308291 @ Test
@@ -319,7 +302,6 @@ public void testArrayIOExceptionOnWriteString1() throws IOException {
319302 assertEquals (1 , e .getCauseList ().size ());
320303 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
321304 }
322- tw .close ();
323305 }
324306
325307 @ Test
@@ -337,7 +319,6 @@ public void testArrayIOExceptionOnWriteString2() throws IOException {
337319 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
338320
339321 }
340- tw .close ();
341322 }
342323
343324 @ Test
@@ -354,7 +335,6 @@ public void testArrayIOExceptionOnWriteStringIntInt1() throws IOException {
354335 assertEquals (1 , e .getCauseList ().size ());
355336 assertEquals (0 , e .getCause (0 , IOIndexedException .class ).getIndex ());
356337 }
357- tw .close ();
358338 }
359339
360340 @ Test
@@ -372,7 +352,6 @@ public void testArrayIOExceptionOnWriteStringIntInt2() throws IOException {
372352 assertEquals (1 , e .getCause (0 , IOIndexedException .class ).getIndex ());
373353
374354 }
375- tw .close ();
376355 }
377356
378357 @ Test
@@ -403,7 +382,6 @@ public void testConstructorsNull() throws IOException {
403382 teeWriter .append ('a' );
404383 teeWriter .flush ();
405384 }
406- assertTrue (true , "Test succeeded" ); // need at least one assertion
407385 }
408386
409387 @ Test
0 commit comments