Search in sources :

Example 1 with DemoServiceImpl

use of org.apache.dubbo.rpc.support.DemoServiceImpl in project dubbo by alibaba.

the class AbstractProxyTest method testGetInvoker.

@Test
public void testGetInvoker() throws Exception {
    URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
    DemoService origin = new org.apache.dubbo.rpc.support.DemoServiceImpl();
    Invoker<DemoService> invoker = factory.getInvoker(new DemoServiceImpl(), DemoService.class, url);
    Assertions.assertEquals(invoker.getInterface(), DemoService.class);
    Assertions.assertEquals(invoker.invoke(new RpcInvocation("echo", DemoService.class.getName(), DemoService.class.getName() + ":dubbo", new Class[] { String.class }, new Object[] { "aa" })).getValue(), origin.echo("aa"));
}
Also used : RpcInvocation(org.apache.dubbo.rpc.RpcInvocation) DemoService(org.apache.dubbo.rpc.support.DemoService) URL(org.apache.dubbo.common.URL) DemoServiceImpl(org.apache.dubbo.rpc.support.DemoServiceImpl) Test(org.junit.jupiter.api.Test)

Aggregations

URL (org.apache.dubbo.common.URL)1 RpcInvocation (org.apache.dubbo.rpc.RpcInvocation)1 DemoService (org.apache.dubbo.rpc.support.DemoService)1 DemoServiceImpl (org.apache.dubbo.rpc.support.DemoServiceImpl)1 Test (org.junit.jupiter.api.Test)1