use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class NormalizedTransactionTrace method testNormalizedTransactionTraceTest.
@SuppressWarnings({ "unchecked", "serial" })
@Test
public void testNormalizedTransactionTraceTest() {
final JSONArray rulesData = new JSONArray();
rulesData.addAll(Arrays.asList(new JSONObject() {
{
put("match_expression", "/amq.([0-9]*)$");
put("replacement", "/amq.*");
put("eval_order", 1);
}
}));
setUrlRules(rulesData);
Transaction txn = Transaction.getTransaction();
ClassMethodSignature sig = new ClassMethodSignature("", "", "");
MetricNameFormat format = new SimpleMetricNameFormat("");
Tracer tracer = new OtherRootTracer(txn, sig, this, format);
txn.getTransactionActivity().tracerStarted(tracer);
MockDispatcher dispatcher = new MockDispatcher();
txn.setDispatcher(dispatcher);
txn.setTransactionName(TransactionNamePriority.FRAMEWORK_HIGH, false, "TEST", "/amq.1234567831415");
tracer.finish(Opcodes.ARETURN, null);
Assert.assertEquals("/amq.*", txn.getPriorityTransactionName().getPartialName());
}
Aggregations