@Test
    public void testCheckConnectionException() {
        final Url addr = new Url(ip, port);

        Connection conn = null;
        try {
            cm.check(conn);
            Assert.assertTrue(false);
        } catch (RemotingException e) {
            logger.error("Connection null", e);
            Assert.assertTrue(true);
        }

        try {
            this.addressParser.initUrlArgs(addr);
            conn = cm.getAndCreateIfAbsent(addr);
            Assert.assertEquals(1, cm.count(addr.getUniqueKey()));
            conn.close();
            Thread.sleep(100);
            cm.check(conn);
            Assert.assertTrue(false);
        } catch (RemotingException e) {
            // test  remove success when do check
            Assert.assertEquals(0, cm.count(addr.getUniqueKey()));
            Assert.assertTrue(true);
        } catch (InterruptedException e) {
            logger.error("", e);
        }
    }
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