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-compress.git

commit 1a52e2f22b823940239b7ea11aa70083b7729c19
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Mar 5 15:57:36 2021 -0500

    Fix test leaking file handles.
---
 .../org/apache/commons/compress/DetectArchiverTestCase.java   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java 
b/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
index 1212271..2351308 100644
--- a/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
+++ b/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
@@ -51,17 +51,18 @@ public final class DetectArchiverTestCase extends 
AbstractTestCase {
     }
 
     @Test
-    public void testCOMPRESS117() throws Exception {
+    public void testCOMPRESS_117() throws Exception {
         final ArchiveInputStream tar = getStreamFor("COMPRESS-117.tar");
         assertNotNull(tar);
         assertTrue(tar instanceof TarArchiveInputStream);
     }
 
     @Test
-    public void testCOMPRESS335() throws Exception {
-        final ArchiveInputStream tar = getStreamFor("COMPRESS-335.tar");
-        assertNotNull(tar);
-        assertTrue(tar instanceof TarArchiveInputStream);
+    public void testCOMPRESS_335() throws Exception {
+        try (final ArchiveInputStream tar = getStreamFor("COMPRESS-335.tar")) {
+            assertNotNull(tar);
+            assertTrue(tar instanceof TarArchiveInputStream);
+        }
     }
 
     @Test

Reply via email to