hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1405509 [3/3] - in /httpcomponents/httpclient/trunk: fluent-hc/src/main/java/org/apache/http/client/fluent/ httpclient/src/examples/org/apache/http/examples/client/ httpclient/src/main/java/org/apache/http/client/ httpclient/src/main/java/...
Date Sun, 04 Nov 2012 07:40:03 GMT
Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java
Sun Nov  4 07:40:00 2012
@@ -44,7 +44,7 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.params.ClientPNames;
 import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -88,7 +88,7 @@ public class TestClientRequestExecution 
 
         HttpHost target = new HttpHost("localhost", port);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         this.httpclient.getParams().setParameter(ClientPNames.DEFAULT_HOST, target);
 
         String s = "/path";
@@ -110,7 +110,7 @@ public class TestClientRequestExecution 
         String s = "http://localhost:" + port;
         HttpGet httpget = new HttpGet(s);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         HttpResponse response = this.httpclient.execute(getServerHttp(), httpget, context);
         EntityUtils.consume(response.getEntity());
 
@@ -136,7 +136,7 @@ public class TestClientRequestExecution 
         String s = "http://localhost:" + port;
         HttpGet httpget = new HttpGet(s);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         String virtHost = "virtual";
         httpget.getParams().setParameter(ClientPNames.VIRTUAL_HOST, new HttpHost(virtHost,
port));
         HttpResponse response = this.httpclient.execute(getServerHttp(), httpget, context);
@@ -166,7 +166,7 @@ public class TestClientRequestExecution 
         String s = "http://localhost:" + port;
         HttpGet httpget = new HttpGet(s);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         String virtHost = "virtual";
         int virtPort = 9876;
         httpget.getParams().setParameter(ClientPNames.VIRTUAL_HOST, new HttpHost(virtHost,
virtPort));
@@ -194,7 +194,7 @@ public class TestClientRequestExecution 
         String s = "http://localhost:" + port;
         HttpGet httpget = new HttpGet(s);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         String virtHost = "virtual";
         this.httpclient.getParams().setParameter(ClientPNames.VIRTUAL_HOST, new HttpHost(virtHost,
port));
         HttpResponse response = this.httpclient.execute(getServerHttp(), httpget, context);
@@ -219,7 +219,7 @@ public class TestClientRequestExecution 
         HttpHost target1 = new HttpHost("whatever", 80);
         HttpHost target2 = new HttpHost("localhost", port);
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         this.httpclient.getParams().setParameter(ClientPNames.DEFAULT_HOST, target1);
 
         String s = "/path";
@@ -284,7 +284,7 @@ public class TestClientRequestExecution 
 
         };
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .addInterceptorFirst(interceptor)
             .setRequestExecutor(new FaultyHttpRequestExecutor("Oppsie"))
             .setRetryHandler(requestRetryHandler)
@@ -324,7 +324,7 @@ public class TestClientRequestExecution 
 
         };
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setRequestExecutor(new FaultyHttpRequestExecutor("a message showing that this
failed"))
             .setRetryHandler(requestRetryHandler)
             .build();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionAutoRelease.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionAutoRelease.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionAutoRelease.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionAutoRelease.java
Sun Nov  4 07:40:00 2012
@@ -40,12 +40,12 @@ import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.MalformedChunkCodingException;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.conn.ConnectionRequest;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
+import org.apache.http.conn.ConnectionRequest;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.entity.BasicHttpEntity;
 import org.apache.http.impl.DefaultHttpServerConnection;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.pool.PoolStats;
 import org.apache.http.protocol.ExecutionContext;
@@ -64,7 +64,7 @@ public class TestConnectionAutoRelease e
     public void setUp() throws Exception {
         startServer();
         this.mgr = new PoolingHttpClientConnectionManager();
-        this.httpclient = new HttpClientBuilder().setConnectionManager(this.mgr).build();
+        this.httpclient = HttpClients.custom().setConnectionManager(this.mgr).build();
     }
 
     @Test

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestContentCodings.java
Sun Nov  4 07:40:00 2012
@@ -52,7 +52,7 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.BasicResponseHandler;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
@@ -95,7 +95,7 @@ public class TestContentCodings extends 
             }
         });
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
         Assert.assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusLine().getStatusCode());
@@ -115,7 +115,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createDeflateEncodingRequestHandler(entityText, false));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
@@ -136,7 +136,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createDeflateEncodingRequestHandler(entityText, true));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
@@ -155,7 +155,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createGzipEncodingRequestHandler(entityText));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
@@ -184,7 +184,7 @@ public class TestContentCodings extends 
         PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
         cm.setMaxTotal(clients);
 
-        this.httpclient = new HttpClientBuilder().setConnectionManager(cm).build();
+        this.httpclient = HttpClients.custom().setConnectionManager(cm).build();
 
         ExecutorService executor = Executors.newFixedThreadPool(clients);
 
@@ -228,7 +228,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createGzipEncodingRequestHandler(entityText));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
@@ -251,7 +251,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createDeflateEncodingRequestHandler(entityText, true));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         HttpResponse response = this.httpclient.execute(getServerHttp(), request);
@@ -268,7 +268,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createGzipEncodingRequestHandler(entityText));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         String response = this.httpclient.execute(getServerHttp(), request, new BasicResponseHandler());
@@ -281,7 +281,7 @@ public class TestContentCodings extends 
 
         this.localServer.register("*", createDeflateEncodingRequestHandler(entityText, false));
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpGet request = new HttpGet("/some-resource");
         String response = this.httpclient.execute(getServerHttp(), request, new BasicResponseHandler());

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookie2Support.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookie2Support.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookie2Support.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookie2Support.java
Sun Nov  4 07:40:00 2012
@@ -45,7 +45,7 @@ import org.apache.http.cookie.SM;
 import org.apache.http.cookie.SetCookie2;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -64,7 +64,7 @@ public class TestCookie2Support extends 
     @Before
     public void setUp() throws Exception {
         startServer();
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
     }
 
     private static class CookieVer0Service implements HttpRequestHandler {

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestIdleConnectionEviction.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestIdleConnectionEviction.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestIdleConnectionEviction.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestIdleConnectionEviction.java
Sun Nov  4 07:40:00 2012
@@ -37,7 +37,7 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.conn.HttpClientConnectionManager;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.localserver.LocalServerTestBase;
 import org.apache.http.localserver.LocalTestServer;
@@ -60,7 +60,7 @@ public class TestIdleConnectionEviction 
         cm.setDefaultMaxPerRoute(10);
         cm.setMaxTotal(50);
 
-        HttpClient httpclient = new HttpClientBuilder().setConnectionManager(cm).build();
+        HttpClient httpclient = HttpClients.custom().setConnectionManager(cm).build();
 
         IdleConnectionMonitor idleConnectionMonitor = new IdleConnectionMonitor(cm);
         idleConnectionMonitor.start();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java
Sun Nov  4 07:40:00 2012
@@ -50,7 +50,7 @@ import org.apache.http.client.protocol.C
 import org.apache.http.cookie.SM;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.cookie.BasicClientCookie;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.protocol.BasicHttpContext;
@@ -71,7 +71,7 @@ public class TestRedirects extends Integ
     @Before
     public void setUp() throws Exception {
         startServer();
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.createDefault();
     }
 
     private static class BasicRedirectService implements HttpRequestHandler {

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java
Sun Nov  4 07:40:00 2012
@@ -45,13 +45,12 @@ import org.apache.http.entity.StringEnti
 import org.apache.http.impl.auth.SPNegoScheme;
 import org.apache.http.impl.auth.SPNegoSchemeFactory;
 import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicHeader;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.util.EntityUtils;
-
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSManager;
@@ -64,7 +63,7 @@ import org.mockito.Matchers;
 import org.mockito.Mockito;
 
 /**
- * Tests for {@link NegotiateScheme}.
+ * Tests for {@link SPNegoScheme}.
  */
 public class TestSPNegoScheme extends IntegrationTestBase {
 
@@ -164,7 +163,7 @@ public class TestSPNegoScheme extends In
         Credentials use_jaas_creds = new UseJaasCredentials();
         credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds);
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .registerAuthScheme(AuthPolicy.SPNEGO, nsf)
             .setCredentialsProvider(credentialsProvider)
             .build();
@@ -196,7 +195,7 @@ public class TestSPNegoScheme extends In
         Credentials use_jaas_creds = new UseJaasCredentials();
         credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds);
         
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .registerAuthScheme(AuthPolicy.SPNEGO, nsf)
             .setCredentialsProvider(credentialsProvider)
             .build();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java
Sun Nov  4 07:40:00 2012
@@ -37,7 +37,7 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.UserTokenHandler;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpConnectionParams;
@@ -104,7 +104,7 @@ public class TestStatefulConnManagement 
 
         };
         
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setConnectionManager(mgr)
             .setUserTokenHandler(userTokenHandler)
             .build();
@@ -235,7 +235,7 @@ public class TestStatefulConnManagement 
 
         };
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setConnectionManager(connMngr)
             .setUserTokenHandler(userTokenHandler)
             .build();



Mime
View raw message