"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/test/java/org/apache/http/impl/conn/TestBasicHttpClientConnectionManager.java" between
httpcomponents-client-4.5.5-src.tar.gz and httpcomponents-client-4.5.6-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. (Web) Server ("httpd").

TestBasicHttpClientConnectionManager.java  (httpcomponents-client-4.5.5-src):TestBasicHttpClientConnectionManager.java  (httpcomponents-client-4.5.6-src)
skipping to change at line 281 skipping to change at line 281
Mockito.verify(connFactory, Mockito.times(1)).create( Mockito.verify(connFactory, Mockito.times(1)).create(
Mockito.eq(route), Mockito.<ConnectionConfig>any()); Mockito.eq(route), Mockito.<ConnectionConfig>any());
Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE); Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE);
mgr.releaseConnection(conn1, null, 0, TimeUnit.MILLISECONDS); mgr.releaseConnection(conn1, null, 0, TimeUnit.MILLISECONDS);
mgr.shutdown(); mgr.shutdown();
Mockito.verify(conn, Mockito.times(1)).shutdown(); Mockito.verify(conn, Mockito.times(1)).close();
try { try {
final ConnectionRequest connRequest2 = mgr.requestConnection(route, null); final ConnectionRequest connRequest2 = mgr.requestConnection(route, null);
connRequest2.get(0, TimeUnit.MILLISECONDS); connRequest2.get(0, TimeUnit.MILLISECONDS);
Assert.fail("IllegalStateException expected"); Assert.fail("IllegalStateException expected");
} catch (final IllegalStateException ex) { } catch (final IllegalStateException ex) {
} }
// Should have no effect // Should have no effect
mgr.closeExpiredConnections(); mgr.closeExpiredConnections();
mgr.closeIdleConnections(0L, TimeUnit.MILLISECONDS); mgr.closeIdleConnections(0L, TimeUnit.MILLISECONDS);
mgr.shutdown(); mgr.shutdown();
Mockito.verify(conn, Mockito.times(1)).shutdown(); Mockito.verify(conn, Mockito.times(1)).close();
} }
@Test @Test
public void testCloseExpired() throws Exception { public void testCloseExpired() throws Exception {
final HttpHost target = new HttpHost("somehost", 80); final HttpHost target = new HttpHost("somehost", 80);
final HttpRoute route = new HttpRoute(target); final HttpRoute route = new HttpRoute(target);
Mockito.when(connFactory.create( Mockito.when(connFactory.create(
Mockito.eq(route), Mockito.<ConnectionConfig>any())).thenReturn( conn); Mockito.eq(route), Mockito.<ConnectionConfig>any())).thenReturn( conn);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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