You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2015/11/26 04:47:24 UTC

svn commit: r1716559 [3/3] - in /httpcomponents/httpcore/trunk: httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/ httpcore/src/main/java/org/apache/hc/core5/http/ httpcore/src/main/java/org/apache/hc/core5/http/config/ httpcore/src/main/jav...

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedDecoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedDecoder.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedDecoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedDecoder.java Thu Nov 26 03:47:23 2015
@@ -33,9 +33,9 @@ import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
 import java.nio.channels.ReadableByteChannel;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.hc.core5.http.ConnectionClosedException;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.impl.io.HttpTransportMetricsImpl;
 import org.apache.hc.core5.http.nio.SessionInputBuffer;
 import org.junit.After;
@@ -64,9 +64,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testBasicDecoding() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff;", "more stuff"}, Consts.ASCII);
+                new String[] {"stuff;", "more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 16);
@@ -100,9 +100,9 @@ public class TestLengthDelimitedDecoder
         final ReadableByteChannel channel = new ReadableByteChannelMock(
                 new String[] {
                         "stuff;",
-                        "more stuff; and a lot more stuff"}, Consts.ASCII);
+                        "more stuff; and a lot more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 16);
@@ -132,9 +132,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testBasicDecodingSmallBuffer() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff;", "more stuff"}, Consts.ASCII);
+                new String[] {"stuff;", "more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 16);
@@ -185,9 +185,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testDecodingFromSessionBuffer1() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff;", "more stuff"}, Consts.ASCII);
+                new String[] {"stuff;", "more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
 
         inbuf.fill(channel);
@@ -224,9 +224,9 @@ public class TestLengthDelimitedDecoder
         final ReadableByteChannel channel = new ReadableByteChannelMock(
                 new String[] {
                         "stuff;",
-                        "more stuff; and a lot more stuff"}, Consts.ASCII);
+                        "more stuff; and a lot more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
 
         inbuf.fill(channel);
@@ -256,9 +256,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testBasicDecodingFile() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, Consts.ASCII);
+                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 36);
@@ -285,9 +285,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testDecodingFileWithBufferedSessionData() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, Consts.ASCII);
+                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!!!"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 36);
@@ -317,9 +317,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testDecodingFileWithOffsetAndBufferedSessionData() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!"}, Consts.ASCII);
+                new String[] {"stuff; ", "more stuff; ", "a lot more stuff!"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 36);
@@ -327,7 +327,7 @@ public class TestLengthDelimitedDecoder
         final int i = inbuf.fill(channel);
         Assert.assertEquals(7, i);
 
-        final byte[] beginning =  "beginning; ".getBytes(Consts.ASCII);
+        final byte[] beginning =  "beginning; ".getBytes(StandardCharsets.US_ASCII);
 
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
@@ -364,9 +364,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testWriteBeyondFileSize() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"a"}, Consts.ASCII);
+                new String[] {"a"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 1);
@@ -391,9 +391,9 @@ public class TestLengthDelimitedDecoder
         final ReadableByteChannel channel = new ReadableByteChannelMock(
                 new String[] {
                         "stuff;",
-                        "more stuff; and a lot more stuff"}, Consts.ASCII);
+                        "more stuff; and a lot more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 16);
@@ -425,9 +425,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testInvalidConstructor() {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff;", "more stuff"}, Consts.ASCII);
+                new String[] {"stuff;", "more stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         try {
             new LengthDelimitedDecoder(null, null, null, 10);
@@ -459,9 +459,9 @@ public class TestLengthDelimitedDecoder
     public void testInvalidInput() throws Exception {
         final String s = "stuff";
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {s}, Consts.ASCII);
+                new String[] {s}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 3);
@@ -477,9 +477,9 @@ public class TestLengthDelimitedDecoder
     @Test
     public void testZeroLengthDecoding() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"stuff"}, Consts.ASCII);
+                new String[] {"stuff"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 0);
@@ -495,9 +495,9 @@ public class TestLengthDelimitedDecoder
     @Test(expected=ConnectionClosedException.class)
     public void testTruncatedContent() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"1234567890"}, Consts.ASCII);
+                new String[] {"1234567890"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 20);
@@ -512,9 +512,9 @@ public class TestLengthDelimitedDecoder
     @Test(expected=ConnectionClosedException.class)
     public void testTruncatedContentWithFile() throws Exception {
         final ReadableByteChannel channel = new ReadableByteChannelMock(
-                new String[] {"1234567890"}, Consts.ASCII);
+                new String[] {"1234567890"}, StandardCharsets.US_ASCII);
 
-        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, Consts.ASCII);
+        final SessionInputBuffer inbuf = new SessionInputBufferImpl(1024, 256, StandardCharsets.US_ASCII);
         final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl();
         final LengthDelimitedDecoder decoder = new LengthDelimitedDecoder(
                 channel, inbuf, metrics, 20);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java Thu Nov 26 03:47:23 2015
@@ -32,8 +32,8 @@ import java.io.IOException;
 import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.impl.io.HttpTransportMetricsImpl;
 import org.apache.hc.core5.http.nio.SessionOutputBuffer;
 import org.apache.hc.core5.util.CharArrayBuffer;
@@ -73,7 +73,7 @@ public class TestLengthDelimitedEncoder
         encoder.write(CodecTestUtils.wrap("stuff;"));
         encoder.write(CodecTestUtils.wrap("more stuff"));
 
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -91,7 +91,7 @@ public class TestLengthDelimitedEncoder
         encoder.write(CodecTestUtils.wrap("stuff;"));
         encoder.write(CodecTestUtils.wrap("more stuff; and a lot more stuff"));
 
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -114,7 +114,7 @@ public class TestLengthDelimitedEncoder
 
         encoder.write(CodecTestUtils.wrap("more stuff"));
 
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -182,8 +182,8 @@ public class TestLengthDelimitedEncoder
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
         try {
-            testfile.write("stuff;".getBytes(Consts.ASCII));
-            testfile.write("more stuff; and a lot more stuff".getBytes(Consts.ASCII));
+            testfile.write("stuff;".getBytes(StandardCharsets.US_ASCII));
+            testfile.write("more stuff; and a lot more stuff".getBytes(StandardCharsets.US_ASCII));
         } finally {
             testfile.close();
         }
@@ -196,7 +196,7 @@ public class TestLengthDelimitedEncoder
             testfile.close();
         }
 
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -226,7 +226,7 @@ public class TestLengthDelimitedEncoder
             testfile.close();
         }
 
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -245,7 +245,7 @@ public class TestLengthDelimitedEncoder
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
         try {
-            testfile.write("more stuff".getBytes(Consts.ASCII));
+            testfile.write("more stuff".getBytes(StandardCharsets.US_ASCII));
         } finally {
             testfile.close();
         }
@@ -274,8 +274,8 @@ public class TestLengthDelimitedEncoder
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
         try {
-            testfile.write("stuff;".getBytes(Consts.ASCII));
-            testfile.write("more stuff".getBytes(Consts.ASCII));
+            testfile.write("stuff;".getBytes(StandardCharsets.US_ASCII));
+            testfile.write("more stuff".getBytes(StandardCharsets.US_ASCII));
         } finally {
             testfile.close();
         }
@@ -287,7 +287,7 @@ public class TestLengthDelimitedEncoder
         } finally {
             testfile.close();
         }
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("stuff;more stuff", s);
@@ -309,8 +309,8 @@ public class TestLengthDelimitedEncoder
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
         try {
-            testfile.write("stuff;".getBytes(Consts.ASCII));
-            testfile.write("more stuff".getBytes(Consts.ASCII));
+            testfile.write("stuff;".getBytes(StandardCharsets.US_ASCII));
+            testfile.write("more stuff".getBytes(StandardCharsets.US_ASCII));
         } finally {
             testfile.close();
         }
@@ -322,7 +322,7 @@ public class TestLengthDelimitedEncoder
         } finally {
             testfile.close();
         }
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertTrue(encoder.isCompleted());
         Assert.assertEquals("header\r\nstuff;more stuff", s);
@@ -344,7 +344,7 @@ public class TestLengthDelimitedEncoder
         createTempFile();
         RandomAccessFile testfile = new RandomAccessFile(this.tmpfile, "rw");
         try {
-            testfile.write("stuff".getBytes(Consts.ASCII));
+            testfile.write("stuff".getBytes(StandardCharsets.US_ASCII));
         } finally {
             testfile.close();
         }
@@ -357,7 +357,7 @@ public class TestLengthDelimitedEncoder
         } finally {
             testfile.close();
         }
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertFalse(encoder.isCompleted());
         Assert.assertEquals("head", s);
@@ -383,7 +383,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(13, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("header\r\nstuff", s);
     }
@@ -408,7 +408,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("header\r\nstuff", s);
     }
@@ -432,7 +432,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff-more stuff", s);
     }
@@ -456,7 +456,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff-more stuff", s);
     }
@@ -481,7 +481,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(13, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
         Assert.assertEquals("header\r\nstuff", s);
     }
 
@@ -506,7 +506,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(18, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff---more stuff", s);
     }
@@ -532,7 +532,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(18, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff---more stuff", s);
     }
@@ -560,7 +560,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(21, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff------more stuff", s);
     }
@@ -584,7 +584,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(3, outbuf.length());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff-stuff", s);
     }
@@ -608,7 +608,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(0, outbuf.length());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff-much more stuff", s);
     }
@@ -638,7 +638,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(8, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff---", s);
         Assert.assertEquals(3, outbuf.length());
@@ -664,7 +664,7 @@ public class TestLengthDelimitedEncoder
         Assert.assertEquals(8, metrics.getBytesTransferred());
 
         outbuf.flush(channel);
-        final String s = channel.dump(Consts.ASCII);
+        final String s = channel.dump(StandardCharsets.US_ASCII);
 
         Assert.assertEquals("stuff--m", s);
         Assert.assertEquals(0, outbuf.length());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestSessionInOutBuffers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestSessionInOutBuffers.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestSessionInOutBuffers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestSessionInOutBuffers.java Thu Nov 26 03:47:23 2015
@@ -39,10 +39,10 @@ import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CodingErrorAction;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.MessageConstraintException;
 import org.apache.hc.core5.http.config.MessageConstraints;
 import org.apache.hc.core5.http.nio.SessionInputBuffer;
@@ -93,7 +93,7 @@ public class TestSessionInOutBuffers {
 
     private static ReadableByteChannel newChannel(final String s)
             throws UnsupportedEncodingException {
-        return newChannel(s, Consts.ASCII);
+        return newChannel(s, StandardCharsets.US_ASCII);
     }
 
     @Test
@@ -294,7 +294,7 @@ public class TestSessionInOutBuffers {
         }
         final String s1 = buffer.toString();
         buffer.append("\r\n");
-        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(Consts.ASCII)));
+        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(StandardCharsets.US_ASCII)));
 
         buffer.setLength(0);
         for (int i = 0; i < 15; i++) {
@@ -302,7 +302,7 @@ public class TestSessionInOutBuffers {
         }
         final String s2 = buffer.toString();
         buffer.append("\r\n");
-        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(Consts.ASCII)));
+        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(StandardCharsets.US_ASCII)));
 
         buffer.setLength(0);
         for (int i = 0; i < 16; i++) {
@@ -310,7 +310,7 @@ public class TestSessionInOutBuffers {
         }
         final String s3 = buffer.toString();
         buffer.append("\r\n");
-        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(Consts.ASCII)));
+        outbuf.write(ByteBuffer.wrap(buffer.toString().getBytes(StandardCharsets.US_ASCII)));
 
         outbuf.write(ByteBuffer.wrap(new byte[] {'a'}));
 
@@ -379,7 +379,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testReadByteBuffer() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
         final ReadableByteChannel channel = newChannel(pattern);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(4096, 1024, null, this.allocator);
         while (inbuf.fill(channel) > 0) {
@@ -396,7 +396,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testReadByteBufferWithMaxLen() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
         final ReadableByteChannel channel = newChannel(pattern);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(4096, 1024, null, this.allocator);
         while (inbuf.fill(channel) > 0) {
@@ -416,7 +416,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testReadToChannel() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
         final ReadableByteChannel channel = newChannel(pattern);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(4096, 1024, null, this.allocator);
         while (inbuf.fill(channel) > 0) {
@@ -431,7 +431,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testReadToChannelWithMaxLen() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
         final ReadableByteChannel channel = newChannel(pattern);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(4096, 1024, null, this.allocator);
         while (inbuf.fill(channel) > 0) {
@@ -448,7 +448,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testWriteByteBuffer() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
 
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(4096, 1024, null, this.allocator);
         final ReadableByteChannel src = newChannel(pattern);
@@ -463,7 +463,7 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testWriteFromChannel() throws Exception {
-        final byte[] pattern = "0123456789ABCDEF0123456789ABCDEF".getBytes(Consts.ASCII);
+        final byte[] pattern = "0123456789ABCDEF0123456789ABCDEF".getBytes(StandardCharsets.US_ASCII);
 
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(4096, 1024, null, this.allocator);
         outbuf.write(ByteBuffer.wrap(pattern, 0, 16));
@@ -503,7 +503,7 @@ public class TestSessionInOutBuffers {
         final String s3 = "Like hello and stuff";
 
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16,
-                Consts.UTF_8.newEncoder(), this.allocator);
+                StandardCharsets.UTF_8.newEncoder(), this.allocator);
 
         final CharArrayBuffer chbuffer = new CharArrayBuffer(32);
         for (int i = 0; i < 10; i++) {
@@ -526,7 +526,7 @@ public class TestSessionInOutBuffers {
 
         final ReadableByteChannel channel = newChannel(tmp);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16,
-                Consts.UTF_8.newDecoder(), this.allocator);
+                StandardCharsets.UTF_8.newDecoder(), this.allocator);
 
         while (inbuf.fill(channel) > 0) {
         }
@@ -556,9 +556,9 @@ public class TestSessionInOutBuffers {
     @Test(expected=CharacterCodingException.class)
     public void testMalformedInputActionReport() throws Exception {
         final String s = constructString(SWISS_GERMAN_HELLO);
-        final byte[] tmp = s.getBytes(Consts.ISO_8859_1);
+        final byte[] tmp = s.getBytes(StandardCharsets.ISO_8859_1);
 
-        final CharsetDecoder decoder = Consts.UTF_8.newDecoder();
+        final CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder();
         decoder.onMalformedInput(CodingErrorAction.REPORT);
         decoder.onUnmappableCharacter(CodingErrorAction.IGNORE);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16, decoder, this.allocator);
@@ -572,9 +572,9 @@ public class TestSessionInOutBuffers {
     @Test
     public void testMalformedInputActionIgnore() throws Exception {
         final String s = constructString(SWISS_GERMAN_HELLO);
-        final byte[] tmp = s.getBytes(Consts.ISO_8859_1);
+        final byte[] tmp = s.getBytes(StandardCharsets.ISO_8859_1);
 
-        final CharsetDecoder decoder = Consts.UTF_8.newDecoder();
+        final CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder();
         decoder.onMalformedInput(CodingErrorAction.IGNORE);
         decoder.onUnmappableCharacter(CodingErrorAction.IGNORE);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16, decoder, this.allocator);
@@ -589,9 +589,9 @@ public class TestSessionInOutBuffers {
     @Test
     public void testMalformedInputActionReplace() throws Exception {
         final String s = constructString(SWISS_GERMAN_HELLO);
-        final byte[] tmp = s.getBytes(Consts.ISO_8859_1);
+        final byte[] tmp = s.getBytes(StandardCharsets.ISO_8859_1);
 
-        final CharsetDecoder decoder = Consts.UTF_8.newDecoder();
+        final CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder();
         decoder.onMalformedInput(CodingErrorAction.REPLACE);
         decoder.onUnmappableCharacter(CodingErrorAction.IGNORE);
         final SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16, decoder, this.allocator);
@@ -606,7 +606,7 @@ public class TestSessionInOutBuffers {
     @Test(expected=CharacterCodingException.class)
     public void testUnmappableInputActionReport() throws Exception {
         final String s = "This text contains a circumflex \u0302!!!";
-        final CharsetEncoder encoder = Consts.ISO_8859_1.newEncoder();
+        final CharsetEncoder encoder = StandardCharsets.ISO_8859_1.newEncoder();
         encoder.onMalformedInput(CodingErrorAction.IGNORE);
         encoder.onUnmappableCharacter(CodingErrorAction.REPORT);
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, encoder, this.allocator);
@@ -618,7 +618,7 @@ public class TestSessionInOutBuffers {
     @Test
     public void testUnmappableInputActionIgnore() throws Exception {
         final String s = "This text contains a circumflex \u0302!!!";
-        final CharsetEncoder encoder = Consts.ISO_8859_1.newEncoder();
+        final CharsetEncoder encoder = StandardCharsets.ISO_8859_1.newEncoder();
         encoder.onMalformedInput(CodingErrorAction.IGNORE);
         encoder.onUnmappableCharacter(CodingErrorAction.IGNORE);
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, encoder, this.allocator);
@@ -636,7 +636,7 @@ public class TestSessionInOutBuffers {
     @Test
     public void testUnmappableInputActionReplace() throws Exception {
         final String s = "This text contains a circumflex \u0302 !!!";
-        final CharsetEncoder encoder = Consts.ISO_8859_1.newEncoder();
+        final CharsetEncoder encoder = StandardCharsets.ISO_8859_1.newEncoder();
         encoder.onMalformedInput(CodingErrorAction.IGNORE);
         encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
         final SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, encoder, this.allocator);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java Thu Nov 26 03:47:23 2015
@@ -29,10 +29,10 @@ package org.apache.hc.core5.http.integra
 
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
@@ -89,7 +89,7 @@ public class TestClientOutOfSequenceResp
             socket.getOutputStream().write((
                     "HTTP/1.1 200 OK\r\n" +
                     "Content-Length: 0\r\n" +
-                    "Connection: keep-alive\r\n\r\n").getBytes(Consts.UTF_8));
+                    "Connection: keep-alive\r\n\r\n").getBytes(StandardCharsets.UTF_8));
             socket.getOutputStream().flush();
         }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java Thu Nov 26 03:47:23 2015
@@ -29,6 +29,7 @@ package org.apache.hc.core5.http.integra
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Queue;
@@ -36,7 +37,6 @@ import java.util.concurrent.ConcurrentLi
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
@@ -919,7 +919,7 @@ public class TestHttpAsyncHandlers exten
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
                 response.setStatusCode(HttpStatus.SC_OK);
-                response.setEntity(new NStringEntity("All is well", Consts.ASCII));
+                response.setEntity(new NStringEntity("All is well", StandardCharsets.US_ASCII));
             }
 
         }));

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncPrematureTermination.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncPrematureTermination.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncPrematureTermination.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncPrematureTermination.java Thu Nov 26 03:47:23 2015
@@ -30,11 +30,11 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.hc.core5.concurrent.FutureCallback;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpConnection;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHost;
@@ -145,7 +145,7 @@ public class TestHttpAsyncPrematureTermi
     public void testConnectionTerminatedHandlingRequest() throws Exception {
         final CountDownLatch responseStreamClosed = new CountDownLatch(1);
         final InputStream testInputStream = new ByteArrayInputStream(
-                "all is well".getBytes(Consts.ASCII)) {
+                "all is well".getBytes(StandardCharsets.US_ASCII)) {
             @Override
             public void close() throws IOException {
                 responseStreamClosed.countDown();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java Thu Nov 26 03:47:23 2015
@@ -33,11 +33,11 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpConnectionMetrics;
 import org.apache.hc.core5.http.HttpEntity;
@@ -693,7 +693,7 @@ public class TestSyncHttp {
                         final ContentType contentType = ContentType.getOrDefault(incoming);
                         Charset charset = contentType.getCharset();
                         if (charset == null) {
-                            charset = Consts.ISO_8859_1;
+                            charset = StandardCharsets.ISO_8859_1;
                         }
                         final RepeatingEntity outgoing = new RepeatingEntity(line, charset, n);
                         outgoing.setChunked(n % 2 == 0);
@@ -730,7 +730,7 @@ public class TestSyncHttp {
                     final ContentType contentType = ContentType.getOrDefault(incoming);
                     Charset charset = contentType.getCharset();
                     if (charset == null) {
-                        charset = Consts.ISO_8859_1;
+                        charset = StandardCharsets.ISO_8859_1;
                     }
                     Assert.assertNotNull(instream);
                     final BufferedReader reader = new BufferedReader(new InputStreamReader(instream, charset));
@@ -962,7 +962,7 @@ public class TestSyncHttp {
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setEntity(new StringEntity("All is well", Consts.ASCII));
+                response.setEntity(new StringEntity("All is well", StandardCharsets.US_ASCII));
             }
 
         });

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java Thu Nov 26 03:47:23 2015
@@ -31,10 +31,10 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.nio.channels.WritableByteChannel;
+import java.nio.charset.StandardCharsets;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.ContentLengthStrategy;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpHost;
@@ -263,7 +263,7 @@ public class TestTruncatedChunks extends
         final HttpResponse response = future.get();
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
-        Assert.assertEquals(new String(GARBAGE, Consts.ISO_8859_1.name()),
+        Assert.assertEquals(new String(GARBAGE, StandardCharsets.ISO_8859_1.name()),
                 EntityUtils.toString(response.getEntity()));
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java Thu Nov 26 03:47:23 2015
@@ -29,8 +29,8 @@ package org.apache.hc.core5.http.protoco
 
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HeaderElements;
 import org.apache.hc.core5.http.HttpConnection;
@@ -138,7 +138,7 @@ public class TestStandardInterceptors {
         final HttpContext context = new BasicHttpContext(null);
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         request.setEntity(entity);
 
         final RequestContent interceptor = new RequestContent();
@@ -154,7 +154,7 @@ public class TestStandardInterceptors {
         final HttpContext context = new BasicHttpContext(null);
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         entity.setChunked(true);
         request.setEntity(entity);
 
@@ -188,7 +188,7 @@ public class TestStandardInterceptors {
         final HttpContext context = new BasicHttpContext(null);
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/", HttpVersion.HTTP_1_0);
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         entity.setChunked(true);
         request.setEntity(entity);
 
@@ -305,7 +305,7 @@ public class TestStandardInterceptors {
         final HttpContext context = new BasicHttpContext(null);
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         request.setEntity(new HttpEntityWithTrailers(entity,
                 new BasicHeader("h1", "this"), new BasicHeader("h1", "that"), new BasicHeader("h2", "this and that")));
 
@@ -323,7 +323,7 @@ public class TestStandardInterceptors {
         final HttpCoreContext context = HttpCoreContext.create();
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         request.setEntity(entity);
         final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
@@ -337,7 +337,7 @@ public class TestStandardInterceptors {
         final HttpCoreContext context = HttpCoreContext.create();
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/", HttpVersion.HTTP_1_0);
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         request.setEntity(entity);
         final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
@@ -350,7 +350,7 @@ public class TestStandardInterceptors {
         final HttpCoreContext context = HttpCoreContext.create();
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
         final String s = "";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         request.setEntity(entity);
         final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
@@ -922,7 +922,7 @@ public class TestStandardInterceptors {
         final HttpContext context = new BasicHttpContext(null);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         final String s = "whatever";
-        final StringEntity entity = new StringEntity(s, Consts.ASCII);
+        final StringEntity entity = new StringEntity(s, StandardCharsets.US_ASCII);
         response.setEntity(new HttpEntityWithTrailers(entity,
                 new BasicHeader("h1", "this"), new BasicHeader("h1", "that"), new BasicHeader("h2", "this and that")));
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestTrailerNameFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestTrailerNameFormatter.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestTrailerNameFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestTrailerNameFormatter.java Thu Nov 26 03:47:23 2015
@@ -27,7 +27,8 @@
 
 package org.apache.hc.core5.http.protocol;
 
-import org.apache.hc.core5.http.Consts;
+import java.nio.charset.StandardCharsets;
+
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.entity.HttpEntityWithTrailers;
@@ -41,7 +42,7 @@ public class TestTrailerNameFormatter {
     @Test
     public void testTrailerFormatting() throws Exception {
         final HttpEntity entity = new HttpEntityWithTrailers(
-                new StringEntity("some stuff with trailers", Consts.ASCII),
+                new StringEntity("some stuff with trailers", StandardCharsets.US_ASCII),
                 new BasicHeader("z", "this"), new BasicHeader("b", "that"), new BasicHeader("a", "this and that"));
         final Header header = TrailerNameFormatter.format(entity);
         Assert.assertNotNull(header);
@@ -51,7 +52,7 @@ public class TestTrailerNameFormatter {
     @Test
     public void testTrailerFormattingSameName() throws Exception {
         final HttpEntity entity = new HttpEntityWithTrailers(
-                new StringEntity("some stuff with trailers", Consts.ASCII),
+                new StringEntity("some stuff with trailers", StandardCharsets.US_ASCII),
                 new BasicHeader("a", "this"), new BasicHeader("a", "that"), new BasicHeader("a", "this and that"));
         final Header header = TrailerNameFormatter.format(entity);
         Assert.assertNotNull(header);
@@ -61,14 +62,14 @@ public class TestTrailerNameFormatter {
     @Test
     public void testTrailerNoTrailers() throws Exception {
         final HttpEntity entity = new HttpEntityWithTrailers(
-                new StringEntity("some stuff and no trailers", Consts.ASCII));
+                new StringEntity("some stuff and no trailers", StandardCharsets.US_ASCII));
         final Header header = TrailerNameFormatter.format(entity);
         Assert.assertNull(header);
     }
 
     @Test
     public void testTrailerNullTrailers() throws Exception {
-        final HttpEntity entity = new StringEntity("some stuff and no trailers", Consts.ASCII);
+        final HttpEntity entity = new StringEntity("some stuff and no trailers", StandardCharsets.US_ASCII);
         final Header header = TrailerNameFormatter.format(entity);
         Assert.assertNull(header);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestByteArrayBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestByteArrayBuffer.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestByteArrayBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestByteArrayBuffer.java Thu Nov 26 03:47:23 2015
@@ -31,8 +31,8 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -200,7 +200,7 @@ public class TestByteArrayBuffer {
     public void testIndexOf() throws Exception {
         final byte COLON = (byte) ':';
         final byte COMMA = (byte) ',';
-        final byte[] bytes = "name1: value1; name2: value2".getBytes(Consts.ASCII);
+        final byte[] bytes = "name1: value1; name2: value2".getBytes(StandardCharsets.US_ASCII);
         final int index1 = 5;
         final int index2 = 20;
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestCharArrayBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestCharArrayBuffer.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestCharArrayBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestCharArrayBuffer.java Thu Nov 26 03:47:23 2015
@@ -31,8 +31,8 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -297,8 +297,8 @@ public class TestCharArrayBuffer {
     public void testAppendAsciiByteArray() throws Exception {
         final String s1 = "stuff";
         final String s2 = " and more stuff";
-        final byte[] b1 = s1.getBytes(Consts.ASCII);
-        final byte[] b2 = s2.getBytes(Consts.ASCII);
+        final byte[] b1 = s1.getBytes(StandardCharsets.US_ASCII);
+        final byte[] b2 = s2.getBytes(StandardCharsets.US_ASCII);
 
         final CharArrayBuffer buffer = new CharArrayBuffer(8);
         buffer.append(b1, 0, b1.length);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestEntityUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestEntityUtils.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestEntityUtils.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestEntityUtils.java Thu Nov 26 03:47:23 2015
@@ -30,8 +30,8 @@ package org.apache.hc.core5.util;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.entity.BasicHttpEntity;
 import org.apache.hc.core5.http.entity.EntityUtils;
 import org.junit.Assert;
@@ -62,7 +62,7 @@ public class TestEntityUtils {
 
     @Test
     public void testMaxIntContentToByteArray() throws Exception {
-        final byte[] content = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] content = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(content));
         httpentity.setContentLength(Integer.MAX_VALUE + 100L);
@@ -76,7 +76,7 @@ public class TestEntityUtils {
 
     @Test
     public void testUnknownLengthContentToByteArray() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentLength(-1L);
@@ -90,7 +90,7 @@ public class TestEntityUtils {
 
     @Test
     public void testKnownLengthContentToByteArray() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentLength(bytes.length);
@@ -121,7 +121,7 @@ public class TestEntityUtils {
 
     @Test
     public void testMaxIntContentToString() throws Exception {
-        final byte[] content = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] content = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(content));
         httpentity.setContentLength(Integer.MAX_VALUE + 100L);
@@ -135,7 +135,7 @@ public class TestEntityUtils {
 
     @Test
     public void testUnknownLengthContentToString() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentLength(-1L);
@@ -145,7 +145,7 @@ public class TestEntityUtils {
 
     @Test
     public void testKnownLengthContentToString() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentLength(bytes.length);
@@ -175,7 +175,7 @@ public class TestEntityUtils {
     @Test
     public void testNoCharsetContentToString() throws Exception {
         final String content = constructString(SWISS_GERMAN_HELLO);
-        final byte[] bytes = content.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = content.getBytes(StandardCharsets.ISO_8859_1);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentType("text/plain");
@@ -197,7 +197,7 @@ public class TestEntityUtils {
     @Test
     public void testContentWithContentTypeToString() throws Exception {
         final String content = constructString(RUSSIAN_HELLO);
-        final byte[] bytes = content.getBytes(Consts.UTF_8);
+        final byte[] bytes = content.getBytes(StandardCharsets.UTF_8);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(new ByteArrayInputStream(bytes));
         httpentity.setContentType("text/plain; charset=UTF-8");