use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class ClassTransformerConfigImplTest method testBuiltinExtension.
@Test
public void testBuiltinExtension() {
Map<String, Object> configuration = new HashMap<>();
configuration.put("class_transformer:instrumentation_default:enabled", false);
configuration.put("class_transformer:builtin_extensions:enabled", true);
configuration.put("app_name", "Unit Test");
configuration = buildConfigMap(configuration);
AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(configuration);
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, Collections.<String, Object>emptyMap());
ServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
// SpringPointCut springPointCut = new SpringPointCut(agentConfig);
assertTrue(agentConfig.getClassTransformerConfig().isBuiltinExtensionEnabled());
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class IncludeExcludeCrossAgentTest method setup.
@Before
public void setup() {
manager = new MockServiceManager();
ServiceFactory.setServiceManager(manager);
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class ConfigServiceTest method createServiceManager.
private void createServiceManager(Map<String, Object> configMap) throws Exception {
ConfigService configService = ConfigServiceFactory.createConfigServiceUsingSettings(configMap);
MockServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName("Unit Test");
rpmServiceManager.setRPMService(rpmService);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
configService.start();
serviceManager.start();
}
use of com.newrelic.agent.MockServiceManager in project newrelic-java-agent by newrelic.
the class DistributedTracingConfigTest method before.
@Before
public void before() throws Exception {
serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ServiceFactory.getServiceManager().start();
}
use of com.newrelic.agent.MockServiceManager 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