hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1716559 [1/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...
Date Thu, 26 Nov 2015 03:47:24 GMT
Author: ggregory
Date: Thu Nov 26 03:47:23 2015
New Revision: 1716559

URL: http://svn.apache.org/viewvc?rev=1716559&view=rev
Log:
Reuse Java 7's StandardCharsets.

Modified:
    httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/BenchmarkWorker.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/Consts.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/config/ConnectionConfig.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/ContentType.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/EntityUtils.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/StringEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/nio/entity/NStringEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBasicHttpEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBufferedHttpEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteArrayEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteBufferEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestContentType.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestHttpEntityWrapper.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestInputStreamEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestStringEntity.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestChunkCoding.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestContentLengthInputStream.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestMessageParser.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestSessionInOutBuffers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/CodecTestUtils.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestBuffers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkDecoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestChunkEncoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpMessageParser.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityDecoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestIdentityEncoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedDecoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestLengthDelimitedEncoder.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestSessionInOutBuffers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncPrematureTermination.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestStandardInterceptors.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/protocol/TestTrailerNameFormatter.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestByteArrayBuffer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestCharArrayBuffer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/util/TestEntityUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/BenchmarkWorker.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/BenchmarkWorker.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/hc/core5/http/benchmark/BenchmarkWorker.java Thu Nov 26 03:47:23 2015
@@ -31,12 +31,12 @@ import java.io.InputStream;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.Iterator;
 
 import javax.net.SocketFactory;
 
 import org.apache.hc.core5.http.ConnectionReuseStrategy;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpException;
@@ -172,7 +172,7 @@ class BenchmarkWorker implements Runnabl
                     final ContentType ct = ContentType.getOrDefault(entity);
                     Charset charset = ct.getCharset();
                     if (charset == null) {
-                        charset = Consts.ISO_8859_1;
+                        charset = StandardCharsets.ISO_8859_1;
                     }
                     long contentlen = 0;
                     final InputStream instream = entity.getContent();

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/Consts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/Consts.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/Consts.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/Consts.java Thu Nov 26 03:47:23 2015
@@ -27,13 +27,13 @@
 
 package org.apache.hc.core5.http;
 
-import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 
 /**
  * Commons constants.
  *
  * @since 4.2
+ * @since 5.0 Removed Charset constants, reuse Java 7's {@link StandardCharsets} class instead.
  */
 public final class Consts {
 
@@ -42,10 +42,6 @@ public final class Consts {
     public static final int SP = 32; // <US-ASCII SP, space (32)>
     public static final int HT = 9;  // <US-ASCII HT, horizontal-tab (9)>
 
-    public static final Charset UTF_8 = StandardCharsets.UTF_8;
-    public static final Charset ASCII = StandardCharsets.US_ASCII;
-    public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;
-
     private Consts() {
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/config/ConnectionConfig.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/config/ConnectionConfig.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/config/ConnectionConfig.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/config/ConnectionConfig.java Thu Nov 26 03:47:23 2015
@@ -29,9 +29,9 @@ package org.apache.hc.core5.http.config;
 
 import java.nio.charset.Charset;
 import java.nio.charset.CodingErrorAction;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.hc.core5.annotation.Immutable;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.util.Args;
 
 /**
@@ -148,7 +148,7 @@ public class ConnectionConfig {
         public Builder setMalformedInputAction(final CodingErrorAction malformedInputAction) {
             this.malformedInputAction = malformedInputAction;
             if (malformedInputAction != null && this.charset == null) {
-                this.charset = Consts.ASCII;
+                this.charset = StandardCharsets.US_ASCII;
             }
             return this;
         }
@@ -156,7 +156,7 @@ public class ConnectionConfig {
         public Builder setUnmappableInputAction(final CodingErrorAction unmappableInputAction) {
             this.unmappableInputAction = unmappableInputAction;
             if (unmappableInputAction != null && this.charset == null) {
-                this.charset = Consts.ASCII;
+                this.charset = StandardCharsets.US_ASCII;
             }
             return this;
         }
@@ -169,7 +169,7 @@ public class ConnectionConfig {
         public ConnectionConfig build() {
             Charset cs = charset;
             if (cs == null && (malformedInputAction != null || unmappableInputAction != null)) {
-                cs = Consts.ASCII;
+                cs = StandardCharsets.US_ASCII;
             }
             final int bufSize = this.bufferSize > 0 ? this.bufferSize : 8 * 1024;
             final int fragmentHintSize  = this.fragmentSizeHint >= 0 ? this.fragmentSizeHint : bufSize;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/ContentType.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/ContentType.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/ContentType.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/ContentType.java Thu Nov 26 03:47:23 2015
@@ -29,6 +29,7 @@ package org.apache.hc.core5.http.entity;
 
 import java.io.Serializable;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.nio.charset.UnsupportedCharsetException;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -37,7 +38,6 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.apache.hc.core5.annotation.Immutable;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HeaderElement;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.NameValuePair;
@@ -65,27 +65,27 @@ public final class ContentType implement
 
     // constants
     public static final ContentType APPLICATION_ATOM_XML = create(
-            "application/atom+xml", Consts.ISO_8859_1);
+            "application/atom+xml", StandardCharsets.ISO_8859_1);
     public static final ContentType APPLICATION_FORM_URLENCODED = create(
-            "application/x-www-form-urlencoded", Consts.ISO_8859_1);
+            "application/x-www-form-urlencoded", StandardCharsets.ISO_8859_1);
     public static final ContentType APPLICATION_JSON = create(
-            "application/json", Consts.UTF_8);
+            "application/json", StandardCharsets.UTF_8);
     public static final ContentType APPLICATION_OCTET_STREAM = create(
             "application/octet-stream", (Charset) null);
     public static final ContentType APPLICATION_SVG_XML = create(
-            "application/svg+xml", Consts.ISO_8859_1);
+            "application/svg+xml", StandardCharsets.ISO_8859_1);
     public static final ContentType APPLICATION_XHTML_XML = create(
-            "application/xhtml+xml", Consts.ISO_8859_1);
+            "application/xhtml+xml", StandardCharsets.ISO_8859_1);
     public static final ContentType APPLICATION_XML = create(
-            "application/xml", Consts.ISO_8859_1);
+            "application/xml", StandardCharsets.ISO_8859_1);
     public static final ContentType MULTIPART_FORM_DATA = create(
-            "multipart/form-data", Consts.ISO_8859_1);
+            "multipart/form-data", StandardCharsets.ISO_8859_1);
     public static final ContentType TEXT_HTML = create(
-            "text/html", Consts.ISO_8859_1);
+            "text/html", StandardCharsets.ISO_8859_1);
     public static final ContentType TEXT_PLAIN = create(
-            "text/plain", Consts.ISO_8859_1);
+            "text/plain", StandardCharsets.ISO_8859_1);
     public static final ContentType TEXT_XML = create(
-            "text/xml", Consts.ISO_8859_1);
+            "text/xml", StandardCharsets.ISO_8859_1);
     public static final ContentType WILDCARD = create(
             "*/*", (Charset) null);
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/EntityUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/EntityUtils.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/EntityUtils.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/EntityUtils.java Thu Nov 26 03:47:23 2015
@@ -33,9 +33,9 @@ import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.nio.charset.UnsupportedCharsetException;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.ParseException;
@@ -187,7 +187,7 @@ public final class EntityUtils {
                 charset = defaultCharset;
             }
             if (charset == null) {
-                charset = Consts.ISO_8859_1;
+                charset = StandardCharsets.ISO_8859_1;
             }
             final Reader reader = new InputStreamReader(instream, charset);
             final CharArrayBuffer buffer = new CharArrayBuffer(i);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/StringEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/StringEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/StringEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/entity/StringEntity.java Thu Nov 26 03:47:23 2015
@@ -32,9 +32,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.hc.core5.annotation.NotThreadSafe;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.util.Args;
 
 /**
@@ -64,7 +64,7 @@ public class StringEntity extends Abstra
         Args.notNull(string, "Source string");
         Charset charset = contentType != null ? contentType.getCharset() : null;
         if (charset == null) {
-            charset = Consts.ISO_8859_1;
+            charset = StandardCharsets.ISO_8859_1;
         }
         this.content = string.getBytes(charset);
         if (contentType != null) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/nio/entity/NStringEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/nio/entity/NStringEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/nio/entity/NStringEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/nio/entity/NStringEntity.java Thu Nov 26 03:47:23 2015
@@ -34,9 +34,9 @@ import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.hc.core5.annotation.NotThreadSafe;
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.entity.AbstractHttpEntity;
 import org.apache.hc.core5.http.entity.ContentType;
 import org.apache.hc.core5.http.nio.ContentEncoder;
@@ -71,7 +71,7 @@ public class NStringEntity extends Abstr
         Args.notNull(s, "Source string");
         Charset charset = contentType != null ? contentType.getCharset() : null;
         if (charset == null) {
-            charset = Consts.ISO_8859_1;
+            charset = StandardCharsets.ISO_8859_1;
         }
         this.b = s.getBytes(charset);
         this.buf = ByteBuffer.wrap(this.b);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBasicHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBasicHttpEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBasicHttpEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBasicHttpEntity.java Thu Nov 26 03:47:23 2015
@@ -30,8 +30,8 @@ package org.apache.hc.core5.http.entity;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +44,7 @@ public class TestBasicHttpEntity {
     @Test
     public void testBasics() throws Exception {
 
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final InputStream content = new ByteArrayInputStream(bytes);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(content);
@@ -68,7 +68,7 @@ public class TestBasicHttpEntity {
 
     @Test
     public void testContent() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final InputStream content = new ByteArrayInputStream(bytes);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         try {
@@ -91,7 +91,7 @@ public class TestBasicHttpEntity {
 
     @Test
     public void testWriteTo() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final InputStream content = new ByteArrayInputStream(bytes);
         final BasicHttpEntity httpentity = new BasicHttpEntity();
         httpentity.setContent(content);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBufferedHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBufferedHttpEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBufferedHttpEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestBufferedHttpEntity.java Thu Nov 26 03:47:23 2015
@@ -29,8 +29,8 @@ package org.apache.hc.core5.http.entity;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -42,7 +42,7 @@ public class TestBufferedHttpEntity {
 
     @Test
     public void testBufferingEntity() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final InputStreamEntity httpentity = new InputStreamEntity(new ByteArrayInputStream(bytes), -1);
         final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity);
         Assert.assertEquals(bytes.length, bufentity.getContentLength());
@@ -57,7 +57,7 @@ public class TestBufferedHttpEntity {
 
     @Test
     public void testWrappingEntity() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes);
         httpentity.setChunked(true);
         final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity);
@@ -83,7 +83,7 @@ public class TestBufferedHttpEntity {
 
     @Test
     public void testWriteToBuffered() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final InputStreamEntity httpentity = new InputStreamEntity(new ByteArrayInputStream(bytes), -1);
         final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity);
 
@@ -115,7 +115,7 @@ public class TestBufferedHttpEntity {
 
     @Test
     public void testWriteToWrapped() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes);
         final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity);
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteArrayEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteArrayEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteArrayEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteArrayEntity.java Thu Nov 26 03:47:23 2015
@@ -28,8 +28,8 @@
 package org.apache.hc.core5.http.entity;
 
 import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -41,7 +41,7 @@ public class TestByteArrayEntity {
 
     @Test
     public void testBasics() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes);
 
         Assert.assertEquals(bytes.length, httpentity.getContentLength());
@@ -52,7 +52,7 @@ public class TestByteArrayEntity {
 
     @Test
     public void testBasicOffLen() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes, 8, 7);
 
         Assert.assertEquals(7, httpentity.getContentLength());
@@ -68,25 +68,25 @@ public class TestByteArrayEntity {
 
     @Test(expected=IndexOutOfBoundsException.class)
     public void testIllegalConstructorBadLen() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         new ByteArrayEntity(bytes, 0, bytes.length + 1);
     }
 
     @Test(expected=IndexOutOfBoundsException.class)
     public void testIllegalConstructorBadOff1() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         new ByteArrayEntity(bytes, -1, bytes.length);
     }
 
     @Test(expected=IndexOutOfBoundsException.class)
     public void testIllegalConstructorBadOff2() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         new ByteArrayEntity(bytes, bytes.length + 1, bytes.length);
     }
 
     @Test
     public void testWriteTo() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes);
 
         ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -117,7 +117,7 @@ public class TestByteArrayEntity {
 
     @Test
     public void testWriteToOffLen() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ASCII);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.US_ASCII);
         final int off = 8;
         final int len = 7;
         final ByteArrayEntity httpentity = new ByteArrayEntity(bytes, off, len);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteBufferEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteBufferEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteBufferEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestByteBufferEntity.java Thu Nov 26 03:47:23 2015
@@ -29,8 +29,8 @@ package org.apache.hc.core5.http.entity;
 
 import java.io.ByteArrayOutputStream;
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -42,7 +42,7 @@ public class TestByteBufferEntity {
 
     @Test
     public void testBasics() throws Exception {
-        final ByteBuffer bytes = ByteBuffer.wrap("Message content".getBytes(Consts.ASCII));
+        final ByteBuffer bytes = ByteBuffer.wrap("Message content".getBytes(StandardCharsets.US_ASCII));
         final ByteBufferEntity httpentity = new ByteBufferEntity(bytes);
 
         Assert.assertEquals(bytes.capacity(), httpentity.getContentLength());
@@ -59,7 +59,7 @@ public class TestByteBufferEntity {
 
     @Test
     public void testWriteTo() throws Exception {
-        final ByteBuffer bytes = ByteBuffer.wrap("Message content".getBytes(Consts.ASCII));
+        final ByteBuffer bytes = ByteBuffer.wrap("Message content".getBytes(StandardCharsets.US_ASCII));
         final ByteBufferEntity httpentity = new ByteBufferEntity(bytes);
 
         ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestContentType.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestContentType.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestContentType.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestContentType.java Thu Nov 26 03:47:23 2015
@@ -28,9 +28,9 @@
 package org.apache.hc.core5.http.entity;
 
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.nio.charset.UnsupportedCharsetException;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.message.BasicNameValuePair;
 import org.junit.Assert;
 import org.junit.Test;
@@ -45,7 +45,7 @@ public class TestContentType {
     public void testBasis() throws Exception {
         final ContentType contentType = ContentType.create("text/plain", "US-ASCII");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=US-ASCII", contentType.toString());
     }
 
@@ -53,7 +53,7 @@ public class TestContentType {
     public void testWithCharset() throws Exception {
         ContentType contentType = ContentType.create("text/plain", "US-ASCII");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=US-ASCII", contentType.toString());
         contentType = contentType.withCharset(Charset.forName("UTF-8"));
         Assert.assertEquals("text/plain", contentType.getMimeType());
@@ -65,11 +65,11 @@ public class TestContentType {
     public void testWithCharsetString() throws Exception {
         ContentType contentType = ContentType.create("text/plain", "US-ASCII");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=US-ASCII", contentType.toString());
-        contentType = contentType.withCharset(Consts.UTF_8);
+        contentType = contentType.withCharset(StandardCharsets.UTF_8);
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.UTF_8, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.UTF_8, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=UTF-8", contentType.toString());
     }
 
@@ -77,7 +77,7 @@ public class TestContentType {
     public void testLowCaseText() throws Exception {
         final ContentType contentType = ContentType.create("Text/Plain", "ascii");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
     }
 
     @Test
@@ -112,7 +112,7 @@ public class TestContentType {
     public void testParse() throws Exception {
         final ContentType contentType = ContentType.parse("text/plain; charset=\"ascii\"");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=ascii", contentType.toString());
     }
 
@@ -121,7 +121,7 @@ public class TestContentType {
         final ContentType contentType = ContentType.parse("text/plain; charset=\"ascii\"; " +
                 "p0 ; p1 = \"blah-blah\"  ; p2 = \" yada yada \" ");
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=ascii; p0; p1=blah-blah; p2=\" yada yada \"",
                 contentType.toString());
         Assert.assertEquals(null, contentType.getParameter("p0"));
@@ -165,7 +165,7 @@ public class TestContentType {
         final ContentType contentType = ContentType.get(httpentity);
         Assert.assertNotNull(contentType);
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.UTF_8, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.UTF_8, contentType.getCharset());
     }
 
     @Test
@@ -214,14 +214,14 @@ public class TestContentType {
                 new BasicNameValuePair("p", "this"),
                 new BasicNameValuePair("p", "that"));
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.UTF_8, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.UTF_8, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=UTF-8; p=this; p=that", contentType.toString());
 
         contentType = contentType.withParameters(
                 new BasicNameValuePair("charset", "ascii"),
                 new BasicNameValuePair("p", "this and that"));
         Assert.assertEquals("text/plain", contentType.getMimeType());
-        Assert.assertEquals(Consts.ASCII, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.US_ASCII, contentType.getCharset());
         Assert.assertEquals("text/plain; charset=ascii; p=\"this and that\"", contentType.toString());
 
         contentType = ContentType.create("text/blah").withParameters(
@@ -230,10 +230,10 @@ public class TestContentType {
         Assert.assertEquals(null, contentType.getCharset());
         Assert.assertEquals("text/blah; p=blah", contentType.toString());
 
-        contentType = ContentType.create("text/blah", Consts.ISO_8859_1).withParameters(
+        contentType = ContentType.create("text/blah", StandardCharsets.ISO_8859_1).withParameters(
                 new BasicNameValuePair("p", "blah"));
         Assert.assertEquals("text/blah", contentType.getMimeType());
-        Assert.assertEquals(Consts.ISO_8859_1, contentType.getCharset());
+        Assert.assertEquals(StandardCharsets.ISO_8859_1, contentType.getCharset());
         Assert.assertEquals("text/blah; charset=ISO-8859-1; p=blah", contentType.toString());
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestHttpEntityWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestHttpEntityWrapper.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestHttpEntityWrapper.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestHttpEntityWrapper.java Thu Nov 26 03:47:23 2015
@@ -28,8 +28,8 @@
 package org.apache.hc.core5.http.entity;
 
 import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -68,7 +68,7 @@ public class TestHttpEntityWrapper {
     @Test
     public void testWriteTo() throws Exception {
         final String s = "Message content";
-        final byte[] bytes = s.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1);
         final StringEntity httpentity = new StringEntity(s);
         final HttpEntityWrapper wrapped = new HttpEntityWrapper(httpentity);
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestInputStreamEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestInputStreamEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestInputStreamEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestInputStreamEntity.java Thu Nov 26 03:47:23 2015
@@ -30,8 +30,8 @@ package org.apache.hc.core5.http.entity;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -43,7 +43,7 @@ public class TestInputStreamEntity {
 
     @Test
     public void testBasics() throws Exception {
-        final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = "Message content".getBytes(StandardCharsets.ISO_8859_1);
         final InputStream instream = new ByteArrayInputStream(bytes);
         final InputStreamEntity httpentity = new InputStreamEntity(instream, bytes.length);
 
@@ -69,7 +69,7 @@ public class TestInputStreamEntity {
     @Test
     public void testWriteTo() throws Exception {
         final String message = "Message content";
-        final byte[] bytes = message.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = message.getBytes(StandardCharsets.ISO_8859_1);
         final InputStream instream = new ByteArrayInputStream(bytes);
         final InputStreamEntity httpentity = new InputStreamEntity(instream, bytes.length);
 
@@ -79,14 +79,14 @@ public class TestInputStreamEntity {
         Assert.assertNotNull(writtenBytes);
         Assert.assertEquals(bytes.length, writtenBytes.length);
 
-        final String s = new String(writtenBytes, Consts.ISO_8859_1.name());
+        final String s = new String(writtenBytes, StandardCharsets.ISO_8859_1.name());
         Assert.assertEquals(message, s);
     }
 
     @Test
     public void testWriteToPartialContent() throws Exception {
         final String message = "Message content";
-        final byte[] bytes = message.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = message.getBytes(StandardCharsets.ISO_8859_1);
         final InputStream instream = new ByteArrayInputStream(bytes);
         final int contentLength = 7;
         final InputStreamEntity httpentity = new InputStreamEntity(instream, contentLength);
@@ -97,14 +97,14 @@ public class TestInputStreamEntity {
         Assert.assertNotNull(writtenBytes);
         Assert.assertEquals(contentLength, writtenBytes.length);
 
-        final String s = new String(writtenBytes, Consts.ISO_8859_1.name());
+        final String s = new String(writtenBytes, StandardCharsets.ISO_8859_1.name());
         Assert.assertEquals(message.substring(0, contentLength), s);
     }
 
     @Test
     public void testWriteToUnknownLength() throws Exception {
         final String message = "Message content";
-        final byte[] bytes = message.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = message.getBytes(StandardCharsets.ISO_8859_1);
         final InputStream instream = new ByteArrayInputStream(bytes);
         final InputStreamEntity httpentity = new InputStreamEntity(instream);
 
@@ -114,7 +114,7 @@ public class TestInputStreamEntity {
         Assert.assertNotNull(writtenBytes);
         Assert.assertEquals(bytes.length, writtenBytes.length);
 
-        final String s = new String(writtenBytes, Consts.ISO_8859_1.name());
+        final String s = new String(writtenBytes, StandardCharsets.ISO_8859_1.name());
         Assert.assertEquals(message, s);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestStringEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestStringEntity.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestStringEntity.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/entity/TestStringEntity.java Thu Nov 26 03:47:23 2015
@@ -29,8 +29,8 @@ package org.apache.hc.core5.http.entity;
 
 import java.io.ByteArrayOutputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +44,7 @@ public class TestStringEntity {
         final String s = "Message content";
         final StringEntity httpentity = new StringEntity(s, ContentType.TEXT_PLAIN);
 
-        final byte[] bytes = s.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1);
         Assert.assertEquals(bytes.length, httpentity.getContentLength());
         Assert.assertNotNull(httpentity.getContent());
         Assert.assertTrue(httpentity.isRepeatable());
@@ -66,7 +66,7 @@ public class TestStringEntity {
         final String s = "Message content";
         StringEntity httpentity = new StringEntity(s, ContentType.create("text/csv", "ANSI_X3.4-1968"));
         Assert.assertEquals("text/csv; charset=US-ASCII", httpentity.getContentType());
-        httpentity = new StringEntity(s, Consts.ASCII);
+        httpentity = new StringEntity(s, StandardCharsets.US_ASCII);
         Assert.assertEquals("text/plain; charset=US-ASCII", httpentity.getContentType());
         httpentity = new StringEntity(s);
         Assert.assertEquals("text/plain; charset=ISO-8859-1", httpentity.getContentType());
@@ -102,7 +102,7 @@ public class TestStringEntity {
     @Test
     public void testWriteTo() throws Exception {
         final String s = "Message content";
-        final byte[] bytes = s.getBytes(Consts.ISO_8859_1);
+        final byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1);
         final StringEntity httpentity = new StringEntity(s);
 
         ByteArrayOutputStream out = new ByteArrayOutputStream();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestChunkCoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestChunkCoding.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestChunkCoding.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestChunkCoding.java Thu Nov 26 03:47:23 2015
@@ -32,9 +32,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InterruptedIOException;
 import java.io.OutputStream;
+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.Header;
 import org.apache.hc.core5.http.MalformedChunkCodingException;
 import org.apache.hc.core5.http.MessageConstraintException;
@@ -70,7 +70,7 @@ public class TestChunkCoding {
     @Test
     public void testChunkedInputStreamLargeBuffer() throws IOException {
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(CHUNKED_INPUT, Consts.ISO_8859_1));
+                new SessionInputBufferMock(CHUNKED_INPUT, StandardCharsets.ISO_8859_1));
         final byte[] buffer = new byte[300];
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         int len;
@@ -82,7 +82,7 @@ public class TestChunkCoding {
 
         in.close();
 
-        final String result = new String(out.toByteArray(), Consts.ISO_8859_1);
+        final String result = new String(out.toByteArray(), StandardCharsets.ISO_8859_1);
         Assert.assertEquals(result, CHUNKED_RESULT);
 
         final Header[] footers = in.getFooters();
@@ -98,7 +98,7 @@ public class TestChunkCoding {
     @Test
     public void testChunkedInputStreamSmallBuffer() throws IOException {
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(CHUNKED_INPUT, Consts.ISO_8859_1));
+                new SessionInputBufferMock(CHUNKED_INPUT, StandardCharsets.ISO_8859_1));
 
         final byte[] buffer = new byte[7];
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -125,7 +125,7 @@ public class TestChunkCoding {
     public void testChunkedInputStreamOneByteRead() throws IOException {
         final String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         int ch;
         int i = '0';
         while ((ch = in.read()) != -1) {
@@ -142,7 +142,7 @@ public class TestChunkCoding {
     public void testAvailable() throws IOException {
         final String s = "5\r\n12345\r\n0\r\n";
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         Assert.assertEquals(0, in.available());
         in.read();
         Assert.assertEquals(4, in.available());
@@ -153,7 +153,7 @@ public class TestChunkCoding {
     public void testChunkedInputStreamClose() throws IOException {
         final String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         in.close();
         in.close();
         try {
@@ -202,7 +202,7 @@ public class TestChunkCoding {
     public void testChunkedInputStreamNoClosingChunk() throws IOException {
         final String s = "5\r\n01234\r\n";
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         final byte[] tmp = new byte[5];
         Assert.assertEquals(5, in.read(tmp));
         in.read();
@@ -214,7 +214,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamTruncatedCRLF() throws IOException {
         final String s = "5\r\n01234";
         final ChunkedInputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         final byte[] tmp = new byte[5];
         Assert.assertEquals(5, in.read(tmp));
         in.read();
@@ -226,7 +226,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamMissingCRLF() throws IOException {
         final String s = "5\r\n012345\r\n56789\r\n0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         final byte[] buffer = new byte[300];
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         int len;
@@ -241,7 +241,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamMissingLF() throws IOException {
         final String s = "5\r01234\r\n5\r\n56789\r\n0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         in.read();
         in.close();
     }
@@ -251,7 +251,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamInvalidSize() throws IOException {
         final String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         in.read();
         in.close();
     }
@@ -261,7 +261,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamNegativeSize() throws IOException {
         final String s = "-5\r\n01234\r\n5\r\n56789\r\n0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         in.read();
         in.close();
     }
@@ -271,7 +271,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamTruncatedChunk() throws IOException {
         final String s = "3\r\n12";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         final byte[] buffer = new byte[300];
         Assert.assertEquals(2, in.read(buffer));
         in.read(buffer);
@@ -283,7 +283,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamInvalidFooter() throws IOException {
         final String s = "1\r\n0\r\n0\r\nstuff\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         in.read();
         in.read();
         in.close();
@@ -293,7 +293,7 @@ public class TestChunkCoding {
     public void testCorruptChunkedInputStreamClose() throws IOException {
         final String s = "whatever\r\n01234\r\n5\r\n56789\r\n0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(s, Consts.ISO_8859_1));
+                new SessionInputBufferMock(s, StandardCharsets.ISO_8859_1));
         try {
             in.read();
             Assert.fail("MalformedChunkCodingException expected");
@@ -306,7 +306,7 @@ public class TestChunkCoding {
     public void testEmptyChunkedInputStream() throws IOException {
         final String input = "0\r\n";
         final InputStream in = new ChunkedInputStream(
-                new SessionInputBufferMock(input, Consts.ISO_8859_1));
+                new SessionInputBufferMock(input, StandardCharsets.ISO_8859_1));
         final byte[] buffer = new byte[300];
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         int len;
@@ -321,13 +321,13 @@ public class TestChunkCoding {
     public void testTooLongChunkHeader() throws IOException {
         final String input = "5; and some very looooong commend\r\n12345\r\n0\r\n";
         final InputStream in1 = new ChunkedInputStream(
-                new SessionInputBufferMock(input, MessageConstraints.DEFAULT, Consts.ISO_8859_1));
+                new SessionInputBufferMock(input, MessageConstraints.DEFAULT, StandardCharsets.ISO_8859_1));
         final byte[] buffer = new byte[300];
         Assert.assertEquals(5, in1.read(buffer));
         in1.close();
 
         final InputStream in2 = new ChunkedInputStream(
-                new SessionInputBufferMock(input, MessageConstraints.lineLen(10), Consts.ISO_8859_1));
+                new SessionInputBufferMock(input, MessageConstraints.lineLen(10), StandardCharsets.ISO_8859_1));
         try {
             in2.read(buffer);
             Assert.fail("MessageConstraintException expected");
@@ -345,7 +345,7 @@ public class TestChunkCoding {
         final String input = "76126;27823abcd;:q38a-\nkjc\rk%1ad\tkh/asdui\r\njkh+?\\suweb";
         final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         final OutputStream out = new ChunkedOutputStream(2048, new SessionOutputBufferMock(buffer));
-        out.write(input.getBytes(Consts.ISO_8859_1));
+        out.write(input.getBytes(StandardCharsets.ISO_8859_1));
         out.flush();
         out.close();
         out.close();
@@ -359,7 +359,7 @@ public class TestChunkCoding {
             result.write(d, 0, len);
         }
 
-        final String output = new String(result.toByteArray(), Consts.ISO_8859_1);
+        final String output = new String(result.toByteArray(), StandardCharsets.ISO_8859_1);
         Assert.assertEquals(input, output);
         in.close();
     }
@@ -381,7 +381,7 @@ public class TestChunkCoding {
         out.finish();
         out.close();
 
-        final String content = new String(buffer.getData(), Consts.ASCII);
+        final String content = new String(buffer.getData(), StandardCharsets.US_ASCII);
         Assert.assertEquals("1\r\nx\r\n0\r\nE: \r\nY: Z\r\n\r\n", content);
     }
 
@@ -396,7 +396,7 @@ public class TestChunkCoding {
         out.finish();
         out.close();
 
-        final String content = new String(buffer.getData(), Consts.ASCII);
+        final String content = new String(buffer.getData(), StandardCharsets.US_ASCII);
         Assert.assertEquals("2\r\n12\r\n2\r\n34\r\n0\r\n\r\n", content);
     }
 
@@ -408,7 +408,7 @@ public class TestChunkCoding {
         out.finish();
         out.close();
 
-        final String content = new String(buffer.getData(), Consts.ASCII);
+        final String content = new String(buffer.getData(), StandardCharsets.US_ASCII);
         Assert.assertEquals("4\r\n1234\r\n0\r\n\r\n", content);
     }
 
@@ -420,7 +420,7 @@ public class TestChunkCoding {
         out.finish();
         out.close();
 
-        final String content = new String(buffer.getData(), Consts.ASCII);
+        final String content = new String(buffer.getData(), StandardCharsets.US_ASCII);
         Assert.assertEquals("1\r\n1\r\n0\r\n\r\n", content);
     }
 
@@ -428,7 +428,7 @@ public class TestChunkCoding {
     public void testResumeOnSocketTimeoutInData() throws IOException {
         final String s = "5\r\n01234\r\n5\r\n5\0006789\r\na\r\n0123\000456789\r\n0\r\n";
         final SessionInputBuffer sessbuf = new SessionInputBufferMock(
-                new TimeoutByteArrayInputStream(s.getBytes(Consts.ISO_8859_1)), 16);
+                new TimeoutByteArrayInputStream(s.getBytes(StandardCharsets.ISO_8859_1)), 16);
         final InputStream in = new ChunkedInputStream(sessbuf);
 
         final byte[] tmp = new byte[3];
@@ -456,7 +456,7 @@ public class TestChunkCoding {
     public void testResumeOnSocketTimeoutInChunk() throws IOException {
         final String s = "5\000\r\000\n\00001234\r\n\0005\r\n56789\r\na\r\n0123456789\r\n\0000\r\n";
         final SessionInputBuffer sessbuf = new SessionInputBufferMock(
-                new TimeoutByteArrayInputStream(s.getBytes(Consts.ISO_8859_1)), 16);
+                new TimeoutByteArrayInputStream(s.getBytes(StandardCharsets.ISO_8859_1)), 16);
         final InputStream in = new ChunkedInputStream(sessbuf);
 
         final byte[] tmp = new byte[3];

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestContentLengthInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestContentLengthInputStream.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestContentLengthInputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestContentLengthInputStream.java Thu Nov 26 03:47:23 2015
@@ -30,9 +30,9 @@ package org.apache.hc.core5.http.impl.io
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+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.io.SessionInputBuffer;
 import org.junit.Assert;
 import org.junit.Test;
@@ -62,7 +62,7 @@ public class TestContentLengthInputStrea
     public void testBasics() throws IOException {
         final String correct = "1234567890123456";
         final InputStream in = new ContentLengthInputStream(
-                new SessionInputBufferMock(correct, Consts.ISO_8859_1), 10L);
+                new SessionInputBufferMock(correct, StandardCharsets.ISO_8859_1), 10L);
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
 
         final byte[] buffer = new byte[50];
@@ -71,7 +71,7 @@ public class TestContentLengthInputStrea
         len = in.read(buffer);
         out.write(buffer, 0, len);
 
-        final String result = new String(out.toByteArray(), Consts.ISO_8859_1);
+        final String result = new String(out.toByteArray(), StandardCharsets.ISO_8859_1);
         Assert.assertEquals(result, "1234567890");
         in.close();
     }
@@ -115,7 +115,7 @@ public class TestContentLengthInputStrea
     @Test
     public void testClose() throws IOException {
         final String correct = "1234567890123456-";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, Consts.ISO_8859_1);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, StandardCharsets.ISO_8859_1);
         final InputStream in = new ContentLengthInputStream(inbuffer, 16L);
         in.close();
         in.close();
@@ -144,7 +144,7 @@ public class TestContentLengthInputStrea
     @Test
     public void testTruncatedContent() throws IOException {
         final String correct = "1234567890123456";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, Consts.ISO_8859_1);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, StandardCharsets.ISO_8859_1);
         final InputStream in = new ContentLengthInputStream(inbuffer, 32L);
         final byte[] tmp = new byte[32];
         final int byteRead = in.read(tmp);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java Thu Nov 26 03:47:23 2015
@@ -30,8 +30,8 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.net.Socket;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
@@ -79,7 +79,7 @@ public class TestDefaultBHttpClientConne
     @Test
     public void testReadResponseHead() throws Exception {
         final String s = "HTTP/1.1 200 OK\r\nUser-Agent: test\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -97,7 +97,7 @@ public class TestDefaultBHttpClientConne
     @Test
     public void testReadResponseEntityWithContentLength() throws Exception {
         final String s = "HTTP/1.1 200 OK\r\nServer: test\r\nContent-Length: 3\r\n\r\n123";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -127,7 +127,7 @@ public class TestDefaultBHttpClientConne
     public void testReadResponseEntityChunkCoded() throws Exception {
         final String s = "HTTP/1.1 200 OK\r\nServer: test\r\nTransfer-Encoding: " +
                 "chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -157,7 +157,7 @@ public class TestDefaultBHttpClientConne
     @Test(expected = NotImplementedException.class)
     public void testReadResponseEntityIdentity() throws Exception {
         final String s = "HTTP/1.1 200 OK\r\nServer: test\r\nTransfer-Encoding: identity\r\n\r\n123";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -178,7 +178,7 @@ public class TestDefaultBHttpClientConne
     @Test
     public void testReadResponseNoEntity() throws Exception {
         final String s = "HTTP/1.1 200 OK\r\nServer: test\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java Thu Nov 26 03:47:23 2015
@@ -30,8 +30,8 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.net.Socket;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.Consts;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
@@ -78,7 +78,7 @@ public class TestDefaultBHttpServerConne
     @Test
     public void testReadRequestHead() throws Exception {
         final String s = "GET / HTTP/1.1\r\nUser-Agent: test\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -97,7 +97,7 @@ public class TestDefaultBHttpServerConne
     @Test
     public void testReadRequestEntityWithContentLength() throws Exception {
         final String s = "POST / HTTP/1.1\r\nUser-Agent: test\r\nContent-Length: 3\r\n\r\n123";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -129,7 +129,7 @@ public class TestDefaultBHttpServerConne
     public void testReadRequestEntityChunckCoded() throws Exception {
         final String s = "POST /stuff HTTP/1.1\r\nUser-Agent: test\r\nTransfer-Encoding: " +
                 "chunked\r\n\r\n3\r\n123\r\n0\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -162,7 +162,7 @@ public class TestDefaultBHttpServerConne
     public void testReadRequestEntityIdentity() throws Exception {
         final String s = "POST /stuff HTTP/1.1\r\nUser-Agent: test\r\nTransfer-Encoding: " +
                 "identity\r\n\r\n123";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);
@@ -185,7 +185,7 @@ public class TestDefaultBHttpServerConne
     @Test
     public void testReadRequestNoEntity() throws Exception {
         final String s = "POST /stuff HTTP/1.1\r\nUser-Agent: test\r\n\r\n";
-        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(Consts.ASCII));
+        final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
         Mockito.when(socket.getInputStream()).thenReturn(instream);
 
         conn.bind(socket);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestMessageParser.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestMessageParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestMessageParser.java Thu Nov 26 03:47:23 2015
@@ -28,8 +28,8 @@
 package org.apache.hc.core5.http.impl.io;
 
 import java.io.IOException;
+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.HeaderElement;
 import org.apache.hc.core5.http.NameValuePair;
@@ -64,7 +64,7 @@ public class TestMessageParser {
             "\t and even more stuff\r\n" +
             "     \r\n" +
             "\r\n";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final Header[] headers = AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
         Assert.assertNotNull(headers);
         Assert.assertEquals(3, headers.length);
@@ -80,7 +80,7 @@ public class TestMessageParser {
     public void testParsingHeader() throws Exception {
         final String s = "header1: stuff; param1 = value1; param2 = \"value 2\" \r\n" +
                 "\r\n";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final Header[] headers = AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
         Assert.assertNotNull(headers);
         Assert.assertEquals(1, headers.length);
@@ -104,7 +104,7 @@ public class TestMessageParser {
         String s = "    stuff\r\n" +
             "header1: stuff\r\n" +
             "\r\n";
-        SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         try {
             AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
             Assert.fail("ProtocolException should have been thrown");
@@ -114,7 +114,7 @@ public class TestMessageParser {
         s = "  :  stuff\r\n" +
             "header1: stuff\r\n" +
             "\r\n";
-        receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         try {
             AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
             Assert.fail("ProtocolException should have been thrown");
@@ -128,7 +128,7 @@ public class TestMessageParser {
         final String s =
             "    header1: stuff\r\n" +
             "header2: stuff \r\n";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final Header[] headers = AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
         Assert.assertNotNull(headers);
         Assert.assertEquals(2, headers.length);
@@ -141,7 +141,7 @@ public class TestMessageParser {
     @Test
     public void testEmptyDataStream() throws Exception {
         final String s = "";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final Header[] headers = AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
         Assert.assertNotNull(headers);
         Assert.assertEquals(0, headers.length);
@@ -154,7 +154,7 @@ public class TestMessageParser {
             "header2: stuff \r\n" +
             "header3: stuff\r\n" +
             "\r\n";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         try {
             AbstractMessageParser.parseHeaders(receiver, 2, -1, null);
             Assert.fail("IOException should have been thrown");
@@ -170,7 +170,7 @@ public class TestMessageParser {
             " stuff \r\n" +
             " stuff\r\n" +
             "\r\n";
-        final SessionInputBuffer receiver = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer receiver = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         try {
             AbstractMessageParser.parseHeaders(receiver, 2, 15, null);
             Assert.fail("IOException should have been thrown");

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java Thu Nov 26 03:47:23 2015
@@ -27,9 +27,9 @@
 package org.apache.hc.core5.http.impl.io;
 
 import java.io.InterruptedIOException;
+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.Header;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpVersion;
@@ -54,7 +54,7 @@ public class TestRequestParser {
             "User-Agent: whatever\r\n" +
             "Cookie: c1=stuff\r\n" +
             "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser();
         final HttpRequest httprequest = parser.parse(inbuffer);
@@ -84,7 +84,7 @@ public class TestRequestParser {
                 "GET / HTTP/1.1\r\n" +
                 "Host: localhost\r\n" +
                 "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser(
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
@@ -108,7 +108,7 @@ public class TestRequestParser {
                 "GET / HTTP/1.1\r\n" +
                 "Host: localhost\r\n" +
                 "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser(
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
@@ -124,7 +124,7 @@ public class TestRequestParser {
             "Coo\000kie: c1=stuff\r\n" +
             "\000\r\n";
         final SessionInputBuffer inbuffer = new SessionInputBufferMock(
-                new TimeoutByteArrayInputStream(s.getBytes(Consts.ASCII)), 16);
+                new TimeoutByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)), 16);
 
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser();
 
@@ -156,7 +156,7 @@ public class TestRequestParser {
     @Test(expected = UnsupportedHttpVersionException.class)
     public void testParsingUnsupportedVersion() throws Exception {
         final String s = "GET / HTTP/2.0\r\n\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser();
         parser.parse(inbuffer);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java?rev=1716559&r1=1716558&r2=1716559&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java Thu Nov 26 03:47:23 2015
@@ -28,8 +28,8 @@
 package org.apache.hc.core5.http.impl.io;
 
 import java.io.InterruptedIOException;
+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.HttpResponse;
 import org.apache.hc.core5.http.HttpVersion;
@@ -55,7 +55,7 @@ public class TestResponseParser {
             "Date: some date\r\n" +
             "Set-Cookie: c1=stuff\r\n" +
             "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser();
         final HttpResponse httpresponse = parser.parse(inbuffer);
@@ -85,7 +85,7 @@ public class TestResponseParser {
                 "HTTP/1.1 200 OK\r\n" +
                 "Server: whatever\r\n" +
                 "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser(
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
@@ -109,7 +109,7 @@ public class TestResponseParser {
                 "HTTP/1.1 200 OK\r\n" +
                 "Server: whatever\r\n" +
                 "\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
 
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser(
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
@@ -125,7 +125,7 @@ public class TestResponseParser {
             "Set-Coo\000kie: c1=stuff\r\n" +
             "\000\r\n";
         final SessionInputBuffer inbuffer = new SessionInputBufferMock(
-                new TimeoutByteArrayInputStream(s.getBytes(Consts.ASCII)), 16);
+                new TimeoutByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)), 16);
 
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser();
 
@@ -156,7 +156,7 @@ public class TestResponseParser {
     @Test(expected = UnsupportedHttpVersionException.class)
     public void testParsingUnsupportedVersion() throws Exception {
         final String s = "HTTP/2.0 200 OK\r\n\r\n";
-        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, Consts.ASCII);
+        final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII);
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser();
         parser.parse(inbuffer);
     }



Mime
View raw message