[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    svn commit: r1441231 - in /commons/proper/io/trunk/src/test/java/org/apache/commons/io:
From:       sebb () apache ! org
Date:       2013-01-31 22:30:31
Message-ID: 20130131223031.D735E2388980 () eris ! apache ! org
[Download RAW message or body]

Author: sebb
Date: Thu Jan 31 22:30:31 2013
New Revision: 1441231

URL: http://svn.apache.org/viewvc?rev=1441231&view=rev
Log:
Suppress warnings for streams deliberately left unclosed

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java


Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java
                
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java?rev=1441231&r1=1441230&r2=1441231&view=diff
 ==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java \
                (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java \
Thu Jan 31 22:30:31 2013 @@ -106,6 +106,7 @@ public class CopyUtilsTest extends FileB
         assertEquals(inDataStr, writer.toString());
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -121,6 +122,7 @@ public class CopyUtilsTest extends FileB
         assertEquals(inData.length, count);
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -145,6 +147,7 @@ public class CopyUtilsTest extends FileB
         assertEquals(inDataStr, writer.toString());
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -165,6 +168,7 @@ public class CopyUtilsTest extends FileB
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
                
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java?rev=1441231&r1=1441230&r2=1441231&view=diff
 ==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java \
                (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java \
Thu Jan 31 22:30:31 2013 @@ -71,6 +71,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -104,6 +105,7 @@ public class IOUtilsCopyTestCase extends
         testCopy_inputStreamToOutputStreamWithBufferSize(16384);
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     private void testCopy_inputStreamToOutputStreamWithBufferSize(final int \
bufferSize) throws Exception {  InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -154,6 +156,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -190,6 +193,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToWriter_Encoding() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -226,6 +230,7 @@ public class IOUtilsCopyTestCase extends
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_inputStreamToWriter_Encoding_nullEncoding() throws \
Exception {  InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -244,6 +249,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -273,6 +279,7 @@ public class IOUtilsCopyTestCase extends
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream_nullOut() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -284,6 +291,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream_Encoding() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -310,6 +318,7 @@ public class IOUtilsCopyTestCase extends
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream_Encoding_nullOut() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -320,6 +329,7 @@ public class IOUtilsCopyTestCase extends
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream_Encoding_nullEncoding() throws \
Exception {  InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -337,6 +347,7 @@ public class IOUtilsCopyTestCase extends
     }
 
     //-----------------------------------------------------------------------
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -364,6 +375,7 @@ public class IOUtilsCopyTestCase extends
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("resource") // 'in' is deliberately not closed
     public void testCopy_readerToWriter_nullOut() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic