use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class NormalizedTransactionTrace method createServiceManager.
private static void createServiceManager(Map<String, Object> map) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
serviceManager.start();
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
serviceManager.setConfigService(configService);
MockCoreService agent = new MockCoreService();
serviceManager.setCoreService(agent);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
AttributesService attrService = new AttributesService();
serviceManager.setAttributesService(attrService);
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);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class RandomTransactionSamplerTest method createServiceManager.
private void createServiceManager() throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
Map<String, Object> configMap = createConfigMap();
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(configMap), configMap);
serviceManager.setConfigService(configService);
DatabaseService dbService = new DatabaseService();
serviceManager.setDatabaseService(dbService);
TransactionTraceService ttService = new TransactionTraceService();
serviceManager.setTransactionTraceService(ttService);
AttributesService attService = new AttributesService();
serviceManager.setAttributesService(attService);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class TransactionTraceBucketTest method createServiceManager.
private void createServiceManager(Map<String, Object> configMap) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
AgentConfig agentConfig = createConfig(configMap);
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, configMap);
serviceManager.setConfigService(configService);
DatabaseService dbService = new DatabaseService();
serviceManager.setDatabaseService(dbService);
TransactionTraceService ttService = new TransactionTraceService();
serviceManager.setTransactionTraceService(ttService);
AttributesService attService = new AttributesService();
serviceManager.setAttributesService(attService);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class HibernateStatsTest method beforeClass.
@BeforeClass
public static void beforeClass() {
final NoopSamplerService samplerService = new NoopSamplerService() {
@Override
public Closeable addSampler(Runnable sampler, long period, TimeUnit timeUnit) {
samplers.add(sampler);
return null;
}
};
ConfigService configService = spy(ServiceFactory.getConfigService());
AgentConfigImpl agentConfig = spy((AgentConfigImpl) configService.getDefaultAgentConfig());
doReturn(true).when(agentConfig).getValue("instrumentation.hibernate.stats_sampler.enabled", false);
doReturn(agentConfig).when(configService).getDefaultAgentConfig();
ServiceManager serviceManager = spy(ServiceFactory.getServiceManager());
doReturn(samplerService).when(serviceManager).getSamplerService();
doReturn(configService).when(serviceManager).getConfigService();
ServiceFactory.setServiceManager(serviceManager);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class ProfileTest 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);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
threadNameNormalizer = new ThreadNameNormalizer(agentConfig, threadService);
}
Aggregations