use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class CacheServiceTest method createServiceManager.
private void createServiceManager(Map<String, Object> configMap) throws Exception {
AgentConfig config = AgentConfigImpl.createAgentConfig(configMap);
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ConfigService configService = ConfigServiceFactory.createConfigService(config, configMap);
serviceManager.setConfigService(configService);
CacheService cacheService = new CacheService();
serviceManager.setCacheService(cacheService);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
cacheService.start();
serviceManager.start();
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class CommandParserTest method createServiceManager.
private MockServiceManager createServiceManager(Map<String, Object> config) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), config);
serviceManager.setConfigService(configService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
RPMConnectionService rpmConnectionService = new RPMConnectionServiceImpl();
serviceManager.setRPMConnectionService(rpmConnectionService);
ProfilerService profilerService = new ProfilerService();
serviceManager.setProfilerService(profilerService);
EnvironmentService envService = new EnvironmentServiceImpl();
serviceManager.setEnvironmentService(envService);
HarvestService harvestService = new HarvestServiceImpl();
serviceManager.setHarvestService(harvestService);
return serviceManager;
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class CommandParserThreadProfilerTest method createServiceManager.
private MockServiceManager createServiceManager(Map<String, Object> config) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), config);
serviceManager.setConfigService(configService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
RPMConnectionService rpmConnectionService = new RPMConnectionServiceImpl();
serviceManager.setRPMConnectionService(rpmConnectionService);
ProfilerService profilerService = new ProfilerService();
serviceManager.setProfilerService(profilerService);
EnvironmentService envService = new EnvironmentServiceImpl();
serviceManager.setEnvironmentService(envService);
HarvestService harvestService = new HarvestServiceImpl();
serviceManager.setHarvestService(harvestService);
return serviceManager;
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class MockCoreService method getMockAgentAndBootstrapTheServiceManager.
public static CoreService getMockAgentAndBootstrapTheServiceManager() throws Exception {
AgentHelper.initializeConfig();
MockCoreService mockCoreService = new MockCoreService();
mockCoreService.setInstrumentation(Mockito.mock(InstrumentationProxy.class));
Mockito.when(mockCoreService.getInstrumentation().getAllLoadedClasses()).thenReturn(new Class[] {});
ConfigService configService = ConfigServiceFactory.createConfigService(mock(Logger.class), false);
ServiceManager serviceManager = new ServiceManagerImpl(mockCoreService, configService);
ServiceFactory.setServiceManager(serviceManager);
serviceManager.start();
return mockCoreService;
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class TransactionTraceServiceTest method createServiceManager.
private void createServiceManager(Map<String, Object> configMap) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(configMap), configMap);
serviceManager.setConfigService(configService);
DatabaseService dbService = new DatabaseService();
serviceManager.setDatabaseService(dbService);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName(APP_NAME);
rpmService.setIsConnected(true);
rpmServiceManager.setRPMService(rpmService);
CommandParser commandParser = new CommandParser();
serviceManager.setCommandParser(commandParser);
AttributesService attService = new AttributesService();
serviceManager.setAttributesService(attService);
TransactionTraceService ttService = new TransactionTraceService();
serviceManager.setTransactionTraceService(ttService);
ttService.start();
}
Aggregations