org.eclipse.microprofile.opentracing.tck.tracer

## Class TestTracer

- java.lang.Object
- - org.eclipse.microprofile.opentracing.tck.tracer.TestTracer

All Implemented Interfaces:
  io.opentracing.Tracer, Closeable, AutoCloseable

    @Alternative
    public class TestTracer
    extends Object
    implements io.opentracing.Tracer

Test Tracer. The `Alternative` annotation is needed so that this doesn't get injected instead of the container's `Tracer`.

### Nested Class Summary

### Nested classes/interfaces inherited from interface io.opentracing.Tracer

`io.opentracing.Tracer.SpanBuilder`

### Constructor Summary

Constructors
Constructor and Description
`TestTracer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`io.opentracing.Scope` `activateSpan(io.opentracing.Span span)`
`io.opentracing.Span` `activeSpan()`
`io.opentracing.Tracer.SpanBuilder` `buildSpan(String operationName)`
`void` `close()`
`<C> io.opentracing.SpanContext` `extract(io.opentracing.propagation.Format<C> format, C carrier)`
`List<TestSpan>` `getSpans()` Get a list of accumulated spans.
`<C> void` `inject(io.opentracing.SpanContext spanContext, io.opentracing.propagation.Format<C> format, C carrier)`
`io.opentracing.ScopeManager` `scopeManager()`
`void` `setSpans(List<TestSpan> newSpans)` Set the list of spans.
`TestSpanTree` `spanTree()` Convert the list of spans into a tree.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TestTracer

    public TestTracer()

### Method Detail

#### getSpans

    public List<TestSpan> getSpans()

Get a list of accumulated spans.

Returns:
  List of spans.

#### setSpans

    public void setSpans(List<TestSpan> newSpans)

Set the list of spans.

Parameters:
  `newSpans` - List of spans.

#### scopeManager

    public io.opentracing.ScopeManager scopeManager()

Specified by:
  `scopeManager` in interface `io.opentracing.Tracer`

#### activeSpan

    public io.opentracing.Span activeSpan()

Specified by:
  `activeSpan` in interface `io.opentracing.Tracer`

#### activateSpan

    public io.opentracing.Scope activateSpan(io.opentracing.Span span)

Specified by:
  `activateSpan` in interface `io.opentracing.Tracer`

#### buildSpan

    public io.opentracing.Tracer.SpanBuilder buildSpan(String operationName)

Specified by:
  `buildSpan` in interface `io.opentracing.Tracer`

#### inject

    public <C> void inject(io.opentracing.SpanContext spanContext,
                           io.opentracing.propagation.Format<C> format,
                           C carrier)

Specified by:
  `inject` in interface `io.opentracing.Tracer`

#### extract

    public <C> io.opentracing.SpanContext extract(io.opentracing.propagation.Format<C> format,
                                                  C carrier)

Specified by:
  `extract` in interface `io.opentracing.Tracer`

#### close

    public void close()

Specified by:
  `close` in interface `io.opentracing.Tracer`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`

#### spanTree

    public TestSpanTree spanTree()

Convert the list of spans into a tree.

Returns:
  Tree of spans.