Suppress deprecation warnings for code that tests the deprecated methods

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1470207 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
index d0d9b01..950bd1f 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
@@ -156,7 +156,7 @@
     }
 
     //-----------------------------------------------------------------------
-    @SuppressWarnings("resource") // 'in' is deliberately not closed
+    @SuppressWarnings({ "resource", "deprecation" }) // 'in' is deliberately not closed
     public void testCopy_inputStreamToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -165,7 +165,7 @@
         final YellOnFlushAndCloseOutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
         final Writer writer = new OutputStreamWriter(baout, "US-ASCII");
         
-        IOUtils.copy(in, writer);
+        IOUtils.copy(in, writer); // deliberately testing deprecated method
         out.off();
         writer.flush();
 
@@ -174,6 +174,7 @@
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testCopy_inputStreamToWriter_nullIn() throws Exception {
         final ByteArrayOutputStream baout = new ByteArrayOutputStream();
         final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
@@ -184,10 +185,11 @@
         } catch (final NullPointerException ex) {}
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testCopy_inputStreamToWriter_nullOut() throws Exception {
         final InputStream in = new ByteArrayInputStream(inData);
         try {
-            IOUtils.copy(in, (Writer) null);
+            IOUtils.copy(in, (Writer) null); // deliberately testing deprecated method
             fail();
         } catch (final NullPointerException ex) {}
     }
@@ -249,7 +251,7 @@
     }
 
     //-----------------------------------------------------------------------
-    @SuppressWarnings("resource") // 'in' is deliberately not closed
+    @SuppressWarnings({ "resource", "deprecation" }) // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
@@ -258,7 +260,7 @@
         final ByteArrayOutputStream baout = new ByteArrayOutputStream();
         final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
         
-        IOUtils.copy(reader, out);
+        IOUtils.copy(reader, out); // deliberately testing deprecated method
         //Note: this method *does* flush. It is equivalent to:
         //  OutputStreamWriter _out = new OutputStreamWriter(fout);
         //  IOUtils.copy( fin, _out, 4096 ); // copy( Reader, Writer, int );
@@ -270,7 +272,8 @@
         assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray()));
     }
 
-    public void testCopy_readerToOutputStream_nullIn() throws Exception {
+    @SuppressWarnings("deprecation")
+    public void testCopy_readerToOutputStream_nullIn() throws Exception { // deliberately testing deprecated method
         final ByteArrayOutputStream baout = new ByteArrayOutputStream();
         final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, true, true);
         try {
@@ -279,13 +282,13 @@
         } catch (final NullPointerException ex) {}
     }
 
-    @SuppressWarnings("resource") // 'in' is deliberately not closed
+    @SuppressWarnings({ "resource", "deprecation" }) // 'in' is deliberately not closed
     public void testCopy_readerToOutputStream_nullOut() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
         final Reader reader = new InputStreamReader(in, "US-ASCII");
         try {
-            IOUtils.copy(reader, (OutputStream) null);
+            IOUtils.copy(reader, (OutputStream) null); // deliberately testing deprecated method
             fail();
         } catch (final NullPointerException ex) {}
     }
diff --git a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
index b726dc9..4abbf3f 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
@@ -705,6 +705,7 @@
         IOUtils.closeQuietly(reader);
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testReadLines_InputStream() throws Exception {
         final File file = newFile("lines.txt");
         InputStream in = null;
@@ -986,6 +987,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testToByteArray_Reader() throws IOException {
         final String charsetName = "UTF-8";
         final byte[] expecteds = charsetName.getBytes(charsetName);
@@ -1033,6 +1035,7 @@
         Assert.assertEquals(FILE_SIZE, actual.length);
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testToCharArray_InputStream() throws Exception {
         final FileInputStream fin = new FileInputStream(m_testFile);
         try {
@@ -1079,9 +1082,11 @@
      * @throws Exception
      *             on error
      */
+    @SuppressWarnings("javadoc") // deliberately testing deprecated method
     public void testToInputStream_CharSequence() throws Exception {
         final CharSequence csq = new StringBuilder("Abc123Xyz!");
-        InputStream inStream = IOUtils.toInputStream(csq);
+        @SuppressWarnings("deprecation")
+        InputStream inStream = IOUtils.toInputStream(csq); // deliberately testing deprecated method
         byte[] bytes = IOUtils.toByteArray(inStream);
         assertEqualContent(csq.toString().getBytes(), bytes);
         inStream = IOUtils.toInputStream(csq, (String) null);
@@ -1102,8 +1107,10 @@
      * @throws Exception
      *             on error
      */
+    @SuppressWarnings("javadoc") // deliberately testing deprecated method
     public void testToInputStream_String() throws Exception {
         final String str = "Abc123Xyz!";
+        @SuppressWarnings("deprecation") // deliberately testing deprecated method
         InputStream inStream = IOUtils.toInputStream(str);
         byte[] bytes = IOUtils.toByteArray(inStream);
         assertEqualContent(str.getBytes(), bytes);
@@ -1129,6 +1136,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testToString_InputStream() throws Exception {
         final FileInputStream fin = new FileInputStream(m_testFile);
         try {
@@ -1152,6 +1160,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testToString_URI() throws Exception {
         final URI url = m_testFile.toURI();
         final String out = IOUtils.toString(url);
@@ -1174,6 +1183,7 @@
         testToString_URI(null);
     }
 
+    @SuppressWarnings("deprecation") // deliberately testing deprecated method
     public void testToString_URL() throws Exception {
         final URL url = m_testFile.toURI().toURL();
         final String out = IOUtils.toString(url);
diff --git a/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java b/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
index 9e868f0..bca6a47 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsWriteTestCase.java
@@ -32,6 +32,7 @@
  * @version $Id$
  * @see IOUtils
  */
+@SuppressWarnings("deprecation") // includes tests for deprecated methods
 public class IOUtilsWriteTestCase extends FileBasedTestCase {
 
     private static final int FILE_SIZE = 1024 * 4 + 1;
diff --git a/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java b/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java
index 09d5823..d4050c8 100644
--- a/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/ReaderInputStreamTest.java
@@ -105,6 +105,7 @@
         testWithSingleByteRead(TEST_STRING, "UTF-16");
     }
     
+    @SuppressWarnings("deprecation")
     @Test
     public void testReadZero() throws Exception {
         final String inStr = "test";
@@ -117,6 +118,7 @@
         r.close();
     }
     
+    @SuppressWarnings("deprecation")
     @Test
     public void testReadZeroEmptyString() throws Exception {
         final ReaderInputStream r = new ReaderInputStream(new StringReader(""));