use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_sequence_overflow_NPE.
@Test
public void buildSpanChunkBo_sequence_overflow_NPE() {
final PSpanChunk chunk = newSpanChunk_overflow();
final Header header = newHeader();
SpanChunkBo spanChunkBo = factory.buildSpanChunkBo(chunk, header);
List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
Assert.assertTrue(spanEventBoList.isEmpty());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class CollectorGrpcSpanFactoryTest method buildSpanChunkBo_compact_depth.
@Test
public void buildSpanChunkBo_compact_depth() {
final PSpanChunk chunk = newSpanChunk_compact_depth();
final Header header = newHeader();
SpanChunkBo spanChunkBo = factory.buildSpanChunkBo(chunk, header);
List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
SpanEventBo spanEventBo0 = spanEventBoList.get(0);
SpanEventBo spanEventBo1 = spanEventBoList.get(1);
Assert.assertEquals(1, spanEventBo0.getDepth());
Assert.assertEquals(1, spanEventBo1.getDepth());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEncoderTest method testEncodeSpanColumnValue_spanEvent_depth_equals.
@Test
public void testEncodeSpanColumnValue_spanEvent_depth_equals() {
SpanBo spanBo = randomComplexSpan();
SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
spanEventBo1.setDepth(spanEventBo0.getDepth());
assertSpan(spanBo);
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEncoderTest method assertSpan.
private void assertSpan(SpanBo spanBo) {
spanBo.setCollectorAcceptTime(getCollectorAcceptTime());
SpanEncodingContext<SpanBo> encodingContext = new SpanEncodingContext<>(spanBo);
Buffer qualifier = wrapBuffer(spanEncoder.encodeSpanQualifier(encodingContext));
Buffer column = wrapBuffer(spanEncoder.encodeSpanColumnValue(encodingContext));
SpanDecodingContext decodingContext = new SpanDecodingContext();
decodingContext.setTransactionId(spanBo.getTransactionId());
decodingContext.setCollectorAcceptedTime(spanBo.getCollectorAcceptTime());
SpanBo decode = (SpanBo) spanDecoder.decode(qualifier, column, decodingContext);
// TODO Check CI log
// logger.debug("span dump \noriginal spanBo:{} \ndecode spanBo:{} ", spanBo, decode);
List<String> notSerializedField = newArrayList("parentApplicationId", "parentApplicationServiceType");
List<String> excludeField = newArrayList("annotationBoList", "spanEventBoList");
notSerializedField.addAll(excludeField);
Assert.assertTrue(EqualsBuilder.reflectionEquals(decode, spanBo, notSerializedField));
logger.debug("{} {}", spanBo.getAnnotationBoList(), decode.getAnnotationBoList());
Assert.assertTrue("annotation", EqualsBuilder.reflectionEquals(spanBo.getAnnotationBoList(), decode.getAnnotationBoList()));
List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
List<SpanEventBo> decodedSpanEventBoList = decode.getSpanEventBoList();
Assert.assertTrue(EqualsBuilder.reflectionEquals(spanEventBoList, decodedSpanEventBoList));
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEventBitFieldTest method testAnnotation_first.
@Test
public void testAnnotation_first() throws Exception {
SpanEventBo spanEventBo = new SpanEventBo();
spanEventBo.setAnnotationBoList(Collections.singletonList(new AnnotationBo(1, "test")));
SpanEventBitField bitField = SpanEventBitField.buildFirst(spanEventBo);
Assert.assertTrue(bitField.isSetAnnotation());
bitField.setAnnotation(false);
Assert.assertFalse(bitField.isSetAnnotation());
}
Aggregations