Search in sources :

Example 16 with MockHttpRequest

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

the class AttributeValidatorTest 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);
}
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) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Example 17 with MockHttpRequest

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

the class TransactionAsyncUtility method createDispatcherTracer.

// Create a Tracer for tests that require one.
public static BasicRequestRootTracer createDispatcherTracer(Object thisObj, String methodName) {
    Transaction tx = Transaction.getTransaction();
    MockHttpRequest httpRequest = new MockHttpRequest();
    MockHttpResponse httpResponse = new MockHttpResponse();
    ClassMethodSignature sig = new ClassMethodSignature(thisObj.getClass().getName(), methodName, "()V");
    BasicRequestRootTracer brrt = new BasicRequestRootTracer(tx, sig, thisObj, httpRequest, httpResponse);
    tx.setDispatcher(brrt.createDispatcher());
    return brrt;
}
Also used : MockHttpRequest(com.newrelic.agent.tracers.servlet.MockHttpRequest) ClassMethodSignature(com.newrelic.agent.tracers.ClassMethodSignature) BasicRequestRootTracer(com.newrelic.agent.tracers.servlet.BasicRequestRootTracer) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Example 18 with MockHttpRequest

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

the class HighSecurityAttributesTest 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);
}
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) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Example 19 with MockHttpRequest

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

the class NoticeErrorAttributesTest 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);
}
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) MockHttpResponse(com.newrelic.agent.tracers.servlet.MockHttpResponse)

Example 20 with MockHttpRequest

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

the class MessagingUtilTest method createDispatcherTracer.

// Create a Tracer for tests that require one.
private BasicRequestRootTracer createDispatcherTracer() {
    Transaction tx = Transaction.getTransaction();
    tx.setApplicationName(ApplicationNamePriority.REQUEST_ATTRIBUTE, APP_NAME);
    MockHttpRequest httpRequest = new MockHttpRequest();
    MockHttpResponse httpResponse = new MockHttpResponse();
    ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), "dude", "()V");
    return new BasicRequestRootTracer(tx, sig, this, httpRequest, httpResponse);
}
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) 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