Package org.apache.http.impl.conn.tsccm

Examples of org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.releaseConnection()


        // the connection is expected to be released back to the manager
        ManagedClientConnection conn2 = getConnection(mgr, route, 5L, TimeUnit.SECONDS);
        Assert.assertFalse("connection should have been closed", conn2.isOpen());

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }

    private static class LatchSupport {
        private final CountDownLatch continueLatch;
View Full Code Here


       
        // the connection is expected to be released back to the manager
        ManagedClientConnection conn2 = getConnection(mgr, route, 5L, TimeUnit.SECONDS);
        assertFalse("connection should have been closed", conn2.isOpen());

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortBeforeSocketCreate() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
View Full Code Here

       
        // the connection is expected to be released back to the manager
        ManagedClientConnection conn2 = getConnection(mgr, route, 5L, TimeUnit.SECONDS);
        assertFalse("connection should have been closed", conn2.isOpen());

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortAfterSocketConnect() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
View Full Code Here

       
        // the connection is expected to be released back to the manager
        ManagedClientConnection conn2 = getConnection(mgr, route, 5L, TimeUnit.SECONDS);
        assertFalse("connection should have been closed", conn2.isOpen());

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    public void testAbortAfterOperatorOpen() throws Exception {
        HttpParams mgrpar = defaultParams.copy();
View Full Code Here

       
        // the connection is expected to be released back to the manager
        ManagedClientConnection conn2 = getConnection(mgr, route, 5L, TimeUnit.SECONDS);
        assertFalse("connection should have been closed", conn2.isOpen());

        mgr.releaseConnection(conn2, -1, null);
        mgr.shutdown();
    }
   
    private static class LatchSupport {
        private final CountDownLatch continueLatch;
View Full Code Here

        ManagedClientConnection conn = getConnection(mgr, route);
        assertNotNull(conn);
        assertNull(conn.getRoute());
        assertFalse(conn.isOpen());

        mgr.releaseConnection(conn, -1, null);

        try {
            conn = getConnection(mgr, null);
            fail("null route not detected");
        } catch (IllegalArgumentException iax) {
View Full Code Here

        } catch (ConnectionPoolTimeoutException e) {
            // expected
        }
       
        // release one of the connections
        mgr.releaseConnection(conn2, -1, null);
        conn2 = null;

        // there should be a connection available now
        try {
            conn2 = getConnection(mgr, route2, 100L, TimeUnit.MILLISECONDS);
View Full Code Here

        }


        // check releaseConnection with invalid arguments
        try {
            mgr.releaseConnection(null, -1, null);
            fail("null connection adapter not detected");
        } catch (IllegalArgumentException iax) {
            // expected
        }
        try {
View Full Code Here

            fail("null connection adapter not detected");
        } catch (IllegalArgumentException iax) {
            // expected
        }
        try {
            mgr.releaseConnection(new ClientConnAdapterMockup(null), -1, null);
            fail("foreign connection adapter not detected");
        } catch (IllegalArgumentException iax) {
            // expected
        }
View Full Code Here

        } catch (ConnectionPoolTimeoutException e) {
            // expected
        }

        // now release one and check that exactly that one can be obtained then
        mgr.releaseConnection(conn2, -1, null);
        conn2 = null;
        try {
            getConnection(mgr, route1, 10L, TimeUnit.MILLISECONDS);
            fail("ConnectionPoolTimeoutException should have been thrown");
        } catch (ConnectionPoolTimeoutException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.