1.增加校验长度的方法

2. 修改包名
This commit is contained in:
ascrutae 2016-06-06 11:23:12 +08:00
parent f706bff794
commit ccc1c1a640
3 changed files with 17 additions and 9 deletions

View File

@ -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() {

View File

@ -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) {
}
}
}

View File

@ -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() {