parent
f706bff794
commit
ccc1c1a640
|
|
@ -1,4 +1,4 @@
|
|||
package test.ai.cloud;
|
||||
package test.ai.cloud.consumerworker;
|
||||
|
||||
import com.ai.cloud.skywalking.buffer.BufferGroup;
|
||||
import com.ai.cloud.skywalking.conf.Config;
|
||||
|
|
@ -6,7 +6,7 @@ import org.junit.Test;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class bufferGroup {
|
||||
public class ConsumerWorkerTest {
|
||||
|
||||
@Test
|
||||
public void checkConsumerWorkerIsStartIfConsumerSizeIsZero() {
|
||||
|
|
@ -14,6 +14,7 @@ public class bufferGroup {
|
|||
BufferGroup bufferGroup = new BufferGroup("testBufferGroup");
|
||||
int count = getConsumerWorkerThreadCount();
|
||||
assertEquals(Config.Consumer.MAX_CONSUMER, count);
|
||||
|
||||
}
|
||||
|
||||
private int getConsumerWorkerThreadCount() {
|
||||
|
|
@ -6,11 +6,17 @@ import java.util.List;
|
|||
|
||||
public class TraceTreeAssert {
|
||||
|
||||
public static void assertEquals(String[][] traceTree) {
|
||||
List<Span> traceSpanList = TraceTreeDataAcquirer.acquireCurrentTraceSpanData();
|
||||
public static void assertEquals(String[][] assertTraceTree) {
|
||||
List<Span> bufferTraceSpanList = TraceTreeDataAcquirer.acquireCurrentTraceSpanData();
|
||||
validateTraceId(bufferTraceSpanList);
|
||||
validateTraceSpanSize(bufferTraceSpanList.size(), assertTraceTree.length);
|
||||
validateSpanData(bufferTraceSpanList, assertTraceTree);
|
||||
}
|
||||
|
||||
validateTraceId(traceSpanList);
|
||||
validateSpanData(traceSpanList, traceTree);
|
||||
private static void validateTraceSpanSize(int actualSpanSize, int expectedSpanSize) {
|
||||
if (actualSpanSize != expectedSpanSize) {
|
||||
throw new RuntimeException("expected span size : " + expectedSpanSize + "\n actual span size : " + actualSpanSize);
|
||||
}
|
||||
}
|
||||
|
||||
private static void validateSpanData(List<Span> traceSpanList, String[][] traceTree) {
|
||||
|
|
@ -18,5 +24,9 @@ public class TraceTreeAssert {
|
|||
}
|
||||
|
||||
private static void validateTraceId(List<Span> traceSpanList) {
|
||||
String traceId = null;
|
||||
for (Span span : traceSpanList) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ import com.ai.cloud.skywalking.protocol.Span;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by xin on 16-6-6.
|
||||
*/
|
||||
public class TraceTreeDataAcquirer {
|
||||
public static List<Span> acquireCurrentTraceSpanData() {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue