Search in sources :

Example 76 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SprayHttpRoutesTest method testAlternateMapRoute.

@Test
public void testAlternateMapRoute() {
    given().baseUri("http://localhost:" + server.getPort()).when().get("/map/blue").then().body(containsString("Map: 3"));
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
    Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/map/blue"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Java13IncompatibleTest(com.newrelic.test.marker.Java13IncompatibleTest) Java16IncompatibleTest(com.newrelic.test.marker.Java16IncompatibleTest) Java17IncompatibleTest(com.newrelic.test.marker.Java17IncompatibleTest) Java14IncompatibleTest(com.newrelic.test.marker.Java14IncompatibleTest) Test(org.junit.Test) Java11IncompatibleTest(com.newrelic.test.marker.Java11IncompatibleTest) Java15IncompatibleTest(com.newrelic.test.marker.Java15IncompatibleTest) Java12IncompatibleTest(com.newrelic.test.marker.Java12IncompatibleTest)

Example 77 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SprayHttpRoutesTest method testIntNumberRoute.

@Test
public void testIntNumberRoute() {
    given().baseUri("http://localhost:" + server.getPort()).when().get("/int/10").then().body(containsString("IntNumber: 10"));
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
    Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/int/IntNumber"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Java13IncompatibleTest(com.newrelic.test.marker.Java13IncompatibleTest) Java16IncompatibleTest(com.newrelic.test.marker.Java16IncompatibleTest) Java17IncompatibleTest(com.newrelic.test.marker.Java17IncompatibleTest) Java14IncompatibleTest(com.newrelic.test.marker.Java14IncompatibleTest) Test(org.junit.Test) Java11IncompatibleTest(com.newrelic.test.marker.Java11IncompatibleTest) Java15IncompatibleTest(com.newrelic.test.marker.Java15IncompatibleTest) Java12IncompatibleTest(com.newrelic.test.marker.Java12IncompatibleTest)

Example 78 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SprayHttpRoutesTest method testUnmatchedSegmentRoute.

@Test
public void testUnmatchedSegmentRoute() {
    given().baseUri("http://localhost:" + server.getPort()).when().get("/segment").then().body(containsString("The requested resource could not be found."));
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
    Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/Unknown Route"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Java13IncompatibleTest(com.newrelic.test.marker.Java13IncompatibleTest) Java16IncompatibleTest(com.newrelic.test.marker.Java16IncompatibleTest) Java17IncompatibleTest(com.newrelic.test.marker.Java17IncompatibleTest) Java14IncompatibleTest(com.newrelic.test.marker.Java14IncompatibleTest) Test(org.junit.Test) Java11IncompatibleTest(com.newrelic.test.marker.Java11IncompatibleTest) Java15IncompatibleTest(com.newrelic.test.marker.Java15IncompatibleTest) Java12IncompatibleTest(com.newrelic.test.marker.Java12IncompatibleTest)

Example 79 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SprayHttpRoutesTest method testAlternateUnmatchedSegmentFutureRoute.

@Test
public void testAlternateUnmatchedSegmentFutureRoute() {
    given().baseUri("http://localhost:" + server.getPort()).when().get("/segment/future/foo").then().body(containsString("The requested resource could not be found."));
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
    Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/Unknown Route"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Java13IncompatibleTest(com.newrelic.test.marker.Java13IncompatibleTest) Java16IncompatibleTest(com.newrelic.test.marker.Java16IncompatibleTest) Java17IncompatibleTest(com.newrelic.test.marker.Java17IncompatibleTest) Java14IncompatibleTest(com.newrelic.test.marker.Java14IncompatibleTest) Test(org.junit.Test) Java11IncompatibleTest(com.newrelic.test.marker.Java11IncompatibleTest) Java15IncompatibleTest(com.newrelic.test.marker.Java15IncompatibleTest) Java12IncompatibleTest(com.newrelic.test.marker.Java12IncompatibleTest)

Example 80 with Introspector

use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.

the class SprayHttpRoutesTest method testUnmatchedNegationFutureRoute.

@Test
public void testUnmatchedNegationFutureRoute() {
    given().baseUri("http://localhost:" + server.getPort()).when().get("/futurematchnomatch").then().body(containsString("The requested resource could not be found."));
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
    Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/Unknown Route"));
}
Also used : Introspector(com.newrelic.agent.introspec.Introspector) Java13IncompatibleTest(com.newrelic.test.marker.Java13IncompatibleTest) Java16IncompatibleTest(com.newrelic.test.marker.Java16IncompatibleTest) Java17IncompatibleTest(com.newrelic.test.marker.Java17IncompatibleTest) Java14IncompatibleTest(com.newrelic.test.marker.Java14IncompatibleTest) Test(org.junit.Test) Java11IncompatibleTest(com.newrelic.test.marker.Java11IncompatibleTest) Java15IncompatibleTest(com.newrelic.test.marker.Java15IncompatibleTest) Java12IncompatibleTest(com.newrelic.test.marker.Java12IncompatibleTest)

Aggregations

Introspector (com.newrelic.agent.introspec.Introspector)452 Test (org.junit.Test)432 TransactionEvent (com.newrelic.agent.introspec.TransactionEvent)150 Java16IncompatibleTest (com.newrelic.test.marker.Java16IncompatibleTest)88 Java17IncompatibleTest (com.newrelic.test.marker.Java17IncompatibleTest)88 Java11IncompatibleTest (com.newrelic.test.marker.Java11IncompatibleTest)86 Java12IncompatibleTest (com.newrelic.test.marker.Java12IncompatibleTest)86 Java13IncompatibleTest (com.newrelic.test.marker.Java13IncompatibleTest)86 Java14IncompatibleTest (com.newrelic.test.marker.Java14IncompatibleTest)86 Java15IncompatibleTest (com.newrelic.test.marker.Java15IncompatibleTest)86 DatastoreHelper (com.newrelic.agent.introspec.DatastoreHelper)69 ExternalRequest (com.newrelic.agent.introspec.ExternalRequest)51 TracedMetricData (com.newrelic.agent.introspec.TracedMetricData)51 URI (java.net.URI)41 Java7IncompatibleTest (com.newrelic.test.marker.Java7IncompatibleTest)32 TransactionTrace (com.newrelic.agent.introspec.TransactionTrace)25 TraceSegment (com.newrelic.agent.introspec.TraceSegment)19 Matchers.containsString (org.hamcrest.Matchers.containsString)16 Java10IncompatibleTest (com.newrelic.test.marker.Java10IncompatibleTest)13 Java9IncompatibleTest (com.newrelic.test.marker.Java9IncompatibleTest)13