commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1683555 - in /commons/proper/codec/trunk/src/test/java/org/apache/commons/codec: ./ binary/ digest/ net/
Date Thu, 04 Jun 2015 14:22:21 GMT
Author: sebb
Date: Thu Jun  4 14:22:20 2015
New Revision: 1683555

URL: http://svn.apache.org/r1683555
Log:
Reduce deprecation warning noise in test cases

Modified:
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Apr1CryptTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Md5CryptTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha512CryptTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/UnixCryptTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java
    commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/URLCodecTest.java

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java (original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/CharsetsTest.java Thu
Jun  4 14:22:20 2015
@@ -27,6 +27,7 @@ import org.junit.Test;
  *
  * @version $Id: CharEncodingTest.java 1298985 2012-03-09 19:12:49Z ggregory $
  */
+@SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
 public class CharsetsTest {
 
     @Test

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base32Test.java
Thu Jun  4 14:22:20 2015
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
+import java.nio.charset.Charset;
 import java.util.Arrays;
 
 import org.apache.commons.codec.Charsets;
@@ -29,6 +30,9 @@ import org.junit.Test;
 
 public class Base32Test {
 
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
+    private static final Charset CHARSET_UTF8 = Charsets.UTF_8;
+
     private static final String [][] BASE32_TEST_CASES = { // RFC 4648
         {""       ,""},
         {"f"      ,"MY======"},
@@ -74,7 +78,7 @@ public class Base32Test {
     public void testBase32Samples() throws Exception {
         final Base32 codec = new Base32();
         for (final String[] element : BASE32_TEST_CASES) {
-                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
+                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(CHARSET_UTF8)));
         }
     }
 
@@ -82,7 +86,7 @@ public class Base32Test {
     public void testBase32HexSamples() throws Exception {
         final Base32 codec = new Base32(true);
         for (final String[] element : BASE32HEX_TEST_CASES) {
-                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
+                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(CHARSET_UTF8)));
         }
     }
 
@@ -90,7 +94,7 @@ public class Base32Test {
     public void testBase32Chunked () throws Exception {
         final Base32 codec = new Base32(20);
         for (final String[] element : BASE32_TEST_CASES_CHUNKED) {
-                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
+                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(CHARSET_UTF8)));
         }
     }
 
@@ -149,7 +153,7 @@ public class Base32Test {
         final Base32 codec = new Base32((byte)0x25); // '%' <=> 0x25
 
         for (final String[] element : BASE32_PAD_TEST_CASES) {
-                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(Charsets.UTF_8)));
+                assertEquals(element[1], codec.encodeAsString(element[0].getBytes(CHARSET_UTF8)));
         }
     }
 

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Codec13Test.java
Thu Jun  4 14:22:20 2015
@@ -504,6 +504,7 @@ public class Base64Codec13Test {
         }
     }
 
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     private static byte[] utf8(final String s) {
 
         // We would use commons-codec-1.4.jar own utility method for this, but we

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/Base64Test.java
Thu Jun  4 14:22:20 2015
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.math.BigInteger;
+import java.nio.charset.Charset;
 import java.util.Arrays;
 import java.util.Random;
 
@@ -41,6 +42,9 @@ import org.junit.Test;
  */
 public class Base64Test {
 
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
+    private static final Charset CHARSET_UTF8 = Charsets.UTF_8;
+
     private final Random random = new Random();
 
     /**
@@ -147,7 +151,7 @@ public class Base64Test {
         final BigInteger bigInt1 = new BigInteger("85739377120809420210425962799" + "0318636601332086981");
 
         assertEquals(encodedInt1, new String(Base64.encodeInteger(bigInt1)));
-        assertEquals(bigInt1, Base64.decodeInteger(encodedInt1.getBytes(Charsets.UTF_8)));
+        assertEquals(bigInt1, Base64.decodeInteger(encodedInt1.getBytes(CHARSET_UTF8)));
     }
 
     @Test
@@ -156,7 +160,7 @@ public class Base64Test {
         final BigInteger bigInt2 = new BigInteger("13936727572861167254666467268" + "91466679477132949611");
 
         assertEquals(encodedInt2, new String(Base64.encodeInteger(bigInt2)));
-        assertEquals(bigInt2, Base64.decodeInteger(encodedInt2.getBytes(Charsets.UTF_8)));
+        assertEquals(bigInt2, Base64.decodeInteger(encodedInt2.getBytes(CHARSET_UTF8)));
     }
 
     @Test
@@ -167,7 +171,7 @@ public class Base64Test {
             + "4495062430572478766856090958495998158114332651671116876320938126");
 
         assertEquals(encodedInt3, new String(Base64.encodeInteger(bigInt3)));
-        assertEquals(bigInt3, Base64.decodeInteger(encodedInt3.getBytes(Charsets.UTF_8)));
+        assertEquals(bigInt3, Base64.decodeInteger(encodedInt3.getBytes(CHARSET_UTF8)));
     }
 
     @Test
@@ -184,7 +188,7 @@ public class Base64Test {
             + "53542091716518238707344493641683483917");
 
         assertEquals(encodedInt4, new String(Base64.encodeInteger(bigInt4)));
-        assertEquals(bigInt4, Base64.decodeInteger(encodedInt4.getBytes(Charsets.UTF_8)));
+        assertEquals(bigInt4, Base64.decodeInteger(encodedInt4.getBytes(CHARSET_UTF8)));
     }
 
     @Test
@@ -269,7 +273,7 @@ public class Base64Test {
      */
     @Test
     public void testDecodePadMarkerIndex2() {
-        assertEquals("A", new String(Base64.decodeBase64("QQ==".getBytes(Charsets.UTF_8))));
+        assertEquals("A", new String(Base64.decodeBase64("QQ==".getBytes(CHARSET_UTF8))));
     }
 
     /**
@@ -277,30 +281,30 @@ public class Base64Test {
      */
     @Test
     public void testDecodePadMarkerIndex3() {
-        assertEquals("AA", new String(Base64.decodeBase64("QUE=".getBytes(Charsets.UTF_8))));
-        assertEquals("AAA", new String(Base64.decodeBase64("QUFB".getBytes(Charsets.UTF_8))));
+        assertEquals("AA", new String(Base64.decodeBase64("QUE=".getBytes(CHARSET_UTF8))));
+        assertEquals("AAA", new String(Base64.decodeBase64("QUFB".getBytes(CHARSET_UTF8))));
     }
 
     @Test
     public void testDecodePadOnly() {
-        assertEquals(0, Base64.decodeBase64("====".getBytes(Charsets.UTF_8)).length);
-        assertEquals("", new String(Base64.decodeBase64("====".getBytes(Charsets.UTF_8))));
+        assertEquals(0, Base64.decodeBase64("====".getBytes(CHARSET_UTF8)).length);
+        assertEquals("", new String(Base64.decodeBase64("====".getBytes(CHARSET_UTF8))));
         // Test truncated padding
-        assertEquals(0, Base64.decodeBase64("===".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("==".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("=".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("".getBytes(Charsets.UTF_8)).length);
+        assertEquals(0, Base64.decodeBase64("===".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("==".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("=".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("".getBytes(CHARSET_UTF8)).length);
     }
 
     @Test
     public void testDecodePadOnlyChunked() {
-        assertEquals(0, Base64.decodeBase64("====\n".getBytes(Charsets.UTF_8)).length);
-        assertEquals("", new String(Base64.decodeBase64("====\n".getBytes(Charsets.UTF_8))));
+        assertEquals(0, Base64.decodeBase64("====\n".getBytes(CHARSET_UTF8)).length);
+        assertEquals("", new String(Base64.decodeBase64("====\n".getBytes(CHARSET_UTF8))));
         // Test truncated padding
-        assertEquals(0, Base64.decodeBase64("===\n".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("==\n".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("=\n".getBytes(Charsets.UTF_8)).length);
-        assertEquals(0, Base64.decodeBase64("\n".getBytes(Charsets.UTF_8)).length);
+        assertEquals(0, Base64.decodeBase64("===\n".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("==\n".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("=\n".getBytes(CHARSET_UTF8)).length);
+        assertEquals(0, Base64.decodeBase64("\n".getBytes(CHARSET_UTF8)).length);
     }
 
     @Test
@@ -308,7 +312,7 @@ public class Base64Test {
 
         final String orig = "I am a late night coder.";
 
-        final byte[] encodedArray = Base64.encodeBase64(orig.getBytes(Charsets.UTF_8));
+        final byte[] encodedArray = Base64.encodeBase64(orig.getBytes(CHARSET_UTF8));
         final StringBuilder intermediate = new StringBuilder(new String(encodedArray));
 
         intermediate.insert(2, ' ');
@@ -316,7 +320,7 @@ public class Base64Test {
         intermediate.insert(10, '\r');
         intermediate.insert(15, '\n');
 
-        final byte[] encodedWithWS = intermediate.toString().getBytes(Charsets.UTF_8);
+        final byte[] encodedWithWS = intermediate.toString().getBytes(CHARSET_UTF8);
         final byte[] decodedWithWS = Base64.decodeBase64(encodedWithWS);
 
         final String dest = new String(decodedWithWS);
@@ -393,7 +397,7 @@ public class Base64Test {
     @Test
     public void testIgnoringNonBase64InDecode() throws Exception {
         assertEquals("The quick brown fox jumped over the lazy dogs.", new String(Base64
-                .decodeBase64("VGhlIH@$#$@%F1aWN@#@#@@rIGJyb3duIGZve\n\r\t%#%#%#%CBqd##$#$W1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==".getBytes(Charsets.UTF_8))));
+                .decodeBase64("VGhlIH@$#$@%F1aWN@#@#@@rIGJyb3duIGZve\n\r\t%#%#%#%CBqd##$#$W1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==".getBytes(CHARSET_UTF8))));
     }
 
     @Test
@@ -429,37 +433,37 @@ public class Base64Test {
     @Test
     public void testKnownDecodings() {
         assertEquals("The quick brown fox jumped over the lazy dogs.", new String(Base64
-                .decodeBase64("VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==".getBytes(Charsets.UTF_8))));
+                .decodeBase64("VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==".getBytes(CHARSET_UTF8))));
         assertEquals("It was the best of times, it was the worst of times.", new String(Base64
-                .decodeBase64("SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==".getBytes(Charsets.UTF_8))));
+                .decodeBase64("SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==".getBytes(CHARSET_UTF8))));
         assertEquals("http://jakarta.apache.org/commmons", new String(Base64
-                .decodeBase64("aHR0cDovL2pha2FydGEuYXBhY2hlLm9yZy9jb21tbW9ucw==".getBytes(Charsets.UTF_8))));
+                .decodeBase64("aHR0cDovL2pha2FydGEuYXBhY2hlLm9yZy9jb21tbW9ucw==".getBytes(CHARSET_UTF8))));
         assertEquals("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz", new String(Base64
-                .decodeBase64("QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg==".getBytes(Charsets.UTF_8))));
+                .decodeBase64("QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg==".getBytes(CHARSET_UTF8))));
         assertEquals("{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }", new String(Base64.decodeBase64("eyAwLCAxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5IH0="
-                .getBytes(Charsets.UTF_8))));
-        assertEquals("xyzzy!", new String(Base64.decodeBase64("eHl6enkh".getBytes(Charsets.UTF_8))));
+                .getBytes(CHARSET_UTF8))));
+        assertEquals("xyzzy!", new String(Base64.decodeBase64("eHl6enkh".getBytes(CHARSET_UTF8))));
     }
 
     @Test
     public void testKnownEncodings() {
         assertEquals("VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2dzLg==",
new String(Base64
-                .encodeBase64("The quick brown fox jumped over the lazy dogs.".getBytes(Charsets.UTF_8))));
+                .encodeBase64("The quick brown fox jumped over the lazy dogs.".getBytes(CHARSET_UTF8))));
         assertEquals(
                 "YmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJs\r\nYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFo\r\nIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBibGFoIGJsYWggYmxhaCBi\r\nbGFoIGJsYWg=\r\n",
                 new String(
                         Base64
                                 .encodeBase64Chunked("blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah"
-                                        .getBytes(Charsets.UTF_8))));
+                                        .getBytes(CHARSET_UTF8))));
         assertEquals("SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN0IG9mIHRpbWVzLg==",
new String(Base64
-                .encodeBase64("It was the best of times, it was the worst of times.".getBytes(Charsets.UTF_8))));
+                .encodeBase64("It was the best of times, it was the worst of times.".getBytes(CHARSET_UTF8))));
         assertEquals("aHR0cDovL2pha2FydGEuYXBhY2hlLm9yZy9jb21tbW9ucw==", new String(Base64
-                .encodeBase64("http://jakarta.apache.org/commmons".getBytes(Charsets.UTF_8))));
+                .encodeBase64("http://jakarta.apache.org/commmons".getBytes(CHARSET_UTF8))));
         assertEquals("QWFCYkNjRGRFZUZmR2dIaElpSmpLa0xsTW1Obk9vUHBRcVJyU3NUdFV1VnZXd1h4WXlaeg==",
new String(Base64
-                .encodeBase64("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz".getBytes(Charsets.UTF_8))));
+                .encodeBase64("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz".getBytes(CHARSET_UTF8))));
         assertEquals("eyAwLCAxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5IH0=", new String(Base64.encodeBase64("{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }"
-                .getBytes(Charsets.UTF_8))));
-        assertEquals("eHl6enkh", new String(Base64.encodeBase64("xyzzy!".getBytes(Charsets.UTF_8))));
+                .getBytes(CHARSET_UTF8))));
+        assertEquals("eHl6enkh", new String(Base64.encodeBase64("xyzzy!".getBytes(CHARSET_UTF8))));
     }
 
     @Test
@@ -501,7 +505,7 @@ public class Base64Test {
     public void testObjectDecodeWithValidParameter() throws Exception {
 
         final String original = "Hello World!";
-        final Object o = Base64.encodeBase64(original.getBytes(Charsets.UTF_8));
+        final Object o = Base64.encodeBase64(original.getBytes(CHARSET_UTF8));
 
         final Base64 b64 = new Base64();
         final Object oDecoded = b64.decode(o);
@@ -526,7 +530,7 @@ public class Base64Test {
     public void testObjectEncodeWithValidParameter() throws Exception {
 
         final String original = "Hello World!";
-        final Object origObj = original.getBytes(Charsets.UTF_8);
+        final Object origObj = original.getBytes(CHARSET_UTF8);
 
         final Base64 b64 = new Base64();
         final Object oEncoded = b64.encode(origObj);
@@ -539,7 +543,7 @@ public class Base64Test {
     @Test
     public void testObjectEncode() throws Exception {
         final Base64 b64 = new Base64();
-        assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes(Charsets.UTF_8))));
+        assertEquals("SGVsbG8gV29ybGQ=", new String(b64.encode("Hello World".getBytes(CHARSET_UTF8))));
     }
 
     @Test

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
Thu Jun  4 14:22:20 2015
@@ -20,6 +20,8 @@ package org.apache.commons.codec.binary;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import java.nio.charset.Charset;
+
 import org.apache.commons.codec.Charsets;
 import org.apache.commons.codec.DecoderException;
 import org.apache.commons.codec.EncoderException;
@@ -33,6 +35,10 @@ import org.junit.Test;
  * @version $Id$
  */
 public class BinaryCodecTest {
+
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
+    private static final Charset CHARSET_UTF8 = Charsets.UTF_8;
+
     /** mask with bit zero based index 0 raised */
     private static final int BIT_0 = 0x01;
 
@@ -181,7 +187,7 @@ public class BinaryCodecTest {
         if (encodeMe == null) {
             decoded = instance.decode((byte[]) null);
         } else {
-            decoded = (byte[]) instance.decode((Object) encodeMe.getBytes(Charsets.UTF_8));
+            decoded = (byte[]) instance.decode((Object) encodeMe.getBytes(CHARSET_UTF8));
         }
         assertEquals(new String(bits), new String(decoded));
         if (encodeMe == null) {
@@ -199,84 +205,84 @@ public class BinaryCodecTest {
     public void testDecodeByteArray() {
         // With a single raw binary
         byte[] bits = new byte[1];
-        byte[] decoded = instance.decode("00000000".getBytes(Charsets.UTF_8));
+        byte[] decoded = instance.decode("00000000".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0;
-        decoded = instance.decode("00000001".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00000001".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1;
-        decoded = instance.decode("00000011".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00000011".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2;
-        decoded = instance.decode("00000111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00000111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3;
-        decoded = instance.decode("00001111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00001111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4;
-        decoded = instance.decode("00011111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00011111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5;
-        decoded = instance.decode("00111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("00111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6;
-        decoded = instance.decode("01111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("01111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("11111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("11111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         // With a two raw binaries
         bits = new byte[2];
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0000000011111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0000000011111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0000000111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0000000111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0000001111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0000001111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0000011111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0000011111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0000111111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0000111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0001111111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0001111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0011111111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0011111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("0111111111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("0111111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = instance.decode("1111111111111111".getBytes(Charsets.UTF_8));
+        decoded = instance.decode("1111111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
     }
 
@@ -484,84 +490,84 @@ public class BinaryCodecTest {
         assertEquals(0, BinaryCodec.fromAscii(new byte[0]).length);
         // With a single raw binary
         byte[] bits = new byte[1];
-        byte[] decoded = BinaryCodec.fromAscii("00000000".getBytes(Charsets.UTF_8));
+        byte[] decoded = BinaryCodec.fromAscii("00000000".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0;
-        decoded = BinaryCodec.fromAscii("00000001".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00000001".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1;
-        decoded = BinaryCodec.fromAscii("00000011".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00000011".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2;
-        decoded = BinaryCodec.fromAscii("00000111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00000111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3;
-        decoded = BinaryCodec.fromAscii("00001111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00001111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4;
-        decoded = BinaryCodec.fromAscii("00011111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00011111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5;
-        decoded = BinaryCodec.fromAscii("00111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("00111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6;
-        decoded = BinaryCodec.fromAscii("01111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("01111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[1];
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("11111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("11111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         // With a two raw binaries
         bits = new byte[2];
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0000000011111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0000000011111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0000000111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0000000111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0000001111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0000001111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0000011111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0000011111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0000111111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0000111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0001111111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0001111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0011111111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0011111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6;
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("0111111111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("0111111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         bits = new byte[2];
         bits[1] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
         bits[0] = (byte) (BIT_0 | BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
-        decoded = BinaryCodec.fromAscii("1111111111111111".getBytes(Charsets.UTF_8));
+        decoded = BinaryCodec.fromAscii("1111111111111111".getBytes(CHARSET_UTF8));
         assertEquals(new String(bits), new String(decoded));
         assertEquals(0, BinaryCodec.fromAscii((byte[]) null).length);
     }

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/binary/HexTest.java
Thu Jun  4 14:22:20 2015
@@ -432,11 +432,13 @@ public class HexTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testGetCharset() throws UnsupportedEncodingException, DecoderException {
         Assert.assertEquals(Charsets.UTF_8, new Hex(Charsets.UTF_8).getCharset());
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testGetCharsetName() throws UnsupportedEncodingException, DecoderException
{
         Assert.assertEquals(Charsets.UTF_8.name(), new Hex(Charsets.UTF_8).getCharsetName());
     }

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Apr1CryptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Apr1CryptTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Apr1CryptTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Apr1CryptTest.java
Thu Jun  4 14:22:20 2015
@@ -41,6 +41,7 @@ public class Apr1CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testApr1CryptBytes() {
         // random salt
         final byte[] keyBytes = new byte[] { '!', 'b', 'c', '.' };

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Md5CryptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Md5CryptTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Md5CryptTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Md5CryptTest.java
Thu Jun  4 14:22:20 2015
@@ -44,6 +44,7 @@ public class Md5CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testMd5CryptBytes() {
         // An empty Bytearray equals an empty String
         assertEquals("$1$foo$9mS5ExwgIECGE5YKlD5o91", Crypt.crypt(new byte[0], "$1$foo"));

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java
Thu Jun  4 14:22:20 2015
@@ -40,6 +40,7 @@ public class Sha256CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testSha256CryptBytes() {
         // An empty Bytearray equals an empty String
         assertEquals("$5$foo$Fq9CX624QIfnCAmlGiPKLlAasdacKCRxZztPoeo7o0B", Crypt.crypt(new
byte[0], "$5$foo"));
@@ -50,6 +51,7 @@ public class Sha256CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testSha2CryptRounds() {
         // minimum rounds?
         assertEquals("$5$rounds=1000$abcd$b8MCU4GEeZIekOy5ahQ8EWfT330hvYGVeDYkBxXBva.", Sha2Crypt.sha256Crypt("secret".getBytes(Charsets.UTF_8),
"$5$rounds=50$abcd$"));

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha512CryptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha512CryptTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha512CryptTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/Sha512CryptTest.java
Thu Jun  4 14:22:20 2015
@@ -41,6 +41,7 @@ public class Sha512CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testSha512CryptBytes() {
         // An empty Bytearray equals an empty String
         assertEquals("$6$foo$Nywkte7LPWjaJhWjNeGJN.dFdY3pN1wYlGifyRLYOVlGS9EMSiZaDDe/BGSOYQ327q9.32I4UqQ5odsqvsBLX/",
Crypt.crypt(new byte[0], "$6$foo"));
@@ -68,6 +69,7 @@ public class Sha512CryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testSha2CryptRounds() {
         // minimum rounds?
         assertEquals("$5$rounds=1000$abcd$b8MCU4GEeZIekOy5ahQ8EWfT330hvYGVeDYkBxXBva.", Sha2Crypt.sha256Crypt("secret".getBytes(Charsets.UTF_8),
"$5$rounds=50$abcd$"));
@@ -76,6 +78,7 @@ public class Sha512CryptTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testSha2CryptWrongSalt() {
         Sha2Crypt.sha512Crypt("secret".getBytes(Charsets.UTF_8), "xx");
     }

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/UnixCryptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/UnixCryptTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/UnixCryptTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/UnixCryptTest.java
Thu Jun  4 14:22:20 2015
@@ -43,6 +43,7 @@ public class UnixCryptTest {
     }
 
     @Test
+    @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets constants
can be replaced
     public void testUnixCryptBytes() {
         // An empty Bytearray equals an empty String
         assertEquals("12UFlHxel6uMM", Crypt.crypt(new byte[0], "12"));

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/QuotedPrintableCodecTest.java
Thu Jun  4 14:22:20 2015
@@ -151,6 +151,7 @@ public class QuotedPrintableCodecTest {
     public void testEncodeUrlWithNullBitSet() throws Exception {
         final QuotedPrintableCodec qpcodec = new QuotedPrintableCodec();
         final String plain = "1+1 = 2";
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final String encoded = new String(QuotedPrintableCodec.
             encodeQuotedPrintable(null, plain.getBytes(Charsets.UTF_8)));
         assertEquals("Basic quoted-printable encoding test",
@@ -191,6 +192,7 @@ public class QuotedPrintableCodecTest {
         assertEquals("Basic quoted-printable encoding test",
             "1+1 =3D 2", encoded);
 
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final byte[] plainBA = plain.getBytes(Charsets.UTF_8);
         final byte[] encodedBA = (byte[]) qpcodec.encode((Object) plainBA);
         encoded = new String(encodedBA);
@@ -222,6 +224,7 @@ public class QuotedPrintableCodecTest {
         assertEquals("Basic quoted-printable decoding test",
             "1+1 = 2", decoded);
 
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final byte[] plainBA = plain.getBytes(Charsets.UTF_8);
         final byte[] decodedBA = (byte[]) qpcodec.decode((Object) plainBA);
         decoded = new String(decodedBA);

Modified: commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/URLCodecTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/URLCodecTest.java?rev=1683555&r1=1683554&r2=1683555&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/URLCodecTest.java
(original)
+++ commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/net/URLCodecTest.java
Thu Jun  4 14:22:20 2015
@@ -188,6 +188,7 @@ public class URLCodecTest {
     public void testEncodeUrlWithNullBitSet() throws Exception {
         final URLCodec urlCodec = new URLCodec();
         final String plain = "Hello there!";
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final String encoded = new String( URLCodec.encodeUrl(null, plain.getBytes(Charsets.UTF_8)));
         assertEquals("Basic URL encoding test",
             "Hello+there%21", encoded);
@@ -227,6 +228,7 @@ public class URLCodecTest {
         assertEquals("Basic URL encoding test",
             "Hello+there%21", encoded);
 
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final byte[] plainBA = plain.getBytes(Charsets.UTF_8);
         final byte[] encodedBA = (byte[]) urlCodec.encode((Object) plainBA);
         encoded = new String(encodedBA);
@@ -273,6 +275,7 @@ public class URLCodecTest {
         assertEquals("Basic URL decoding test",
             "Hello there!", decoded);
 
+        @SuppressWarnings("deprecation") // TODO remove when Java 7 is minimum and Charsets
constants can be replaced
         final byte[] plainBA = plain.getBytes(Charsets.UTF_8);
         final byte[] decodedBA = (byte[]) urlCodec.decode((Object) plainBA);
         decoded = new String(decodedBA);



Mime
View raw message