Skip to content

Commit

Permalink
[pinpoint-apm#9380] Calltree verification Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Dec 14, 2022
1 parent fc0c66f commit ccd0305
Show file tree
Hide file tree
Showing 3 changed files with 219 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ public Builder addAnnotationBo(AnnotationBo e) {
return this;
}

public Builder addSpanEventBo(SpanEventBo e) {
this.spanEventBoList.add(e);
return this;
}

public SpanBo build() {
SpanBo result = new SpanBo();
result.setVersion(this.version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,105 @@ public String toString() {
builder.append("}");
return builder.toString();
}

public static class Builder {
private int version = 0;

private short sequence;

private int startElapsed;
private int endElapsed;

// private String rpc;
private short serviceType;

private String destinationId;
private String endPoint;
private int apiId;

private List<AnnotationBo> annotationBoList;

private int depth = -1;
private long nextSpanId = -1;

private int nextAsyncId = -1;

public Builder setVersion(int version) {
this.version = version;
return this;
}

public Builder setSequence(short sequence) {
this.sequence = sequence;
return this;
}

public Builder setStartElapsed(int startElapsed) {
this.startElapsed = startElapsed;
return this;
}

public Builder setEndElapsed(int endElapsed) {
this.endElapsed = endElapsed;
return this;
}

public Builder setServiceType(short serviceType) {
this.serviceType = serviceType;
return this;
}

public Builder setDestinationId(String destinationId) {
this.destinationId = destinationId;
return this;
}

public Builder setEndPoint(String endPoint) {
this.endPoint = endPoint;
return this;
}

public Builder setApiId(int apiId) {
this.apiId = apiId;
return this;
}

public Builder addAnnotationBo(AnnotationBo e) {
this.annotationBoList.add(e);
return this;
}

public Builder setDepth(int depth) {
this.depth = depth;
return this;
}

public Builder setNextSpanId(long nextSpanId) {
this.nextSpanId = nextSpanId;
return this;
}

public Builder setNextAsyncId(int nextAsyncId) {
this.nextAsyncId = nextAsyncId;
return this;
}

public SpanEventBo build() {
SpanEventBo result = new SpanEventBo();
result.setVersion((byte) this.version);
result.setSequence(this.sequence);
result.setStartElapsed(this.startElapsed);
result.setEndElapsed(this.endElapsed);
result.setServiceType(this.serviceType);
result.setDestinationId(this.destinationId);
result.setEndPoint(this.endPoint);
result.setApiId(this.apiId);
result.setAnnotationBoList(this.annotationBoList);
result.setDepth(this.depth);
result.setNextSpanId(this.nextSpanId);
result.setNextAsyncId(this.nextAsyncId);
return result;
}

}
}
Loading

0 comments on commit ccd0305

Please sign in to comment.