@Test
    public void test_b_Sync() throws InterruptedException {
        RequestBody req = new RequestBody(1, "hello world sync");
        for (int i = 0; i < invokeTimes; i++) {
            try {
                String res = (String) client.invokeSync(addr, req, 3000);
                logger.warn("Result received in sync: " + res);
                Assert.assertEquals(RequestBody.DEFAULT_SERVER_RETURN_STR, res);
            } catch (RemotingException e) {
                String errMsg = "RemotingException caught in sync!";
                logger.error(errMsg, e);
                Assert.fail(errMsg);
            } catch (InterruptedException e) {
                String errMsg = "InterruptedException caught in sync!";
                logger.error(errMsg, e);
                Assert.fail(errMsg);
            }
        }

        Assert.assertTrue(serverConnectProcessor.isConnected());
        Assert.assertEquals(2, serverConnectProcessor.getConnectTimes());
        Assert.assertEquals(invokeTimes * 2, serverUserProcessor.getInvokeTimes());
    }
basic usage test

each test shared the same server

@author xiaomin.cxm
@version $Id: BasicUsage_SHARE_SAME_SERVER_Test.java, v 0.1 Apr 6, 2016 8:58:36 PM xiaomin.cxm Exp $
src/test/java/com/alipay/remoting/rpc/BasicUsage_SHARE_SAME_SERVER_Test.java