Search in sources :

Example 21 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class KeyTransactionProfileTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    Map<String, Object> map = new HashMap<>();
    AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
    ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
    serviceManager.setConfigService(configService);
}
Also used : ThreadService(com.newrelic.agent.ThreadService) AgentConfig(com.newrelic.agent.config.AgentConfig) ConfigService(com.newrelic.agent.config.ConfigService) HashMap(java.util.HashMap) MockServiceManager(com.newrelic.agent.MockServiceManager) BeforeClass(org.junit.BeforeClass)

Example 22 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class ProfilerServiceTest method createServiceManager.

private MockServiceManager createServiceManager(Map<String, Object> map) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    ProfilerService profilerService = new ProfilerService();
    serviceManager.setProfilerService(profilerService);
    return serviceManager;
}
Also used : ThreadService(com.newrelic.agent.ThreadService) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) MockServiceManager(com.newrelic.agent.MockServiceManager)

Example 23 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class MetricNormalizerTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    Map<String, Object> settings = AgentConfigFactoryTest.createStagingMap();
    AgentConfig config = AgentConfigFactory.createAgentConfig(settings, null, null);
    MockConfigService configService = new MockConfigService(null);
    configService.setAgentConfig(config);
    serviceManager.setConfigService(configService);
    MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
    serviceManager.setRPMServiceManager(rpmServiceManager);
    MockRPMService rpmService = new MockRPMService();
    rpmService.setApplicationName("Metric Normalizer Test");
    rpmServiceManager.setRPMService(rpmService);
    serviceManager.setNormalizationService(new NormalizationServiceImpl());
}
Also used : ThreadService(com.newrelic.agent.ThreadService) AgentConfig(com.newrelic.agent.config.AgentConfig) MockServiceManager(com.newrelic.agent.MockServiceManager) JSONObject(org.json.simple.JSONObject) MockRPMServiceManager(com.newrelic.agent.MockRPMServiceManager) MockConfigService(com.newrelic.agent.MockConfigService) MockRPMService(com.newrelic.agent.MockRPMService) BeforeClass(org.junit.BeforeClass)

Example 24 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class TransactionNamingTest method createServiceManager.

private static void createServiceManager(Map<String, Object> map) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
    serviceManager.setConfigService(configService);
    MockCoreService agent = new MockCoreService();
    serviceManager.setCoreService(agent);
    HarvestService harvestService = new MockHarvestService();
    serviceManager.setHarvestService(harvestService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    TransactionTraceService transactionTraceService = new TransactionTraceService();
    serviceManager.setTransactionTraceService(transactionTraceService);
    SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
    serviceManager.setSqlTraceService(sqlTraceService);
    MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
    serviceManager.setRPMServiceManager(rpmServiceManager);
    MockRPMService rpmService = new MockRPMService();
    rpmService.setApplicationName("Unit Test");
    rpmServiceManager.setRPMService(rpmService);
    NormalizationService normalizationService = new NormalizationServiceImpl();
    serviceManager.setNormalizationService(normalizationService);
    AttributesService attributeService = new AttributesService();
    serviceManager.setAttributesService(attributeService);
}
Also used : SqlTraceServiceImpl(com.newrelic.agent.sql.SqlTraceServiceImpl) MockHarvestService(com.newrelic.agent.MockHarvestService) HarvestService(com.newrelic.agent.HarvestService) TransactionService(com.newrelic.agent.TransactionService) AttributesService(com.newrelic.agent.attributes.AttributesService) MockRPMServiceManager(com.newrelic.agent.MockRPMServiceManager) TransactionTraceService(com.newrelic.agent.trace.TransactionTraceService) ThreadService(com.newrelic.agent.ThreadService) SqlTraceService(com.newrelic.agent.sql.SqlTraceService) ConfigService(com.newrelic.agent.config.ConfigService) MockServiceManager(com.newrelic.agent.MockServiceManager) MockCoreService(com.newrelic.agent.MockCoreService) MockHarvestService(com.newrelic.agent.MockHarvestService) MockRPMService(com.newrelic.agent.MockRPMService)

Example 25 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class MessagingUtilTest method createServiceManager.

private static void createServiceManager(Map<String, Object> configMap) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(configMap), configMap);
    serviceManager.setConfigService(configService);
    MockCoreService agent = new MockCoreService();
    serviceManager.setCoreService(agent);
    HarvestService harvestService = new MockHarvestService();
    serviceManager.setHarvestService(harvestService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    TransactionTraceService transactionTraceService = new TransactionTraceService();
    serviceManager.setTransactionTraceService(transactionTraceService);
    SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
    serviceManager.setSqlTraceService(sqlTraceService);
    AttributesService attService = new AttributesService();
    serviceManager.setAttributesService(attService);
    MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
    serviceManager.setRPMServiceManager(rpmServiceManager);
}
Also used : ThreadService(com.newrelic.agent.ThreadService) SqlTraceService(com.newrelic.agent.sql.SqlTraceService) ConfigService(com.newrelic.agent.config.ConfigService) SqlTraceServiceImpl(com.newrelic.agent.sql.SqlTraceServiceImpl) MockHarvestService(com.newrelic.agent.MockHarvestService) HarvestService(com.newrelic.agent.HarvestService) TransactionService(com.newrelic.agent.TransactionService) MockServiceManager(com.newrelic.agent.MockServiceManager) AttributesService(com.newrelic.agent.attributes.AttributesService) MockCoreService(com.newrelic.agent.MockCoreService) MockHarvestService(com.newrelic.agent.MockHarvestService) MockRPMServiceManager(com.newrelic.agent.MockRPMServiceManager) TransactionTraceService(com.newrelic.agent.trace.TransactionTraceService)

Aggregations

ThreadService (com.newrelic.agent.ThreadService)37 MockServiceManager (com.newrelic.agent.MockServiceManager)34 ConfigService (com.newrelic.agent.config.ConfigService)32 TransactionService (com.newrelic.agent.TransactionService)30 TransactionTraceService (com.newrelic.agent.trace.TransactionTraceService)24 MockRPMServiceManager (com.newrelic.agent.MockRPMServiceManager)23 HarvestService (com.newrelic.agent.HarvestService)21 MockHarvestService (com.newrelic.agent.MockHarvestService)18 AgentConfig (com.newrelic.agent.config.AgentConfig)18 MockCoreService (com.newrelic.agent.MockCoreService)17 SqlTraceService (com.newrelic.agent.sql.SqlTraceService)16 SqlTraceServiceImpl (com.newrelic.agent.sql.SqlTraceServiceImpl)16 MockRPMService (com.newrelic.agent.MockRPMService)15 AttributesService (com.newrelic.agent.attributes.AttributesService)13 StatsService (com.newrelic.agent.stats.StatsService)13 StatsServiceImpl (com.newrelic.agent.stats.StatsServiceImpl)13 ErrorServiceImpl (com.newrelic.agent.errors.ErrorServiceImpl)12 EnvironmentService (com.newrelic.agent.environment.EnvironmentService)8 HashMap (java.util.HashMap)8 EnvironmentServiceImpl (com.newrelic.agent.environment.EnvironmentServiceImpl)7