use of io.opentracing.Scope in project jaeger-client-java by jaegertracing.
the class RemovedFrom032Test method testScopeManager_active.
@Test
public void testScopeManager_active() {
Span span = tracer.buildSpan(SPAN_NAME).start();
Scope scope = tracer.activateSpan(span);
try {
assertEquals(scope, tracer.scopeManager().active());
} finally {
scope.close();
}
}
use of io.opentracing.Scope in project jaeger-client-java by jaegertracing.
the class RemovedFrom032Test method testScopeManager_activate_and_finish.
@Test
public void testScopeManager_activate_and_finish() {
Span span = tracer.buildSpan(SPAN_NAME).start();
Scope scope = tracer.scopeManager().activate(span, true);
try {
assertEquals(scope, tracer.scopeManager().active());
} finally {
scope.close();
}
assertEquals(Collections.singletonList(span), reporter.getSpans());
}
use of io.opentracing.Scope in project jaeger-client-java by jaegertracing.
the class RemovedFrom032Test method testSpanBuilder_startActive.
@Test
public void testSpanBuilder_startActive() {
Scope scope = tracer.buildSpan(SPAN_NAME).startActive(true);
try {
assertEquals(scope.span(), tracer.activeSpan());
} finally {
scope.close();
}
assertEquals(Collections.singletonList(scope.span()), reporter.getSpans());
}
use of io.opentracing.Scope in project jaeger-client-java by jaegertracing.
the class RemovedFrom032Test method testScopeManager_activate_and_not_finish.
@Test
public void testScopeManager_activate_and_not_finish() {
Span span = tracer.buildSpan(SPAN_NAME).start();
Scope scope = tracer.scopeManager().activate(span, false);
try {
assertEquals(scope, tracer.scopeManager().active());
} finally {
scope.close();
}
assertEquals(0, reporter.getSpans().size());
}
use of io.opentracing.Scope in project jaeger-client-java by jaegertracing.
the class RemovedFrom032Test method testScope_span.
@Test
public void testScope_span() {
Span span = tracer.buildSpan(SPAN_NAME).start();
Scope scope = tracer.scopeManager().activate(span);
try {
assertEquals(span, scope.span());
} finally {
scope.close();
}
}
Aggregations