use of test.newrelic.EnvironmentHolderSettingsGenerator in project newrelic-java-agent by newrelic.
the class XmlRpcPointCutTest method externalTest.
@Test
public void externalTest() throws Exception {
EnvironmentHolderSettingsGenerator envHolderSettings = new EnvironmentHolderSettingsGenerator(CONFIG_FILE, "all_enabled_test", CLASS_LOADER);
EnvironmentHolder holder = new EnvironmentHolder(envHolderSettings);
holder.setupEnvironment();
try {
doCall();
SpanEventsService spanEventsService = ServiceFactory.getServiceManager().getSpanEventsService();
String appName = ServiceFactory.getConfigService().getDefaultAgentConfig().getApplicationName();
SamplingPriorityQueue<SpanEvent> spanEventsPool = spanEventsService.getOrCreateDistributedSamplingReservoir(appName);
assertNotNull(spanEventsPool);
List<SpanEvent> spanEvents = spanEventsPool.asList();
assertNotNull(spanEvents);
assertEquals(2, spanEvents.size());
boolean java = false;
boolean external = false;
for (SpanEvent span : spanEvents) {
String name = (String) span.getIntrinsics().get("name");
if (name.equals("External/newrelic.com/XmlRpc/invoke")) {
external = true;
assertEquals("XmlRpc", span.getIntrinsics().get("component"));
assertEquals("http", span.getIntrinsics().get("category"));
assertEquals("http://newrelic.com", span.getAgentAttributes().get("http.url"));
} else if (name.equals("Java/com.newrelic.agent.instrumentation.pointcuts.javax.xml.rpc.XmlRpcPointCutTest/doCall")) {
java = true;
assertEquals("generic", span.getIntrinsics().get("category"));
}
}
assertTrue("Unexpected span events found", java && external);
} finally {
holder.close();
}
}
use of test.newrelic.EnvironmentHolderSettingsGenerator in project newrelic-java-agent by newrelic.
the class ExternalAsyncTest method setupEnvironmentHolder.
public EnvironmentHolder setupEnvironmentHolder(String environment) throws Exception {
EnvironmentHolderSettingsGenerator envHolderSettings = new EnvironmentHolderSettingsGenerator(CONFIG_FILE, environment, CLASS_LOADER);
EnvironmentHolder environmentHolder = new EnvironmentHolder(envHolderSettings);
environmentHolder.setupEnvironment();
return environmentHolder;
}
use of test.newrelic.EnvironmentHolderSettingsGenerator in project newrelic-java-agent by newrelic.
the class ApiTest method setupEnvironmentHolder.
public EnvironmentHolder setupEnvironmentHolder(String environment) throws Exception {
EnvironmentHolderSettingsGenerator envHolderSettings = new EnvironmentHolderSettingsGenerator(CONFIG_FILE, environment, CLASS_LOADER);
EnvironmentHolder environmentHolder = new EnvironmentHolder(envHolderSettings);
environmentHolder.setupEnvironment();
return environmentHolder;
}
use of test.newrelic.EnvironmentHolderSettingsGenerator in project newrelic-java-agent by newrelic.
the class SpanErrorsTest method before.
@Before
public void before() throws Exception {
holder = new EnvironmentHolder(new EnvironmentHolderSettingsGenerator(CONFIG_FILE, "all_enabled_test", CLASS_LOADER));
holder.setupEnvironment();
APP_NAME = ServiceFactory.getConfigService().getDefaultAgentConfig().getApplicationName();
ServiceFactory.getSpanEventService().getOrCreateDistributedSamplingReservoir(APP_NAME).clear();
}
use of test.newrelic.EnvironmentHolderSettingsGenerator in project newrelic-java-agent by newrelic.
the class SpanIdOnErrorsTest method before.
@Before
public void before() throws Exception {
holder = new EnvironmentHolder(new EnvironmentHolderSettingsGenerator(CONFIG_FILE, "all_enabled_test", CLASS_LOADER));
holder.setupEnvironment();
APP_NAME = ServiceFactory.getConfigService().getDefaultAgentConfig().getApplicationName();
cleanup();
}
Aggregations