hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1747894 - /httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java
Date Sat, 11 Jun 2016 14:22:08 GMT
Author: olegk
Date: Sat Jun 11 14:22:08 2016
New Revision: 1747894

URL: http://svn.apache.org/viewvc?rev=1747894&view=rev
Log:
Fixed build breakage due to Java 1.6 incompatibility

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java?rev=1747894&r1=1747893&r2=1747894&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/test/java/org/apache/http/client/utils/TestURLEncodedUtils.java
Sat Jun 11 14:22:08 2016
@@ -28,7 +28,6 @@
 package org.apache.http.client.utils;
 
 import java.net.URI;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -351,46 +350,46 @@ public class TestURLEncodedUtils {
     @Test
     public void testFormatString() throws Exception { // as above, using String
         final List <NameValuePair> params = new ArrayList <NameValuePair>();
-        Assert.assertEquals(0, URLEncodedUtils.format(params, StandardCharsets.US_ASCII).length());
+        Assert.assertEquals(0, URLEncodedUtils.format(params, Consts.ASCII).length());
 
         params.clear();
         params.add(new BasicNameValuePair("Name0", null));
-        Assert.assertEquals("Name0", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name0", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name1", "Value1"));
-        Assert.assertEquals("Name1=Value1", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name1=Value1", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name2", ""));
-        Assert.assertEquals("Name2=", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name2=", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name4", "Value 4&"));
-        Assert.assertEquals("Name4=Value+4%26", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name4=Value+4%26", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name4", "Value+4&"));
-        Assert.assertEquals("Name4=Value%2B4%26", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name4=Value%2B4%26", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name4", "Value 4& =4"));
-        Assert.assertEquals("Name4=Value+4%26+%3D4", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name4=Value+4%26+%3D4", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name5", "aaa"));
         params.add(new BasicNameValuePair("Name6", "bbb"));
-        Assert.assertEquals("Name5=aaa&Name6=bbb", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name5=aaa&Name6=bbb", URLEncodedUtils.format(params, Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name7", "aaa"));
         params.add(new BasicNameValuePair("Name7", "b,b"));
         params.add(new BasicNameValuePair("Name7", "ccc"));
-        Assert.assertEquals("Name7=aaa&Name7=b%2Cb&Name7=ccc", URLEncodedUtils.format(params,
StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name7=aaa&Name7=b%2Cb&Name7=ccc", URLEncodedUtils.format(params,
Consts.ASCII));
 
         params.clear();
         params.add(new BasicNameValuePair("Name8", "xx,  yy  ,zz"));
-        Assert.assertEquals("Name8=xx%2C++yy++%2Czz", URLEncodedUtils.format(params, StandardCharsets.US_ASCII));
+        Assert.assertEquals("Name8=xx%2C++yy++%2Czz", URLEncodedUtils.format(params, Consts.ASCII));
     }
 
     private List <NameValuePair> parse (final String params) {
@@ -398,7 +397,7 @@ public class TestURLEncodedUtils {
     }
 
     private List <NameValuePair> parseString (final String uri) throws Exception {
-        return URLEncodedUtils.parse(new URI("?"+uri), StandardCharsets.UTF_8);
+        return URLEncodedUtils.parse(new URI("?"+uri), Consts.UTF_8);
     }
 
     private static void assertNameValuePair (



Mime
View raw message