hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r646918 - in /httpcomponents/httpclient/trunk/module-client/src: main/java/org/apache/http/conn/ main/java/org/apache/http/impl/conn/ main/java/org/apache/http/impl/conn/tsccm/ test/java/org/apache/http/impl/conn/ test/java/org/apache/http/...
Date Thu, 10 Apr 2008 18:30:18 GMT
Author: olegk
Date: Thu Apr 10 11:30:12 2008
New Revision: 646918

URL: http://svn.apache.org/viewvc?rev=646918&view=rev
Log:
HTTPCLIENT-652: 

* Reverting most of my previous changes. Passing a state object to the connection manager
when trying to obtain a connection is completely pointless, as usually connection state information
becomes available only after the connection has been established, for instance, after having
been challenged by an authenticating server. Therefore, it is necessary to be able to set
a state object on an active connection
* added method to set state object on ManagedClientConnection

Removed:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/ConnRoute.java
Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ManagedClientConnection.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
    httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ClientConnAdapterMockup.java
    httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMNoServer.java
    httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestDumbHelpers.java
    httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestWaitingThread.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ManagedClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ManagedClientConnection.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ManagedClientConnection.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/ManagedClientConnection.java
Thu Apr 10 11:30:12 2008
@@ -229,5 +229,11 @@
     boolean isMarkedReusable()
         ;
 
+    void setState(Object state)
+        ;
+    
+    boolean isStateful()
+        ;
+    
 
 } // interface ManagedClientConnection

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
Thu Apr 10 11:30:12 2008
@@ -75,7 +75,10 @@
     //@@@ currently accessed from connection manager(s) as attribute
     //@@@ avoid that, derived classes should decide whether update is allowed
     //@@@ SCCM: yes, TSCCM: no
-    protected volatile ConnRoute route;
+    protected volatile HttpRoute route;
+    
+    /** Connection state object */
+    protected volatile Object state;
     
     /** The tracked route, or <code>null</code> before tracking starts. */
     protected volatile RouteTracker tracker;
@@ -89,7 +92,7 @@
      *                or <code>null</code>
      */
     protected AbstractPoolEntry(OperatedClientConnection occ,
-                                ConnRoute route) {
+                                HttpRoute route) {
         this.connection = occ;
         this.route = route;
         this.tracker = null;

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
Thu Apr 10 11:30:12 2008
@@ -170,5 +170,16 @@
         }
     }
 
+    // non-javadoc, see interface ManagedClientConnection        
+    public boolean isStateful() {
+        assertAttached();
+        return poolEntry.state != null;
+    }
+
+    // non-javadoc, see interface ManagedClientConnection        
+    public void setState(final Object state) {
+        poolEntry.state = state;
+    }
+    
 
 } // class AbstractPooledConnAdapter

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
Thu Apr 10 11:30:12 2008
@@ -239,7 +239,7 @@
             }
         }
 
-        managedConn = new ConnAdapter(uniquePoolEntry, new ConnRoute(route, state));
+        managedConn = new ConnAdapter(uniquePoolEntry, route);
 
         return managedConn;
     }
@@ -420,11 +420,12 @@
          * @param entry   the pool entry for the connection being wrapped
          * @param plan    the planned route for this connection
          */
-        protected ConnAdapter(PoolEntry entry, ConnRoute route) {
+        protected ConnAdapter(PoolEntry entry, HttpRoute route) {
             super(SingleClientConnManager.this, entry);
             markReusable();
             entry.route = route;
         }
+
     }
 
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
Thu Apr 10 11:30:12 2008
@@ -47,9 +47,9 @@
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
 import org.apache.http.conn.OperatedClientConnection;
+import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.params.HttpParams;
 import org.apache.http.impl.conn.IdleConnectionHandler;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -209,10 +209,14 @@
      *         if the calling thread was interrupted
      */
     public final
-        BasicPoolEntry getEntry(ConnRoute route, long timeout, TimeUnit tunit,
-                                ClientConnectionOperator operator)
-        throws ConnectionPoolTimeoutException, InterruptedException {
-        return newPoolEntryRequest().getPoolEntry(route, timeout, tunit, operator);
+        BasicPoolEntry getEntry(
+                HttpRoute route, 
+                Object state,
+                long timeout, 
+                TimeUnit tunit,
+                ClientConnectionOperator operator)
+                    throws ConnectionPoolTimeoutException, InterruptedException {
+        return newPoolEntryRequest().getPoolEntry(route, state, timeout, tunit, operator);
     }
     
     /**
@@ -247,7 +251,7 @@
                 //@@@ flag in the BasicPoolEntryRef, to be reset when freed?
                 final boolean lost = issuedConnections.remove(ref);
                 if (lost) {
-                    final ConnRoute route =
+                    final HttpRoute route =
                         ((BasicPoolEntryRef)ref).getRoute();
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Connection garbage collected. " + route);
@@ -274,7 +278,7 @@
      *
      * @param route     the route of the pool entry that was lost
      */
-    protected abstract void handleLostEntry(ConnRoute route)
+    protected abstract void handleLostEntry(HttpRoute route)
         ;
 
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntry.java
Thu Apr 10 11:30:12 2008
@@ -35,8 +35,8 @@
 
 import org.apache.http.conn.OperatedClientConnection;
 import org.apache.http.conn.ClientConnectionOperator;
+import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.conn.AbstractPoolEntry;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -67,7 +67,7 @@
      *                or <code>null</code>
      */
     public BasicPoolEntry(ClientConnectionOperator op,
-                          ConnRoute route,
+                          HttpRoute route,
                           ReferenceQueue<Object> queue) {
         //@@@ create connection in base? or delay creation until needed?
         super(op.createConnection(), route);
@@ -92,7 +92,7 @@
         return super.connection;
     }
 
-    protected final ConnRoute getPlannedRoute() {
+    protected final HttpRoute getPlannedRoute() {
         return super.route;
     }
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java
Thu Apr 10 11:30:12 2008
@@ -34,7 +34,7 @@
 import java.lang.ref.WeakReference;
 import java.lang.ref.ReferenceQueue;
 
-import org.apache.http.impl.conn.ConnRoute;
+import org.apache.http.conn.routing.HttpRoute;
 
 
 
@@ -46,7 +46,7 @@
 public class BasicPoolEntryRef extends WeakReference<BasicPoolEntry> {
 
     /** The planned route of the entry. */
-    private final ConnRoute route;
+    private final HttpRoute route;
 
 
     /**
@@ -72,7 +72,7 @@
      *
      * @return      the planned route
      */
-    public final ConnRoute getRoute() {
+    public final HttpRoute getRoute() {
         return this.route;
     }
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Thu Apr 10 11:30:12 2008
@@ -46,7 +46,6 @@
 import org.apache.http.conn.ClientConnectionOperator;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
 import org.apache.http.conn.params.HttpConnectionManagerParams;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -84,7 +83,7 @@
      * Keys are of class {@link HttpRoute},
      * values of class {@link RouteSpecificPool}.
      */
-    protected final Map<ConnRoute, RouteSpecificPool> routeToPool;
+    protected final Map<HttpRoute, RouteSpecificPool> routeToPool;
 
 
 
@@ -128,8 +127,8 @@
      *
      * @return  a map
      */
-    protected Map<ConnRoute,RouteSpecificPool> createRouteToPoolMap() {
-        return new HashMap<ConnRoute, RouteSpecificPool>();
+    protected Map<HttpRoute, RouteSpecificPool> createRouteToPoolMap() {
+        return new HashMap<HttpRoute, RouteSpecificPool>();
     }
 
 
@@ -141,7 +140,7 @@
      *
      * @return  the new pool
      */
-    protected RouteSpecificPool newRouteSpecificPool(ConnRoute route) {
+    protected RouteSpecificPool newRouteSpecificPool(HttpRoute route) {
         return new RouteSpecificPool(route);
     }
 
@@ -170,7 +169,7 @@
      * @return  the pool for the argument route,
      *     never <code>null</code> if <code>create</code> is <code>true</code>
      */
-    protected RouteSpecificPool getRoutePool(ConnRoute route,
+    protected RouteSpecificPool getRoutePool(HttpRoute route,
                                              boolean create) {
         RouteSpecificPool rospl = null;
 
@@ -193,7 +192,7 @@
 
 
     //@@@ consider alternatives for gathering statistics
-    public int getConnectionsInPool(ConnRoute route) {
+    public int getConnectionsInPool(HttpRoute route) {
 
         try {
             poolLock.lock();
@@ -224,12 +223,13 @@
             }
             
             public BasicPoolEntry getPoolEntry(
-                    ConnRoute route, 
+                    HttpRoute route,
+                    Object state,
                     long timeout,
                     TimeUnit tunit, 
                     ClientConnectionOperator operator)
                         throws InterruptedException, ConnectionPoolTimeoutException {
-                return getEntryBlocking(route, timeout, tunit, operator, aborter);
+                return getEntryBlocking(route, state, timeout, tunit, operator, aborter);
             }
             
         };
@@ -256,14 +256,14 @@
      *         if the calling thread was interrupted
      */
     protected BasicPoolEntry getEntryBlocking(
-                                   ConnRoute route,
+                                   HttpRoute route, Object state,
                                    long timeout, TimeUnit tunit,
                                    ClientConnectionOperator operator,
                                    Aborter aborter)
         throws ConnectionPoolTimeoutException, InterruptedException {
 
         int maxHostConnections = HttpConnectionManagerParams
-            .getMaxConnectionsPerHost(this.params, route.getRoute());
+            .getMaxConnectionsPerHost(this.params, route);
         int maxTotalConnections = HttpConnectionManagerParams
             .getMaxTotalConnections(this.params);
         
@@ -363,7 +363,7 @@
     @Override
     public void freeEntry(BasicPoolEntry entry) {
 
-        ConnRoute route = entry.getPlannedRoute();
+        HttpRoute route = entry.getPlannedRoute();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Freeing connection. " + route);
         }
@@ -493,7 +493,7 @@
      */
     protected void deleteEntry(BasicPoolEntry entry) {
 
-        ConnRoute route = entry.getPlannedRoute();
+        HttpRoute route = entry.getPlannedRoute();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Deleting connection. " + route);
@@ -546,7 +546,7 @@
 
     // non-javadoc, see base class AbstractConnPool
     @Override
-    protected void handleLostEntry(ConnRoute route) {
+    protected void handleLostEntry(HttpRoute route) {
 
         try {
             poolLock.lock();

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
Thu Apr 10 11:30:12 2008
@@ -35,7 +35,6 @@
 import org.apache.http.conn.ClientConnectionOperator;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.impl.conn.ConnRoute;
 
 /**
  * Encapsulates a request for a {@link BasicPoolEntry}.
@@ -62,7 +61,8 @@
      *         if the calling thread was interrupted
      */
     BasicPoolEntry getPoolEntry(
-            ConnRoute route, 
+            HttpRoute route, 
+            Object state,
             long timeout, 
             TimeUnit unit,
             ClientConnectionOperator operator) 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
Thu Apr 10 11:30:12 2008
@@ -33,7 +33,7 @@
 import java.util.Queue;
 import java.util.LinkedList;
 
-import org.apache.http.impl.conn.ConnRoute;
+import org.apache.http.conn.routing.HttpRoute;
 
 
 /**
@@ -44,7 +44,7 @@
 public class RouteSpecificPool {
 
     /** The route this pool is for. */
-    protected final ConnRoute route;
+    protected final HttpRoute route;
 
     /**
      * The list of free entries.
@@ -65,7 +65,7 @@
      *
      * @param r     the route for which to pool
      */
-    public RouteSpecificPool(ConnRoute route) {
+    public RouteSpecificPool(HttpRoute route) {
         this.route = route;
         this.freeEntries = new LinkedList<BasicPoolEntry>();
         this.waitingThreads = new LinkedList<WaitingThread>();
@@ -78,7 +78,7 @@
      *
      * @return  the route
      */
-    public final ConnRoute getRoute() {
+    public final HttpRoute getRoute() {
         return route;
     }
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Thu Apr 10 11:30:12 2008
@@ -45,7 +45,6 @@
 import org.apache.http.conn.OperatedClientConnection;
 import org.apache.http.params.HttpParams;
 import org.apache.http.impl.conn.DefaultClientConnectionOperator;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -171,7 +170,7 @@
                 }
 
                 final BasicPoolEntry entry = poolRequest.getPoolEntry(
-                        new ConnRoute(route, state), timeout, tunit, connOperator);
+                        route, state, timeout, tunit, connOperator);
 
                 return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry);
             }
@@ -242,9 +241,9 @@
      *
      * @return  the total number of pooled connections for that route
      */
-    public int getConnectionsInPool(HttpRoute route, Object state) {
+    public int getConnectionsInPool(HttpRoute route) {
         return ((ConnPoolByRoute)connectionPool).getConnectionsInPool(
-                new ConnRoute(route, state));
+                route);
     }
 
 

Modified: httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ClientConnAdapterMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ClientConnAdapterMockup.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ClientConnAdapterMockup.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ClientConnAdapterMockup.java
Thu Apr 10 11:30:12 2008
@@ -75,4 +75,11 @@
         throw new UnsupportedOperationException("just a mockup");
     }
 
+    public boolean isStateful() {
+        throw new UnsupportedOperationException("just a mockup");
+    }
+
+    public void setState(Object state) {
+        throw new UnsupportedOperationException("just a mockup");
+    }
 }

Modified: httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMNoServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMNoServer.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMNoServer.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMNoServer.java
Thu Apr 10 11:30:12 2008
@@ -406,13 +406,13 @@
         assertEquals("connectionsInPool",
                      mgr.getConnectionsInPool(), 1);
         assertEquals("connectionsInPool(host)",
-                     mgr.getConnectionsInPool(route, null), 1);
+                     mgr.getConnectionsInPool(route), 1);
         mgr.releaseConnection(conn);
 
         assertEquals("connectionsInPool",
                      mgr.getConnectionsInPool(), 1);
         assertEquals("connectionsInPool(host)",
-                     mgr.getConnectionsInPool(route, null), 1);
+                     mgr.getConnectionsInPool(route), 1);
 
         // this implicitly deletes them
         mgr.closeIdleConnections(0L, TimeUnit.MILLISECONDS);
@@ -420,7 +420,7 @@
         assertEquals("connectionsInPool",
                      mgr.getConnectionsInPool(), 0);
         assertEquals("connectionsInPool(host)",
-                     mgr.getConnectionsInPool(route, null), 0);
+                     mgr.getConnectionsInPool(route), 0);
 
         mgr.shutdown();
     }

Modified: httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestDumbHelpers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestDumbHelpers.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestDumbHelpers.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestDumbHelpers.java
Thu Apr 10 11:30:12 2008
@@ -50,7 +50,6 @@
 import org.apache.http.conn.scheme.SocketFactory;
 import org.apache.http.conn.ClientConnectionOperator;
 import org.apache.http.impl.conn.DefaultClientConnectionOperator;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -114,13 +113,13 @@
             // expected
         }
 
-        bpe = new BasicPoolEntry(ccop, new ConnRoute(route, null), null);
+        bpe = new BasicPoolEntry(ccop, route, null);
         assertEquals ("wrong operator", ccop, bpe.getOperator());
-        assertEquals ("wrong route", route, bpe.getPlannedRoute().getRoute());
+        assertEquals ("wrong route", route, bpe.getPlannedRoute());
         assertNotNull("missing ref", bpe.getWeakRef());
 
         assertEquals("bad weak ref", bpe, bpe.getWeakRef().get());
-        assertEquals("bad ref route", route, bpe.getWeakRef().getRoute().getRoute());
+        assertEquals("bad ref route", route, bpe.getWeakRef().getRoute());
     }
 
 

Modified: httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestWaitingThread.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestWaitingThread.java?rev=646918&r1=646917&r2=646918&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestWaitingThread.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/tsccm/TestWaitingThread.java
Thu Apr 10 11:30:12 2008
@@ -40,7 +40,6 @@
 
 import org.apache.http.HttpHost;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.impl.conn.ConnRoute;
 
 
 
@@ -84,7 +83,7 @@
         assertNull  ("thread from nowhere", wt.getThread());
 
         HttpRoute         route = new HttpRoute(TARGET);
-        RouteSpecificPool rospl = new RouteSpecificPool(new ConnRoute(route, null));
+        RouteSpecificPool rospl = new RouteSpecificPool(route);
         wt = new WaitingThread(cnd, rospl);
         assertEquals("wrong condition", cnd, wt.getCondition());
         assertEquals("wrong pool", rospl, wt.getPool());



Mime
View raw message