Skip to content

Commit

Permalink
fix tavis-ci build failed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ascrutae committed Oct 19, 2017
1 parent 4f9a958 commit 29d76e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -22,5 +22,5 @@
* Created by xin on 2016/12/7.
*/
public enum LogLevel {
DEBUG, INFO, WARN, ERROR;
DEBUG, INFO, WARN, ERROR, OFF
}
Expand Up @@ -23,10 +23,12 @@
import org.junit.rules.ExternalResource;
import org.skywalking.apm.agent.core.boot.BootService;
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.context.IgnoredTracerContext;
import org.skywalking.apm.agent.core.context.TracingContext;
import org.skywalking.apm.agent.core.context.TracingContextListener;
import org.skywalking.apm.agent.core.logging.core.LogLevel;
import org.skywalking.apm.agent.test.helper.FieldSetter;

public class AgentServiceRule extends ExternalResource {
Expand All @@ -38,13 +40,15 @@ protected void after() {
FieldSetter.setValue(ServiceManager.INSTANCE.getClass(), "bootedServices", new HashMap<Class, BootService>());
FieldSetter.setValue(IgnoredTracerContext.ListenerManager.class, "LISTENERS", new LinkedList<TracingContextListener>());
FieldSetter.setValue(TracingContext.ListenerManager.class, "LISTENERS", new LinkedList<TracingContextListener>());
ServiceManager.INSTANCE.shutdown();
} catch (Exception e) {
}
}

@Override
protected void before() throws Throwable {
super.before();
Config.Logging.LEVEL = LogLevel.OFF;
ServiceManager.INSTANCE.boot();
RemoteDownstreamConfig.Agent.APPLICATION_ID = 1;
RemoteDownstreamConfig.Agent.APPLICATION_INSTANCE_ID = 1;
Expand Down

0 comments on commit 29d76e0

Please sign in to comment.