@Test
    public void testConnectionCloseAndConnectionManagerRemove() throws RemotingException,
                                                               InterruptedException {
        final Url addr = new Url(ip, port);

        this.addressParser.initUrlArgs(addr);
        Connection conn = null;
        try {
            conn = cm.getAndCreateIfAbsent(addr);
        } catch (InterruptedException e) {
            Assert.fail("InterruptedException!");
        }

        Assert.assertEquals(1, cm.count(addr.getUniqueKey()));
        conn.close();
        Thread.sleep(100);
        Assert.assertEquals(0, cm.count(addr.getUniqueKey()));
    }
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