提交 3d2836f7 编写于 作者: W william.liangf

DUBBO-377 修改测试

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@1724 1a56cb94-b969-4eaa-88fa-be21384802f2
上级 880128da
......@@ -84,6 +84,10 @@ public class ExceptionFilter implements Filter {
if (className.startsWith("java.") || className.startsWith("javax.")) {
return result;
}
// 是Dubbo本身的异常,直接抛出
if (exception instanceof RpcException) {
return result;
}
// 否则,包装成RuntimeException抛给客户端
return new RpcResult(new RuntimeException(StringUtils.toString(exception)));
} catch (Throwable e) {
......
......@@ -38,7 +38,7 @@ public class ExceptionFilterTest {
public void testRpcException() {
Logger logger = EasyMock.createMock(Logger.class);
RpcException exception = new RpcException("TestRpcException");
logger.error(EasyMock.eq("Got unchecked and undeclare service " + DemoService.class.getName() + " method sayHello invoke exception: TestRpcException"), EasyMock.eq(exception));
logger.error(EasyMock.eq("Got unchecked and undeclared exception. service: " + DemoService.class.getName() + ", method: sayHello, exception: " + RpcException.class.getName() + ": TestRpcException"), EasyMock.eq(exception));
ExceptionFilter exceptionFilter = new ExceptionFilter(logger);
RpcInvocation invocation = new RpcInvocation("sayHello", new Class<?>[]{String.class}, new Object[]{"world"});
Invoker<DemoService> invoker = EasyMock.createMock(Invoker.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册