use of com.newrelic.agent.tracers.ClassMethodSignature in project newrelic-java-agent by newrelic.
the class ApiTest method testSetAccountName.
@Test
public void testSetAccountName() {
Transaction tx = Transaction.getTransaction();
tx.getTransactionActivity().tracerStarted(new OtherRootTracer(tx, new ClassMethodSignature("", "", ""), this, new SimpleMetricNameFormat("dude")));
Request request = new ApiTestHelper.RequestWrapper(new MockHttpServletRequest("/", "mytest", "", "&test=dude"));
Response response = new ApiTestHelper.ResponseWrapper(new MockHttpServletResponse());
NewRelic.setRequestAndResponse(request, response);
NewRelic.setAccountName("accountName");
Assert.assertEquals("accountName", tx.getUserAttributes().get("account"));
}
use of com.newrelic.agent.tracers.ClassMethodSignature in project newrelic-java-agent by newrelic.
the class ApiTest method testSetTransactionName.
@Test
public void testSetTransactionName() {
Transaction tx = Transaction.getTransaction();
tx.getTransactionActivity().tracerStarted(new OtherRootTracer(tx, new ClassMethodSignature("", "", ""), this, new SimpleMetricNameFormat("dude")));
NewRelic.setTransactionName("Test", "/foo");
Assert.assertEquals("OtherTransaction/Test/foo", tx.getPriorityTransactionName().getName());
}
use of com.newrelic.agent.tracers.ClassMethodSignature in project newrelic-java-agent by newrelic.
the class ApiTest method testSetTransactionNameNoCategory.
@Test
public void testSetTransactionNameNoCategory() {
Transaction tx = Transaction.getTransaction();
tx.getTransactionActivity().tracerStarted(new OtherRootTracer(tx, new ClassMethodSignature("", "", ""), this, new SimpleMetricNameFormat("dude")));
NewRelic.setTransactionName(null, "/foo");
Assert.assertEquals("OtherTransaction/" + MetricNames.CUSTOM + "/foo", tx.getPriorityTransactionName().getName());
}
use of com.newrelic.agent.tracers.ClassMethodSignature in project newrelic-java-agent by newrelic.
the class ApiTest method testIgnoreTransaction.
@Test
public void testIgnoreTransaction() {
Transaction tx = Transaction.getTransaction();
tx.getTransactionActivity().tracerStarted(new OtherRootTracer(tx, new ClassMethodSignature("", "", ""), this, new SimpleMetricNameFormat("dude")));
NewRelic.ignoreTransaction();
Assert.assertTrue("Transaction should be ignored", tx.isIgnore());
}
use of com.newrelic.agent.tracers.ClassMethodSignature in project newrelic-java-agent by newrelic.
the class TransactionNamingTest method startOtherTransaction.
private void startOtherTransaction(String uri) throws Exception {
Transaction tx = Transaction.getTransaction();
ClassMethodSignature sig = new ClassMethodSignature("", "", "");
MetricNameFormat format = new SimpleMetricNameFormat(uri);
Tracer tracer = new OtherRootTracer(tx, sig, this, format);
tx.getTransactionActivity().tracerStarted(tracer);
}
Aggregations