use of com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker in project pinpoint by naver.
the class DubboProviderIT method testDoNotTrace.
@Test
public void testDoNotTrace() throws Exception {
when(rpcInvocation.getAttachment(DubboConstants.META_DO_NOT_TRACE)).thenReturn("1");
AbstractProxyInvoker abstractProxyInvoker = new AbstractProxyInvoker(new String(), String.class, url) {
@Override
protected Object doInvoke(Object proxy, String methodName, Class[] parameterTypes, Object[] arguments) throws Throwable {
Method method = proxy.getClass().getMethod(methodName, parameterTypes);
return method.invoke(proxy, arguments);
}
};
try {
abstractProxyInvoker.invoke(rpcInvocation);
} catch (RpcException ignore) {
ignore.printStackTrace();
}
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTraceCount(0);
}
use of com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker in project pinpoint by naver.
the class DubboProviderIT method testProvider.
@Test
public void testProvider() throws NoSuchMethodException {
AbstractProxyInvoker abstractProxyInvoker = new AbstractProxyInvoker(new String(), String.class, url) {
@Override
protected Object doInvoke(Object proxy, String methodName, Class[] parameterTypes, Object[] arguments) throws Throwable {
Method method = proxy.getClass().getMethod(methodName, parameterTypes);
return method.invoke(proxy, arguments);
}
};
try {
abstractProxyInvoker.invoke(rpcInvocation);
} catch (RpcException ignore) {
ignore.printStackTrace();
}
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTraceCount(1);
}
Aggregations