Search in sources :

Example 21 with MockHttpRequest

use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.

the class JsonTracer method generateRootWebTracer.

private DefaultTracer generateRootWebTracer(Long initTime) {
    DefaultTracer tracer = generateRootBackgroundTracer(initTime);
    Transaction.getTransaction().setWebRequest(new MockHttpRequest());
    Transaction.getTransaction().setWebResponse(new MockHttpResponse());
    return tracer;
}
Also used : MockHttpRequest(com.newrelic.agent.tracers.servlet.MockHttpRequest) DefaultTracer(com.newrelic.agent.tracers.DefaultTracer) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Example 22 with MockHttpRequest

use of com.newrelic.agent.tracers.servlet.MockHttpRequest in project newrelic-java-agent by newrelic.

the class AbstractPriorityTransactionNamingPolicyTest method startWebTransaction.

private void startWebTransaction() throws Exception {
    Transaction tx = Transaction.getTransaction();
    MockHttpRequest httpRequest = new MockHttpRequest();
    httpRequest.setRequestURI("");
    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);
}
Also used : MockHttpRequest(com.newrelic.agent.tracers.servlet.MockHttpRequest) Transaction(com.newrelic.agent.Transaction) ClassMethodSignature(com.newrelic.agent.tracers.ClassMethodSignature) BasicRequestRootTracer(com.newrelic.agent.tracers.servlet.BasicRequestRootTracer) Tracer(com.newrelic.agent.tracers.Tracer) OtherRootTracer(com.newrelic.agent.tracers.OtherRootTracer) BasicRequestRootTracer(com.newrelic.agent.tracers.servlet.BasicRequestRootTracer) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Aggregations

MockHttpRequest (com.newrelic.agent.tracers.servlet.MockHttpRequest)22 MockHttpResponse (com.newrelic.agent.tracers.servlet.MockHttpResponse)19 Transaction (com.newrelic.agent.Transaction)16 ClassMethodSignature (com.newrelic.agent.tracers.ClassMethodSignature)15 BasicRequestRootTracer (com.newrelic.agent.tracers.servlet.BasicRequestRootTracer)15 Test (org.junit.Test)5 Tracer (com.newrelic.agent.tracers.Tracer)4 OtherRootTracer (com.newrelic.agent.tracers.OtherRootTracer)3 Dispatcher (com.newrelic.agent.dispatchers.Dispatcher)2 WebRequestDispatcher (com.newrelic.agent.dispatchers.WebRequestDispatcher)1 SpanEvent (com.newrelic.agent.model.SpanEvent)1 TransactionEvent (com.newrelic.agent.service.analytics.TransactionEvent)1 DefaultTracer (com.newrelic.agent.tracers.DefaultTracer)1 OtherRootSqlTracer (com.newrelic.agent.tracers.OtherRootSqlTracer)1 SqlTracer (com.newrelic.agent.tracers.SqlTracer)1 SimpleMetricNameFormat (com.newrelic.agent.tracers.metricname.SimpleMetricNameFormat)1 HeaderType (com.newrelic.api.agent.HeaderType)1 Response (com.newrelic.api.agent.Response)1 Trace (com.newrelic.api.agent.Trace)1 JSONArray (org.json.simple.JSONArray)1