use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class TransactionEventTest method setup.
@Before
public void setup() {
MockServiceManager manager = new MockServiceManager();
ServiceFactory.setServiceManager(manager);
Map<String, Object> map = createConfigMap();
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
manager.setConfigService(configService);
manager.setStatsService(Mockito.mock(StatsService.class));
AttributesService attService = new AttributesService();
manager.setAttributesService(attService);
startTime = System.currentTimeMillis();
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class ProfileTest method turnOnSimpleCompression.
private void turnOnSimpleCompression() {
Map<String, Object> map = ImmutableMap.<String, Object>of(AgentConfigImpl.SIMPLE_COMPRESSION_PROPERTY, true);
AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
serviceManager.setConfigService(configService);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class RPMConnectionServiceTest method syncStartup.
@Test
public void syncStartup() throws Exception {
Map<String, Object> map = new HashMap<>();
map.put(AgentConfigImpl.APP_NAME, "MyApplication");
map.put(AgentConfigImpl.SYNC_STARTUP, true);
AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
MockServiceManager serviceManager = (MockServiceManager) ServiceFactory.getServiceManager();
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
serviceManager.setConfigService(configService);
CountDownLatch latch = new CountDownLatch(1);
MockRPMService rpmService = new MockRPMService(latch);
rpmService.setApplicationName("MyApplication");
rpmConnectionService.connect(rpmService);
Assert.assertEquals(0, latch.getCount());
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class RPMConnectionServiceTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception {
AgentHelper.initializeConfig();
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
serviceManager.start();
Map<String, Object> settings = AgentConfigFactoryTest.createStagingMap();
AgentConfig config = AgentConfigFactory.createAgentConfig(settings, null, null);
Environment env = new Environment(config, "c:\\test\\log");
EnvironmentService envService = Mockito.mock(EnvironmentService.class, new Returns(env));
serviceManager.setEnvironmentService(envService);
ConfigService configService = ConfigServiceFactory.createConfigServiceUsingSettings(settings);
serviceManager.setConfigService(configService);
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
rpmConnectionService = new TestRPMConnectionService();
}
use of com.newrelic.agent.config.ConfigService 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);
}
Aggregations