@Test
    public void testCallBackException() throws InterruptedException {
        server.registerUserProcessor(new ExceptionUserProcessor());
        RequestBody b3 = new RequestBody(3, "Hello world!");
        final CountDownLatch latch = new CountDownLatch(1);
        final List<Throwable> ret = new ArrayList<Throwable>(1);
        try {
            client.invokeWithCallback(addr, b3, new InvokeCallback() {

                @Override
                public void onResponse(Object result) {
                    Assert.fail("Should not reach here!");
                }

                @Override
                public void onException(Throwable e) {
                    logger.error("Error in callback", e);
                    ret.add(e);
                    latch.countDown();
                }

                @Override
                public Executor getExecutor() {
                    return null;
                }

            }, 1000);

        } catch (InvokeServerException e) {
            Assert.assertTrue(true);
        } catch (RemotingException e) {
            String errMsg = "InterruptedException in testCallBackException";
            logger.error(errMsg);
            Assert.fail(errMsg);
        }
        latch.await();
        Assert.assertEquals(InvokeServerException.class, ret.get(0).getClass());
    }
exception test

@author xiaomin.cxm
@version $Id: ExceptionTest.java, v 0.1 Apr 6, 2016 9:41:53 PM xiaomin.cxm Exp $
src/test/java/com/alipay/remoting/rpc/exception/ExceptionTest.java