Package com.alibaba.dubbo.common.logger

Examples of com.alibaba.dubbo.common.logger.Logger


public class ExceptionFilterTest {
   
    @SuppressWarnings("unchecked")
    @Test
    public void testRpcException() {
        Logger logger = EasyMock.createMock(Logger.class);
        RpcContext.getContext().setRemoteAddress("127.0.0.1", 1234);
        RpcException exception = new RpcException("TestRpcException");
        logger.error(EasyMock.eq("Got unchecked and undeclared exception which called by 127.0.0.1. 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);
        EasyMock.expect(invoker.getInterface()).andReturn(DemoService.class);
        EasyMock.expect(invoker.invoke(EasyMock.eq(invocation))).andThrow(exception);
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.common.logger.Logger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.