test_class.file: stagemonitor-tracing-elasticsearch/src/test/java/org/stagemonitor/tracing/elasticsearch/impl/JaegerTracerFactoryTest.java
test_class.identifier: JaegerTracerFactoryTest
test_case.body: @Test
  	public void testIsRoot() throws Exception {
  		final StagemonitorPlugin.InitArguments initArguments = mock(StagemonitorPlugin.InitArguments.class);
  		when(initArguments.getMeasurementSession()).thenReturn(
  				new MeasurementSession("JaegerTracerFactoryTest", "test", "test"));
  		final JaegerTracerFactory jaegerTracerFactory = new JaegerTracerFactory();
  		final Tracer tracer = jaegerTracerFactory.getTracer(initArguments);
  		Span rootSpan = tracer.buildSpan("foo").start();
  		try (final Scope rootScope = tracer.scopeManager().activate(rootSpan)) {
  			final Span childSpan = tracer.buildSpan("bar").start();
  			try (final Scope childScope = tracer.scopeManager().activate(childSpan)) {
  				assertThat(jaegerTracerFactory.isRoot(rootSpan)).isTrue();
  				assertThat(jaegerTracerFactory.isRoot(childSpan)).isFalse();
  			}
  		}
  	}
test_case.class_method_signature: JaegerTracerFactoryTest.testIsRoot()
test_case.full_signature: @Test public void testIsRoot()
test_case.identifier: testIsRoot
test_case.invocations: mock thenReturn when getMeasurementSession getTracer start buildSpan activate scopeManager start buildSpan activate scopeManager isTrue assertThat isRoot isFalse assertThat isRoot
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsRoot()
focal_class.file: stagemonitor-tracing-elasticsearch/src/main/java/org/stagemonitor/tracing/elasticsearch/impl/JaegerTracerFactory.java
focal_class.identifier: JaegerTracerFactory
focal_class.class_method_signature: JaegerTracerFactory.getTracer(StagemonitorPlugin.InitArguments initArguments)
focal_class.full_signature: @Override public Tracer getTracer(StagemonitorPlugin.InitArguments initArguments)
focal_class.identifier: getTracer
focal_class.modifiers: @Override public
focal_class.parameters: (StagemonitorPlugin.InitArguments initArguments)
focal_class.return: Tracer
focal_class.signature: Tracer getTracer(StagemonitorPlugin.InitArguments initArguments)
focal_class.class_method_signature: JaegerTracerFactory.isRoot(Span span)
focal_class.full_signature: @Override public boolean isRoot(Span span)
focal_class.identifier: isRoot
focal_class.modifiers: @Override public
focal_class.parameters: (Span span)
focal_class.return: boolean
focal_class.signature: boolean isRoot(Span span)
focal_class.class_method_signature: JaegerTracerFactory.isSampled(Span span)
focal_class.full_signature: @Override public boolean isSampled(Span span)
focal_class.identifier: isSampled
focal_class.modifiers: @Override public
focal_class.parameters: (Span span)
focal_class.return: boolean
focal_class.signature: boolean isSampled(Span span)
focal_class.superclass: extends TracerFactory
focal_method.body: @Override
  	public boolean isRoot(Span span) {
  		// TODO replace with Span#unwrap once https://github.com/opentracing/opentracing-java/pull/211 is merged
  		if (span instanceof SpanWrapper) {
  			span = ((SpanWrapper) span).getDelegate();
  		}
  		if (span instanceof io.jaegertracing.internal.JaegerSpan) {
  			final io.jaegertracing.internal.JaegerSpan jaegerSpan = (io.jaegertracing.internal.JaegerSpan) span;
  			return jaegerSpan.context().getParentId() == 0;
  		}
  		return false;
  	}
focal_method.class_method_signature: JaegerTracerFactory.isRoot(Span span)
focal_method.full_signature: @Override public boolean isRoot(Span span)
focal_method.identifier: isRoot
focal_method.invocations: getDelegate getParentId context
focal_method.modifiers: @Override public
focal_method.parameters: (Span span)
focal_method.return: boolean
focal_method.signature: boolean isRoot(Span span)