use of io.jaegertracing.internal.propagation.TestBinaryCarrier in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method assertBinaryInjectExtract.
private void assertBinaryInjectExtract(JaegerTracer tracer, JaegerSpanContext contextToInject) {
TestBinaryCarrier carrier = new TestBinaryCarrier();
tracer.inject(contextToInject, Format.Builtin.BINARY, carrier);
JaegerSpanContext extractedContext = tracer.extract(Format.Builtin.BINARY, carrier);
assertEquals(contextToInject.getTraceId(), extractedContext.getTraceId());
assertEquals(contextToInject.getSpanId(), extractedContext.getSpanId());
}
use of io.jaegertracing.internal.propagation.TestBinaryCarrier in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testPropagationBinary.
@Test
public void testPropagationBinary() {
System.setProperty(Configuration.JAEGER_PROPAGATION, "jaeger");
System.setProperty(Configuration.JAEGER_SERVICE_NAME, "Test");
long traceIdLow = 1234L;
long spanId = 5678L;
TestBinaryCarrier buffer = new TestBinaryCarrier();
JaegerSpanContext spanContext = new JaegerSpanContext(0, traceIdLow, spanId, 0, (byte) 0);
JaegerTracer tracer = Configuration.fromEnv().getTracer();
tracer.inject(spanContext, Format.Builtin.BINARY, buffer);
JaegerSpanContext extractedContext = tracer.extract(Format.Builtin.BINARY, buffer);
assertEquals(traceIdLow, extractedContext.getTraceIdLow());
assertEquals(0, extractedContext.getTraceIdHigh());
assertEquals(spanId, extractedContext.getSpanId());
}
Aggregations