@Test
    public void getServer() throws Exception {
        ServerSocket ss = null;
        try {
            ss = new ServerSocket();
            ss.bind(new InetSocketAddress(new ServerConfig().getHost(), 11234));

            boolean error = false;
            try {
                ServerConfig serverConfig1 = new ServerConfig().setProtocol("bolt").setPort(11234);
                ServerFactory.getServer(serverConfig1).start();
            } catch (Exception e) {
                error = true;
            }
            Assert.assertTrue(error);
            ServerFactory.destroyAll();

            error = false;
            try {
                ServerConfig serverConfig2 = new ServerConfig().setProtocol("bolt").setPort(11234)
                    .setAdaptivePort(true);
                ServerFactory.getServer(serverConfig2).start();
                Assert.assertEquals(11235, serverConfig2.getPort());
            } catch (Exception e) {
                error = true;
            }
            Assert.assertFalse(error);
            ServerFactory.destroyAll();
        } finally {
            if (ss != null) {
                ss.close();
            }
        }
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/server/IntegrationServerFactoryTest.java