hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1334458 - in /httpcomponents/httpasyncclient/trunk: ./ httpasyncclient/src/examples/org/apache/http/examples/nio/client/ httpasyncclient/src/main/java/org/apache/http/impl/nio/client/ httpasyncclient/src/main/java/org/apache/http/impl/nio/...
Date Sat, 05 May 2012 17:34:55 GMT
Author: olegk
Date: Sat May  5 17:34:54 2012
New Revision: 1334458

URL: http://svn.apache.org/viewvc?rev=1334458&view=rev
Log:
Upgraded to HttpCore 4.2

Modified:
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultHttpAsyncClient.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/LoggingAsyncRequestExecutor.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientAsyncConnection.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/AsyncCharConsumer.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthenticationFallBack.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientReauthentication.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestStatefulConnManagement.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
    httpcomponents/httpasyncclient/trunk/pom.xml

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
Sat May  5 17:34:54 2012
@@ -47,7 +47,7 @@ public class ZeroCopyHttpExchange {
             File upload = new File(args[0]);
             File download = new File(args[1]);
             ZeroCopyPost httpost = new ZeroCopyPost("http://localhost:8080/", upload,
-                    ContentType.create("text/plain", null));
+                    ContentType.create("text/plain"));
             ZeroCopyConsumer<File> consumer = new ZeroCopyConsumer<File>(download)
{
 
                 @Override

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultHttpAsyncClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultHttpAsyncClient.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultHttpAsyncClient.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/DefaultHttpAsyncClient.java
Sat May  5 17:34:54 2012
@@ -73,7 +73,7 @@ public class DefaultHttpAsyncClient exte
 
     public static void setDefaultHttpParams(HttpParams params) {
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
-        HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);
+        HttpProtocolParams.setContentCharset(params, HTTP.DEF_CONTENT_CHARSET.name());
         HttpConnectionParams.setTcpNoDelay(params, true);
         HttpConnectionParams.setSocketBufferSize(params, 8192);
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/LoggingAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/LoggingAsyncRequestExecutor.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/LoggingAsyncRequestExecutor.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/LoggingAsyncRequestExecutor.java
Sat May  5 17:34:54 2012
@@ -31,10 +31,7 @@ import java.io.IOException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.http.Header;
 import org.apache.http.HttpException;
-import org.apache.http.HttpResponse;
-import org.apache.http.impl.nio.conn.DefaultClientAsyncConnection;
 import org.apache.http.nio.ContentDecoder;
 import org.apache.http.nio.ContentEncoder;
 import org.apache.http.nio.NHttpClientConnection;
@@ -42,7 +39,6 @@ import org.apache.http.nio.protocol.Http
 
 class LoggingAsyncRequestExecutor extends HttpAsyncRequestExecutor {
 
-    private final Log headerlog = LogFactory.getLog("org.apache.http.headers");
     private final Log log = LogFactory.getLog(HttpAsyncRequestExecutor.class);
 
     public LoggingAsyncRequestExecutor() {
@@ -121,26 +117,6 @@ class LoggingAsyncRequestExecutor extend
         if (this.log.isDebugEnabled()) {
             this.log.debug(conn + " Response received");
         }
-        
-        // TODO: move header logging back to DefaultAsyncClientConnection
-        // once DefaultNHttpClientConnection#onResponseReceived method
-        // becomes available.
-        if (this.headerlog.isDebugEnabled()) {
-            HttpResponse response = conn.getHttpResponse();
-            String id;
-            if (conn instanceof DefaultClientAsyncConnection) {
-                id = ((DefaultClientAsyncConnection) conn).getId();
-            } else {
-                id = conn.toString();
-            }
-            if (response != null && this.headerlog.isDebugEnabled()) {
-                this.headerlog.debug(id + " << " + response.getStatusLine().toString());
-                Header[] headers = response.getAllHeaders();
-                for (int i = 0; i < headers.length; i++) {
-                    this.headerlog.debug(id + " << " + headers[i].toString());
-                }
-            }
-        }
         super.responseReceived(conn);
     }
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientAsyncConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientAsyncConnection.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientAsyncConnection.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientAsyncConnection.java
Sat May  5 17:34:54 2012
@@ -26,13 +26,11 @@
  */
 package org.apache.http.impl.nio.conn;
 
-import java.io.IOException;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.Header;
-import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.nio.conn.ClientAsyncConnection;
@@ -84,7 +82,18 @@ public class DefaultClientAsyncConnectio
     }
     
     @Override
-    public void submitRequest(final HttpRequest request) throws IOException, HttpException
{
+    protected void onResponseReceived(HttpResponse response) {
+        if (response != null && this.headerlog.isDebugEnabled()) {
+            this.headerlog.debug(this.id + " << " + response.getStatusLine().toString());
+            Header[] headers = response.getAllHeaders();
+            for (int i = 0; i < headers.length; i++) {
+                this.headerlog.debug(this.id + " << " + headers[i].toString());
+            }
+        }
+    }
+
+    @Override
+    protected void onRequestSubmitted(HttpRequest request) {
         if (request != null && this.headerlog.isDebugEnabled()) {
             this.headerlog.debug(this.id + " >> " + request.getRequestLine().toString());
             Header[] headers = request.getAllHeaders();
@@ -92,7 +101,6 @@ public class DefaultClientAsyncConnectio
                 this.headerlog.debug(this.id + " >> " + headers[i].toString());
             }
         }
-        super.submitRequest(request);
     }
 
     @Override

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/AsyncCharConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/AsyncCharConsumer.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/AsyncCharConsumer.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/client/methods/AsyncCharConsumer.java
Sat May  5 17:34:54 2012
@@ -27,13 +27,11 @@
 package org.apache.http.nio.client.methods;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CoderResult;
-import java.nio.charset.UnsupportedCharsetException;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.entity.ContentType;
@@ -66,16 +64,11 @@ public abstract class AsyncCharConsumer<
     protected final void onEntityEnclosed(
             final HttpEntity entity, final ContentType contentType) throws IOException {
         this.contentType = contentType != null ? contentType : ContentType.DEFAULT_TEXT;
-        try {
-            String cs = this.contentType.getCharset();
-            if (cs == null) {
-                cs = HTTP.DEFAULT_CONTENT_CHARSET;
-            }
-            Charset charset = Charset.forName(cs);
-            this.chardecoder = charset.newDecoder();
-        } catch (UnsupportedCharsetException ex) {
-            throw new UnsupportedEncodingException(this.contentType.getCharset());
+        Charset charset = this.contentType.getCharset();
+        if (charset == null) {
+            charset = HTTP.DEF_CONTENT_CHARSET;
         }
+        this.chardecoder = charset.newDecoder();
         this.bbuf = ByteBuffer.allocate(this.bufSize);
         this.cbuf = CharBuffer.allocate(this.bufSize);
     }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthentication.java
Sat May  5 17:34:54 2012
@@ -30,6 +30,7 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
+import org.apache.http.Consts;
 import org.apache.http.HttpAsyncTestBase;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
@@ -173,7 +174,7 @@ public class TestClientAuthentication ex
                 response.setStatusCode(HttpStatus.SC_UNAUTHORIZED);
             } else {
                 response.setStatusCode(HttpStatus.SC_OK);
-                NStringEntity entity = new NStringEntity("success", HTTP.ASCII);
+                NStringEntity entity = new NStringEntity("success", Consts.ASCII);
                 response.setEntity(entity);
             }
             response.setHeader(HTTP.CONN_DIRECTIVE,
@@ -427,7 +428,7 @@ public class TestClientAuthentication ex
         this.httpclient.setCredentialsProvider(credsProvider);
 
         HttpPost httppost = new HttpPost("/");
-        httppost.setEntity(new NStringEntity("some important stuff", HTTP.ISO_8859_1));
+        httppost.setEntity(new NStringEntity("some important stuff", Consts.ISO_8859_1));
 
         Future<HttpResponse> future = this.httpclient.execute(target, httppost, null);
         HttpResponse response = future.get();

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthenticationFallBack.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthenticationFallBack.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthenticationFallBack.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientAuthenticationFallBack.java
Sat May  5 17:34:54 2012
@@ -29,6 +29,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.concurrent.Future;
 
+import org.apache.http.Consts;
 import org.apache.http.HttpAsyncTestBase;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
@@ -59,7 +60,6 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -161,7 +161,7 @@ public class TestClientAuthenticationFal
                 response.setStatusCode(HttpStatus.SC_UNAUTHORIZED);
             } else {
                 response.setStatusCode(HttpStatus.SC_OK);
-                StringEntity entity = new StringEntity("success", HTTP.ASCII);
+                StringEntity entity = new StringEntity("success", Consts.ASCII);
                 response.setEntity(entity);
             }
         }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientReauthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientReauthentication.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientReauthentication.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestClientReauthentication.java
Sat May  5 17:34:54 2012
@@ -30,6 +30,7 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.http.Consts;
 import org.apache.http.HttpAsyncTestBase;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
@@ -61,7 +62,6 @@ import org.apache.http.nio.reactor.IORea
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -168,7 +168,7 @@ public class TestClientReauthentication 
                     response.setStatusCode(HttpStatus.SC_UNAUTHORIZED);
                 } else {
                     response.setStatusCode(HttpStatus.SC_OK);
-                    StringEntity entity = new StringEntity("success", HTTP.ASCII);
+                    StringEntity entity = new StringEntity("success", Consts.ASCII);
                     response.setEntity(entity);
                 }
             }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestStatefulConnManagement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestStatefulConnManagement.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestStatefulConnManagement.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/impl/nio/client/TestStatefulConnManagement.java
Sat May  5 17:34:54 2012
@@ -63,9 +63,9 @@ import org.apache.http.nio.reactor.Liste
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
+import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
-import org.apache.http.protocol.SyncBasicHttpContext;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -159,7 +159,7 @@ public class TestStatefulConnManagement 
         HttpContext[] contexts = new HttpContext[workerCount];
         HttpWorker[] workers = new HttpWorker[workerCount];
         for (int i = 0; i < contexts.length; i++) {
-            HttpContext context = new SyncBasicHttpContext();
+            HttpContext context = new BasicHttpContext();
             Object token = Integer.valueOf(i);
             context.setAttribute("user", token);
             contexts[i] = context;
@@ -300,7 +300,7 @@ public class TestStatefulConnManagement 
         HttpHost target = start(registry, null);
 
         // Bottom of the pool : a *keep alive* connection to Route 1.
-        HttpContext context1 = new SyncBasicHttpContext();
+        HttpContext context1 = new BasicHttpContext();
         context1.setAttribute("user", "stuff");
 
         Future<HttpResponse> future1 = this.httpclient.execute(
@@ -317,7 +317,7 @@ public class TestStatefulConnManagement 
 
         // Send a very simple HTTP get (it MUST be simple, no auth, no proxy, no 302, no
401, ...)
         // Send it to another route. Must be a keepalive.
-        HttpContext context2 = new SyncBasicHttpContext();
+        HttpContext context2 = new BasicHttpContext();
 
         Future<HttpResponse> future2 = this.httpclient.execute(
                 new HttpHost("127.0.0.1", target.getPort(), target.getSchemeName()),
@@ -337,7 +337,7 @@ public class TestStatefulConnManagement 
         // So the ConnPoolByRoute will need to kill one connection (it is maxed out globally).
         // The killed conn is the oldest, which means the first HTTPGet ([localhost][stuff]).
         // When this happens, the RouteSpecificPool becomes empty.
-        HttpContext context3 = new SyncBasicHttpContext();
+        HttpContext context3 = new BasicHttpContext();
         Future<HttpResponse> future3 = this.httpclient.execute(
                 target, new HttpGet("/"), context3, null);
         HttpResponse response3 = future3.get();

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestAsyncConsumers.java
Sat May  5 17:34:54 2012
@@ -34,6 +34,7 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.http.Consts;
 import org.apache.http.HttpAsyncTestBase;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
@@ -56,7 +57,6 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.junit.After;
 import org.junit.Assert;
@@ -219,7 +219,7 @@ public class TestAsyncConsumers extends 
         for (int i = 0; i < 5; i++) {
             HttpAsyncRequestProducer httppost = HttpAsyncMethods.createPost(
                     target.toURI() + "/echo/stuff", s,
-                    ContentType.create("text/plain", HTTP.ASCII));
+                    ContentType.create("text/plain", Consts.ASCII));
             AsyncCharConsumer<String> consumer = new BufferingCharConsumer();
             Future<String> future = this.httpclient.execute(httppost, consumer, null);
             String result = future.get();
@@ -240,7 +240,7 @@ public class TestAsyncConsumers extends 
         for (int i = 0; i < 5; i++) {
             HttpAsyncRequestProducer httppost = HttpAsyncMethods.createPost(
                     target.toURI() + "/echo/stuff", s,
-                    ContentType.create("text/plain", HTTP.ASCII));
+                    ContentType.create("text/plain", Consts.ASCII));
             AsyncCharConsumer<String> consumer = new BufferingCharConsumer(512);
             Future<String> future = this.httpclient.execute(httppost, consumer, null);
             String result = future.get();
@@ -260,7 +260,7 @@ public class TestAsyncConsumers extends 
 
         HttpAsyncRequestProducer httppost = HttpAsyncMethods.createPost(
                 target.toURI() + "/echo/stuff", s,
-                ContentType.create("text/plain", HTTP.ASCII));
+                ContentType.create("text/plain", Consts.ASCII));
         BufferingCharConsumer consumer = Mockito.spy(new BufferingCharConsumer());
         Future<String> future = this.httpclient.execute(httppost, consumer, null);
         String result = future.get();
@@ -274,7 +274,7 @@ public class TestAsyncConsumers extends 
         HttpHost target = start();
         HttpAsyncRequestProducer httppost = HttpAsyncMethods.createPost(
                 target.toURI() + "/echo/stuff", "stuff",
-                ContentType.create("text/plain", HTTP.ASCII));
+                ContentType.create("text/plain", Consts.ASCII));
         AsyncCharConsumer<String> consumer = Mockito.spy(new BufferingCharConsumer());
         Mockito.doThrow(new IOException("Kaboom")).when(consumer).onCharReceived(
                 Mockito.any(CharBuffer.class), Mockito.any(IOControl.class));
@@ -297,7 +297,7 @@ public class TestAsyncConsumers extends 
         HttpHost target = start();
         HttpAsyncRequestProducer httppost = HttpAsyncMethods.createPost(
                 target.toURI() + "/echo/stuff", "stuff",
-                ContentType.create("text/plain", HTTP.ASCII));
+                ContentType.create("text/plain", Consts.ASCII));
         BufferingCharConsumer consumer = Mockito.spy(new BufferingCharConsumer());
         Mockito.doThrow(new HttpException("Kaboom")).when(consumer).buildResult(Mockito.any(HttpContext.class));
 

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/methods/TestZeroCopy.java
Sat May  5 17:34:54 2012
@@ -169,7 +169,7 @@ public class TestZeroCopy extends HttpAs
         private final boolean forceChunking;
 
         protected TestZeroCopyPost(final String requestURI, final boolean forceChunking)
{
-            super(URI.create(requestURI), TEST_FILE, ContentType.create("text/plain", null));
+            super(URI.create(requestURI), TEST_FILE, ContentType.create("text/plain"));
             this.forceChunking = forceChunking;
         }
 
@@ -248,7 +248,7 @@ public class TestZeroCopy extends HttpAs
             }
             if (ok) {
                 NFileEntity responseEntity = new NFileEntity(TEST_FILE,
-                        ContentType.create("text/plian", null));
+                        ContentType.create("text/plian"));
                 if (this.forceChunking) {
                     responseEntity.setChunked(true);
                 }

Modified: httpcomponents/httpasyncclient/trunk/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/pom.xml?rev=1334458&r1=1334457&r2=1334458&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/pom.xml (original)
+++ httpcomponents/httpasyncclient/trunk/pom.xml Sat May  5 17:34:54 2012
@@ -71,10 +71,10 @@
     <maven.compile.target>1.5</maven.compile.target>
     <maven.compile.optimize>true</maven.compile.optimize>
     <maven.compile.deprecation>true</maven.compile.deprecation>
-    <httpcore.version>4.2-beta1</httpcore.version>
+    <httpcore.version>4.2</httpcore.version>
     <httpclient.version>4.2-beta1</httpclient.version>
     <commons-logging.version>1.1.1</commons-logging.version>
-    <commons-io.version>2.0.1</commons-io.version>
+    <commons-io.version>2.3</commons-io.version>
     <junit.version>4.8.1</junit.version>
     <mockito.version>1.8.5</mockito.version>
   </properties>



Mime
View raw message