@Test
    public void testServerSyncUsingConnection() throws Exception {
        Connection clientConn = client.createStandaloneConnection(ip, port, 1000);

        RequestBody req1 = new RequestBody(1, RequestBody.DEFAULT_CLIENT_STR);
        String serverres = (String) client.invokeSync(clientConn, req1, 1000);
        Assert.assertEquals(serverres, RequestBody.DEFAULT_SERVER_RETURN_STR);
        for (int i = 0; i < invokeTimes; i++) {
            new Thread() {
                public void run() {
                    try {
                        String remoteAddr = serverUserProcessor.getRemoteAddr();
                        Assert.assertNotNull(remoteAddr);
                        RequestBody req = new RequestBody(1, 1024);
                        for (int i = 0; i < invokeTimes; i++) {
                            String clientres = (String) server.getRpcServer().invokeSync(
                                remoteAddr, req, 1000);
                            Assert.assertEquals(clientres, RequestBody.DEFAULT_CLIENT_RETURN_STR);
                        }
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    } catch (RemotingException e) {
                        e.printStackTrace();
                    }
                }
            }.start();
        }
        Thread.sleep(5000);
        Assert.assertTrue(serverConnectProcessor.isConnected());
        Assert.assertEquals(1, serverConnectProcessor.getConnectTimes());
        Assert.assertEquals(invokeTimes * invokeTimes, clientUserProcessor.getInvokeTimes());
    }
water mark normal test, set a large enough buffer mark, and not trigger write over flow.

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