use of com.newrelic.agent.bridge.TransactionNamePriority in project newrelic-java-agent by newrelic.
the class BrowserConfigTest method testFooterCaptureParamsNoParams.
@Test
public void testFooterCaptureParamsNoParams() throws Exception {
setupManager(true, false);
Transaction tx = Transaction.getTransaction();
BasicRequestRootTracer tracer = createDispatcherTracer();
tx.getTransactionActivity().tracerStarted(tracer);
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName ptn = PriorityTransactionName.create("name", null, expectedPriority);
tx.setPriorityTransactionName(ptn);
Map<String, Object> beaconSettings = createBeaconSettings(true);
BrowserConfig beaconConfig = BrowserConfig.createBrowserConfig("appName", beaconSettings);
BrowserTransactionState bts = BrowserTransactionStateImpl.create(tx);
Assert.assertEquals(HEADER, beaconConfig.getBrowserTimingHeader());
String value = beaconConfig.getBrowserTimingFooter(bts);
List<String> matched = new ArrayList<>(15);
checkFooter(value, matched);
List<String> expectedFooterProperties = Arrays.asList(EXPECTED_FOOTER_PROPERTIES);
checkStrings(value, expectedFooterProperties, matched);
}
use of com.newrelic.agent.bridge.TransactionNamePriority in project newrelic-java-agent by newrelic.
the class ApiTest method testGetBrowserTimingFooterNoHeader.
@Test
public void testGetBrowserTimingFooterNoHeader() throws Exception {
ApiTestHelper.mockOutServiceManager();
Transaction tx = Transaction.getTransaction();
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName ptn = PriorityTransactionName.create("name", null, expectedPriority);
tx.setPriorityTransactionName(ptn);
BasicRequestRootTracer tracer = createDispatcherTracer();
tx.getTransactionActivity().tracerStarted(tracer);
String browserTimingFooter = NewRelic.getBrowserTimingFooter();
Assert.assertEquals("Incorrect header", "", browserTimingFooter);
tx.getTransactionActivity().tracerFinished(tracer, 0);
}
use of com.newrelic.agent.bridge.TransactionNamePriority in project newrelic-java-agent by newrelic.
the class ApiTest method testGetBrowserTimingShortFooterForIgnoredTransaction.
@Test
public void testGetBrowserTimingShortFooterForIgnoredTransaction() throws Exception {
ApiTestHelper.mockOutServiceManager();
Transaction tx = Transaction.getTransaction();
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName ptn = PriorityTransactionName.create("name", null, expectedPriority);
tx.setPriorityTransactionName(ptn);
BasicRequestRootTracer tracer = createDispatcherTracer();
tx.getTransactionActivity().tracerStarted(tracer);
tx.setIgnore(true);
NewRelic.getBrowserTimingHeader();
String browserTimingFooter = NewRelic.getBrowserTimingFooter();
Assert.assertEquals("Incorrect short header", "", browserTimingFooter);
tx.getTransactionActivity().tracerFinished(tracer, 0);
}
use of com.newrelic.agent.bridge.TransactionNamePriority in project newrelic-java-agent by newrelic.
the class PriorityTransactionNameTest method category.
@Test
public void category() {
String expectedName = "MyTransactionName";
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName txName = PriorityTransactionName.create(expectedName, "MyCategory", expectedPriority);
Assert.assertEquals("MyCategory", txName.getCategory());
}
use of com.newrelic.agent.bridge.TransactionNamePriority in project newrelic-java-agent by newrelic.
the class ApiTest method testGetBrowserTimingFooter.
@Test
public void testGetBrowserTimingFooter() throws Exception {
ApiTestHelper.mockOutServiceManager();
Transaction tx = Transaction.getTransaction();
TransactionNamePriority expectedPriority = TransactionNamePriority.FILTER_NAME;
PriorityTransactionName ptn = PriorityTransactionName.create("name", null, expectedPriority);
tx.setPriorityTransactionName(ptn);
BasicRequestRootTracer tracer = createDispatcherTracer();
tx.getTransactionActivity().tracerStarted(tracer);
NewRelic.getBrowserTimingHeader();
String browserTimingFooter = NewRelic.getBrowserTimingFooter();
Assert.assertTrue("Incorrect footer. Was " + browserTimingFooter + ", but expected it to start with " + getTimingFooterStart(), browserTimingFooter.startsWith(getTimingFooterStart()));
tx.getTransactionActivity().tracerFinished(tracer, 0);
}
Aggregations