@Test
    public void testCheckAndConnection() throws InterruptedException {
        Assert.assertFalse(client.checkConnection(addr));
        Assert.assertTrue(client.checkConnection(addr, true));
        try {
            client.getConnection(addr, 1);
        } catch (RemotingException e) {
            Assert.fail("should not reach here");
        }

        Assert.assertTrue(client.checkConnection(addr));
        client.closeConnection(addr);
        Assert.assertFalse(client.checkConnection(addr));

        Assert.assertTrue(client.checkConnection(addr, true, false));
        Thread.sleep(100);
        try {
            Connection connection = client.getConnection(addr, 1);
            Assert.assertNotNull(connection);

            client.closeConnection(addr);
        } catch (RemotingException e) {
            Assert.fail("should not reach here");
        }
    }
@author tsui
@version $Id: ClientConnectionTest.java, v 0.1 2017-09-13 14:20 tsui Exp $
src/test/java/com/alipay/remoting/rpc/client/ClientConnectionTest.java