Search in sources :

Example 1 with FailoverClusterInvoker

use of com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker in project pinpoint by naver.

the class DubboConsumerIT method testConsumer.

@Test
public void testConsumer() throws NoSuchMethodException {
    abstractClusterInvoker = new FailoverClusterInvoker(directory);
    when(abstractClusterInvoker.getInterface()).thenReturn(String.class);
    try {
        abstractClusterInvoker.invoke(rpcInvocation);
    } catch (RpcException ignore) {
    // ignore
    }
    PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
    verifier.printCache();
    Method invoke = AbstractClusterInvoker.class.getMethod("invoke", Invocation.class);
    verifier.verifyTrace(Expectations.event("DUBBO_CONSUMER", invoke));
    verifier.verifyTraceCount(0);
}
Also used : FailoverClusterInvoker(com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker) RpcException(com.alibaba.dubbo.rpc.RpcException) Method(java.lang.reflect.Method) PluginTestVerifier(com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier) Test(org.junit.Test)

Example 2 with FailoverClusterInvoker

use of com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker in project pinpoint by naver.

the class DubboConsumerIT method testConsumerMonitor.

@Test
public void testConsumerMonitor() {
    abstractClusterInvoker = new FailoverClusterInvoker(directory);
    when(abstractClusterInvoker.getInterface()).thenReturn(MonitorService.class);
    try {
        abstractClusterInvoker.invoke(rpcInvocation);
    } catch (RpcException ignore) {
    // ignore
    }
    PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
    verifier.printCache();
    verifier.verifyTraceCount(0);
}
Also used : FailoverClusterInvoker(com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker) RpcException(com.alibaba.dubbo.rpc.RpcException) PluginTestVerifier(com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier) Test(org.junit.Test)

Aggregations

RpcException (com.alibaba.dubbo.rpc.RpcException)2 FailoverClusterInvoker (com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker)2 PluginTestVerifier (com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier)2 Test (org.junit.Test)2 Method (java.lang.reflect.Method)1