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 |