You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2020/08/07 23:22:52 UTC

[commons-io] branch master updated: Plug fresource leaks

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new d97c3bd  Plug fresource leaks
d97c3bd is described below

commit d97c3bd024be301a91df30c08cd517d64ec2b3fc
Author: Sebb <se...@apache.org>
AuthorDate: Sat Aug 8 00:22:43 2020 +0100

    Plug fresource leaks
---
 .../io/output/ProxyCollectionWriterTest.java       | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/test/java/org/apache/commons/io/output/ProxyCollectionWriterTest.java b/src/test/java/org/apache/commons/io/output/ProxyCollectionWriterTest.java
index aa6e345..fa03ffb 100644
--- a/src/test/java/org/apache/commons/io/output/ProxyCollectionWriterTest.java
+++ b/src/test/java/org/apache/commons/io/output/ProxyCollectionWriterTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.io.output;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
@@ -50,6 +51,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -66,6 +68,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -82,6 +85,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -98,6 +102,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -114,6 +119,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -130,6 +136,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -145,6 +152,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -160,6 +168,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -175,6 +184,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -190,6 +200,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -206,6 +217,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -222,6 +234,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -238,6 +251,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -254,6 +268,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -270,6 +285,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -286,6 +302,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
 
         }
+        tw.close();
     }
 
     @Test
@@ -302,6 +319,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -319,6 +337,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
 
         }
+        tw.close();
     }
 
     @Test
@@ -335,6 +354,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCauseList().size());
             assertEquals(0, e.getCause(0, IOIndexedException.class).getIndex());
         }
+        tw.close();
     }
 
     @Test
@@ -352,6 +372,7 @@ public class ProxyCollectionWriterTest {
             assertEquals(1, e.getCause(0, IOIndexedException.class).getIndex());
 
         }
+        tw.close();
     }
 
     @Test
@@ -382,6 +403,7 @@ public class ProxyCollectionWriterTest {
             teeWriter.append('a');
             teeWriter.flush();
         }
+        assertTrue(true, "Test succeeded"); // need at least one assertion
     }
 
     @Test