提交 6737dfd4 编写于 作者: wu-sheng's avatar wu-sheng

Remove some test cases and stop schedule.

上级 6d19ba1b
......@@ -21,6 +21,8 @@ package org.skywalking.apm.agent.core.boot;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import org.junit.AfterClass;
import org.junit.Rule;
import org.junit.Test;
import org.skywalking.apm.agent.core.context.ContextManager;
......@@ -45,6 +47,11 @@ public class ServiceManagerTest {
@Rule
public AgentServiceRule agentServiceRule = new AgentServiceRule();
@AfterClass
public static void afterClass() {
ServiceManager.INSTANCE.shutdown();
}
@Test
public void testServiceDependencies() throws Exception {
HashMap<Class, BootService> registryService = getFieldValue(ServiceManager.INSTANCE, "bootedServices");
......
......@@ -20,11 +20,10 @@ package org.skywalking.apm.agent.core.context;
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.*;
import org.junit.runner.RunWith;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig;
import org.skywalking.apm.agent.core.context.tag.Tags;
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
......@@ -71,6 +70,12 @@ public class ContextManagerTest {
RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID = 1;
}
@AfterClass
public static void afterClass() {
ServiceManager.INSTANCE.shutdown();
}
@Test
public void createSpanWithInvalidateContextCarrier() {
ContextCarrier contextCarrier = new ContextCarrier().deserialize("#AQA=#AQA=4WcWe0tQNQA=|1|#127.0.0.1:8080|#/testEntrySpan|#/testEntrySpan|#AQA=#AQA=Et0We0tQNQA=");
......
......@@ -19,10 +19,8 @@
package org.skywalking.apm.agent.core.context;
import java.util.LinkedList;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.*;
import org.junit.runner.RunWith;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.Config;
......@@ -53,6 +51,11 @@ public class IgnoredTracerContextTest {
RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID = 1;
}
@AfterClass
public static void afterClass() {
ServiceManager.INSTANCE.shutdown();
}
@After
public void tearDown() throws Exception {
}
......
......@@ -19,11 +19,11 @@
package org.skywalking.apm.agent.core.remote;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.*;
import org.skywalking.apm.agent.core.boot.ServiceManager;
import org.skywalking.apm.agent.core.conf.Config;
import org.skywalking.apm.agent.core.conf.RemoteDownstreamConfig;
import org.skywalking.apm.agent.core.test.tools.AgentServiceRule;
......@@ -44,32 +44,37 @@ public class DiscoveryRestServiceClientTest {
@Rule
public WireMockRule wireMockRule = new WireMockRule(8089);
@AfterClass
public static void afterClass() {
ServiceManager.INSTANCE.shutdown();
}
@Before
public void setUpBeforeClass() {
Config.Collector.DISCOVERY_CHECK_INTERVAL = 1;
stubFor(get(urlEqualTo("/withoutResult"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("[]")));
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("[]")));
stubFor(get(urlEqualTo("/withResult"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:8080','127.0.0.1:8090']")));
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:8080','127.0.0.1:8090']")));
stubFor(get(urlEqualTo("/withSameResult"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:8090','127.0.0.1:8080']")));
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:8090','127.0.0.1:8080']")));
stubFor(get(urlEqualTo("/withDifferenceResult"))
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:9090','127.0.0.1:18090']")));
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("['127.0.0.1:9090','127.0.0.1:18090']")));
stubFor(get(urlEqualTo("/with404"))
.willReturn(aResponse()
.withStatus(400)));
.willReturn(aResponse()
.withStatus(400)));
}
@Test
......
......@@ -21,12 +21,11 @@ package org.skywalking.apm.agent.core.remote;
import com.google.protobuf.InvalidProtocolBufferException;
import io.grpc.stub.StreamObserver;
import io.grpc.testing.GrpcServerRule;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.*;
import org.junit.runner.RunWith;
import org.powermock.reflect.Whitebox;
import org.skywalking.apm.agent.core.boot.ServiceManager;
......@@ -94,13 +93,18 @@ public class TraceSegmentServiceClientTest {
RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID = 1;
}
@AfterClass
public static void afterClass() {
ServiceManager.INSTANCE.shutdown();
}
@Before
public void setUp() throws Throwable {
Whitebox.setInternalState(ServiceManager.INSTANCE.findService(GRPCChannelManager.class), "reconnect", false);
spy(serviceClient);
Whitebox.setInternalState(serviceClient, "serviceStub",
TraceSegmentServiceGrpc.newStub(grpcServerRule.getChannel()));
TraceSegmentServiceGrpc.newStub(grpcServerRule.getChannel()));
Whitebox.setInternalState(serviceClient, "status", GRPCChannelStatus.CONNECTED);
upstreamSegments = new ArrayList<UpstreamSegment>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册