@Test
    public void testAddAndRemoveConnection() {
        String poolKey = ip + ":" + port;
        int connectTimeoutMillis = 1000;

        Connection conn = null;
        try {
            conn = cm.create(ip, port, connectTimeoutMillis);
            conn.addPoolKey(poolKey);
        } catch (Exception e) {
            logger.error("", e);
        }
        cm.add(conn);
        Assert.assertEquals(1, cm.count(poolKey));
        cm.remove(conn);
        Assert.assertEquals(0, cm.count(poolKey));
    }
Rpc connection manager test

@author xiaomin.cxm
@version $Id: RpcConnectionManagerTest.java, v 0.1 Mar 9, 2016 8:09:44 PM xiaomin.cxm Exp $
src/test/java/com/alipay/remoting/inner/connection/RpcConnectionManagerTest.java