use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.
the class TransactionNamingTest method startWebTransaction.
private void startWebTransaction(String uri) throws Exception {
Transaction tx = Transaction.getTransaction();
MockHttpRequest httpRequest = new MockHttpRequest();
httpRequest.setRequestURI(uri);
MockHttpResponse httpResponse = new MockHttpResponse();
ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), "dude", "()V");
Tracer tracer = new BasicRequestRootTracer(tx, sig, this, httpRequest, httpResponse);
tx.getTransactionActivity().tracerStarted(tracer);
}
use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.
the class WebRequestDispatcherTest method runTransactionAndGetAttributes.
private Map<String, Object> runTransactionAndGetAttributes() throws Exception {
// setup request
MockHttpRequest httpRequest = new MockHttpRequest().setHeader("Referer", "Referer value").setHeader("Accept", "Accept value").setHeader("Host", "Host value").setHeader("User-Agent", "User-Agent value").setHeader("Content-Length", "Content-Length value").setHeader(HEADER_WITH_ALIAS, "123456").setHeader(HEADER_WITHOUT_ALIAS, "234567");
WebRequestDispatcher dispatcher = createDispatcher(httpRequest);
dispatcher.transactionFinished("WebTransaction/Uri/test", stats);
dispatcher.getTransaction().getTransactionActivity().markAsResponseSender();
dispatcher.getTransaction().getRootTracer().finish(0, null);
return dispatcher.getTransaction().getUserAttributes();
}
use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.
the class AsyncTimeoutTransactionTest method createDispatcherTracer.
// Create a Tracer for tests that require one.
private BasicRequestRootTracer createDispatcherTracer() {
Transaction tx = Transaction.getTransaction();
MockHttpRequest httpRequest = new MockHttpRequest();
MockHttpResponse httpResponse = new MockHttpResponse();
ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), "dude", "()V");
return new BasicRequestRootTracer(tx, sig, this, httpRequest, httpResponse);
}
use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.
the class AsyncTransactionTest method createDispatcherTracer.
// Create a Tracer for tests that require one.
private BasicRequestRootTracer createDispatcherTracer(String methodName) {
Transaction tx = Transaction.getTransaction();
MockHttpRequest httpRequest = new MockHttpRequest();
MockHttpResponse httpResponse = new MockHttpResponse();
ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), methodName, "()V");
BasicRequestRootTracer brrt = new BasicRequestRootTracer(tx, sig, this, httpRequest, httpResponse);
tx.setDispatcher(brrt.createDispatcher());
return brrt;
}
use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.
the class ApiTest method createDispatcherTracer.
private BasicRequestRootTracer createDispatcherTracer() {
Transaction tx = Transaction.getTransaction();
MockHttpRequest httpRequest = new MockHttpRequest();
MockHttpResponse httpResponse = new MockHttpResponse();
ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), "dude", "()V");
return new BasicRequestRootTracer(tx, sig, this, httpRequest, httpResponse);
}
Aggregations