"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/test/java/org/apache/http/impl/conn/TestPoolingHttpClientConnectionManager.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

TestPoolingHttpClientConnectionManager.java  (httpcomponents-client-4.5.6-src):TestPoolingHttpClientConnectionManager.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 33 skipping to change at line 33
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
* *
*/ */
package org.apache.http.impl.conn; package org.apache.http.impl.conn;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpClientConnection; import org.apache.http.HttpClientConnection;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.config.ConnectionConfig; import org.apache.http.config.ConnectionConfig;
import org.apache.http.config.Lookup; import org.apache.http.config.Lookup;
skipping to change at line 150 skipping to change at line 151
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null ); final ConnectionRequest connRequest1 = mgr.requestConnection(route, null );
final HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS) ; final HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS) ;
Assert.assertNotNull(conn1); Assert.assertNotNull(conn1);
Assert.assertNotSame(conn, conn1); Assert.assertNotSame(conn, conn1);
mgr.releaseConnection(conn1, null, 0, TimeUnit.MILLISECONDS); mgr.releaseConnection(conn1, null, 0, TimeUnit.MILLISECONDS);
Mockito.verify(pool).release(entry, false); Mockito.verify(pool).release(entry, false);
} }
@Test(expected=InterruptedException.class) @Test(expected= ExecutionException.class)
public void testLeaseFutureCancelled() throws Exception { public void testLeaseFutureCancelled() throws Exception {
final HttpHost target = new HttpHost("localhost", 80); final HttpHost target = new HttpHost("localhost", 80);
final HttpRoute route = new HttpRoute(target); final HttpRoute route = new HttpRoute(target);
final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), " id", route, conn, final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), " id", route, conn,
-1, TimeUnit.MILLISECONDS); -1, TimeUnit.MILLISECONDS);
entry.markRouteComplete(); entry.markRouteComplete();
Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE); Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE);
Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry); Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)