use of io.opentracing.mock.MockTracer in project wildfly-swarm by wildfly-swarm.
the class SkipPatternTest method noSpansForServletSpansMatchingSkipPattern.
@Test
public void noSpansForServletSpansMatchingSkipPattern() throws IOException {
MockTracer tracer = MockTracerResolver.TRACER_INSTANCE;
assertEquals(0, tracer.finishedSpans().size());
hitEndpoint("http://localhost:8080/_opentracing/hello");
assertEquals(2, tracer.finishedSpans().size());
// no new *servlet* spans are to be created for this, but business spans are still created
hitEndpoint("http://localhost:8080/_opentracing/health");
assertEquals(3, tracer.finishedSpans().size());
}
use of io.opentracing.mock.MockTracer in project wildfly-swarm by wildfly-swarm.
the class TraceResolverOnDeploymentTest method testAsyncEndpoint.
@Test
public void testAsyncEndpoint() throws IOException {
MockTracer tracer = MockTracerResolver.TRACER_INSTANCE;
assertEquals(0, tracer.finishedSpans().size());
hitEndpoint("http://localhost:8080/_opentracing/async");
assertEquals(1, tracer.finishedSpans().size());
}
use of io.opentracing.mock.MockTracer in project wildfly-swarm by wildfly-swarm.
the class TraceResolverOnDeploymentTest method testOneSpanIsReportedPerRequest.
@Test
public void testOneSpanIsReportedPerRequest() throws IOException {
MockTracer tracer = MockTracerResolver.TRACER_INSTANCE;
assertEquals(0, tracer.finishedSpans().size());
hitEndpoint("http://localhost:8080/_opentracing/hello");
assertEquals(2, tracer.finishedSpans().size());
}
use of io.opentracing.mock.MockTracer in project batfish by batfish.
the class WorkItemTest method initTracer.
@BeforeClass
public static void initTracer() {
_mockTracer = new MockTracer(new ThreadLocalActiveSpanSource(), Propagator.TEXT_MAP);
_noopTracer = NoopTracerFactory.create();
}
use of io.opentracing.mock.MockTracer in project motan by weibocom.
the class OpenTracingFilterTest method setUp.
@Before
public void setUp() throws Exception {
OTFilter = new OpenTracingFilter();
tracer = new MockTracer();
OpenTracingContext.tracerFactory = new TracerFactory() {
@Override
public Tracer getTracer() {
return tracer;
}
};
URL url = new URL("motan", "localhost", 8002, "HelloService");
request = new DefaultRequest();
request.setInterfaceName("HelloService");
request.setAttachment(URLParamType.group.name(), "test");
request.setMethodName("sayHello");
request.setParamtersDesc("java.lang.String");
response = new DefaultResponse();
refer = new AbstractReferer<HelloService>(HelloService.class, url) {
@Override
public void destroy() {
}
@Override
public boolean isAvailable() {
return true;
}
@Override
protected Response doCall(Request request) {
return response;
}
@Override
protected boolean doInit() {
return true;
}
};
provider = new DefaultProvider<HelloService>(new HelloServiceImpl(), url, HelloService.class) {
@Override
public Response call(Request request) {
return response;
}
};
}
Aggregations