use of org.apache.dubbo.rpc.support.MyInvoker in project dubbo by alibaba.
the class AbstractProxyTest method testGetProxy.
@Test
public void testGetProxy() throws Exception {
URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
Invoker<DemoService> invoker = new MyInvoker<>(url);
DemoService proxy = factory.getProxy(invoker);
Assertions.assertNotNull(proxy);
Assertions.assertTrue(Arrays.asList(proxy.getClass().getInterfaces()).contains(DemoService.class));
// Not equal
// Assertions.assertEquals(proxy.toString(), invoker.toString());
// Assertions.assertEquals(proxy.hashCode(), invoker.hashCode());
Assertions.assertEquals(invoker.invoke(new RpcInvocation("echo", DemoService.class.getName(), DemoService.class.getName() + ":dubbo", new Class[] { String.class }, new Object[] { "aa" })).getValue(), proxy.echo("aa"));
}
use of org.apache.dubbo.rpc.support.MyInvoker in project dubbo by alibaba.
the class ActiveLimitFilterTest method testInvokeNoActives.
@Test
public void testInvokeNoActives() {
URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&actives=0");
Invoker<ActiveLimitFilterTest> invoker = new MyInvoker<ActiveLimitFilterTest>(url);
Invocation invocation = new MockInvocation();
activeLimitFilter.invoke(invoker, invocation);
}
use of org.apache.dubbo.rpc.support.MyInvoker in project dubbo by alibaba.
the class ContextFilterTest method testWithAttachments.
@Test
public void testWithAttachments() {
URL url = URL.valueOf("test://test:11/test?group=dubbo&version=1.1");
Invoker<DemoService> invoker = new MyInvoker<DemoService>(url);
Invocation invocation = new MockInvocation();
Result result = contextFilter.invoke(invoker, invocation);
assertNull(RpcContext.getContext().getInvoker());
}
use of org.apache.dubbo.rpc.support.MyInvoker in project dubbo by alibaba.
the class TpsLimitFilterTest method testWithoutCount.
@Test
public void testWithoutCount() throws Exception {
URL url = URL.valueOf("test://test");
url = url.addParameter(INTERFACE_KEY, "org.apache.dubbo.rpc.file.TpsService");
url = url.addParameter(TPS_LIMIT_RATE_KEY, 5);
Invoker<TpsLimitFilterTest> invoker = new MyInvoker<TpsLimitFilterTest>(url);
Invocation invocation = new MockInvocation();
filter.invoke(invoker, invocation);
}
use of org.apache.dubbo.rpc.support.MyInvoker in project dubbo by alibaba.
the class AccessLogFilterTest method testCustom.
@Test
public void testCustom() {
URL url = URL.valueOf("test://test:11/test?accesslog=custom-access.log");
Invoker<AccessLogFilterTest> invoker = new MyInvoker<AccessLogFilterTest>(url);
Invocation invocation = new MockInvocation();
accessLogFilter.invoke(invoker, invocation);
}
Aggregations