use of com.newrelic.agent.AgentImpl in project newrelic-java-agent by newrelic.
the class DistributedTracingApiTest method setup.
@Before
public void setup() throws Exception {
serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
setupConfig(false);
serviceManager.setTransactionService(new TransactionService());
serviceManager.setAttributesService(new AttributesService());
AgentBridge.agent = new AgentImpl(Agent.LOG);
serviceManager.setRPMServiceManager(new MockRPMServiceManager());
ServiceFactory.getServiceManager().start();
DistributedTraceServiceImpl distributedTraceService = new DistributedTraceServiceImpl();
ServiceFactory.getTransactionService().addTransactionListener(distributedTraceService);
SpanEventsServiceImpl spanEventsService = SpanEventsServiceImpl.builder().agentConfig(agentConfig).build();
serviceManager.setDistributedTraceService(distributedTraceService);
serviceManager.setSpansEventService(spanEventsService);
Map<String, Object> connectInfo = ImmutableMap.<String, Object>of(ACCOUNT_ID, "33", TRUSTED_ACCOUNT_KEY, "33", PRIMARY_APPLICATION_ID, "2827902");
AgentConfig agentConfig = AgentHelper.createAgentConfig(true, Collections.<String, Object>emptyMap(), connectInfo);
distributedTraceService.connected(null, agentConfig);
}
use of com.newrelic.agent.AgentImpl in project newrelic-java-agent by newrelic.
the class CircuitBreakerServiceTest method setup.
@BeforeClass
public static void setup() {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
try {
serviceManager.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
AgentBridge.instrumentation = new InstrumentationImpl(Agent.LOG);
AgentBridge.agent = new AgentImpl(Agent.LOG);
}
Aggregations