use of io.jaegertracing.internal.JaegerSpanContext in project jaeger-client-java by jaegertracing.
the class TextMapCodecTest method testContextFromString.
@Test
public void testContextFromString() {
JaegerSpanContext context = TextMapCodec.contextFromString("ff:dd:cc:4");
assertEquals(context.getTraceIdLow(), 255L);
assertEquals(context.getTraceIdHigh(), 0L);
assertEquals(context.getSpanId(), 221L);
assertEquals(context.getParentId(), 204L);
assertEquals(context.getFlags(), 4);
}
use of io.jaegertracing.internal.JaegerSpanContext in project jaeger-client-java by jaegertracing.
the class TextMapCodecTest method testAdhocBaggageWithoutTraceId.
/**
* Tests that the codec will return non-null SpanContext even if the only header
* present is "jaeger-baggage".
*/
@Test
public void testAdhocBaggageWithoutTraceId() {
Map<String, String> headers = new HashMap<>();
headers.put("jaeger-baggage", "k1=v1, k2 = v2, k3=v3=d3");
TextMapCodec codec = new TextMapCodec(false);
JaegerSpanContext context = codec.extract(new TextMapAdapter(headers));
assertEquals("v1", context.getBaggageItem("k1"));
assertEquals("v2", context.getBaggageItem("k2"));
assertNull(context.getBaggageItem("k3"));
}
use of io.jaegertracing.internal.JaegerSpanContext in project jaeger-client-java by jaegertracing.
the class TextMapCodecTest method testContextFromStringWith128BitTraceId.
@Test
public void testContextFromStringWith128BitTraceId() {
JaegerSpanContext context = TextMapCodec.contextFromString("100000000000000ff:dd:cc:4");
assertEquals(context.getTraceIdLow(), 255L);
assertEquals(context.getTraceIdHigh(), 1L);
assertEquals(context.getSpanId(), 221L);
assertEquals(context.getParentId(), 204L);
assertEquals(context.getFlags(), 4);
}
use of io.jaegertracing.internal.JaegerSpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatParallelSpanIsAnnotatedWithTimeline.
@Test
public void testThatParallelSpanIsAnnotatedWithTimeline() {
final JaegerSpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/process"), spanId).put("");
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(REPORTER.getSpans().size(), equalTo(2));
assertThat(REPORTER.getSpans(), hasSpan("Processing books", hasItem("Processing started")));
assertThat(REPORTER.getSpans(), hasSpan("PUT /bookstore/process"));
}
use of io.jaegertracing.internal.JaegerSpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation.
@Test
public void testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation() {
final JaegerSpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/pseudo-async"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(REPORTER.getSpans().size(), equalTo(2));
assertThat(REPORTER.getSpans().get(1).getOperationName(), equalTo("GET /bookstore/books/pseudo-async"));
assertThat(REPORTER.getSpans().get(0).getOperationName(), equalTo("Processing books"));
}
Aggregations