@Test
    public void testReverseClientTransport() {
        ClientTransportConfig config = new ClientTransportConfig();
        config.setProviderInfo(new ProviderInfo().setHost("127.0.0.1").setPort(12222))
            .setContainer("test");
        TestClientTransport clientTransport = (TestClientTransport) ClientTransportFactory.getClientTransport(config);

        TestChannel serverChannel = new TestChannel(clientTransport.localAddress(), clientTransport.remoteAddress());

        TestClientTransport clientTransport2 = (TestClientTransport) ClientTransportFactory.
            getReverseClientTransport("test", serverChannel);

        Assert.assertEquals(serverChannel, clientTransport2.getChannel());

        String key = NetUtils.channelToString(serverChannel.remoteAddress(), serverChannel.localAddress());
        TestClientTransport clientTransport3 = (TestClientTransport)
                ClientTransportFactory.getReverseClientTransport(key);
        Assert.assertEquals(clientTransport2, clientTransport3);

        ClientTransportFactory.removeReverseClientTransport(key);
        TestClientTransport clientTransport4 = (TestClientTransport)
                ClientTransportFactory.getReverseClientTransport(key);
        Assert.assertNull(clientTransport4);

        ClientTransportFactory.closeAll();

        Assert.assertEquals(0, ClientTransportFactory.getClientTransportHolder().size());
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/transport/ClientTransportFactoryTest.java