use of com.newrelic.agent.instrumentation.InstrumentedClass in project newrelic-java-agent by newrelic.
the class WeaveTest method classAnnotation.
@Test
public void classAnnotation() throws NoSuchMethodException, SecurityException {
InstrumentedClass annotation = TestClass.class.getAnnotation(InstrumentedClass.class);
Assert.assertNotNull(annotation);
Assert.assertFalse(annotation.legacy());
}
use of com.newrelic.agent.instrumentation.InstrumentedClass in project newrelic-java-agent by newrelic.
the class AgentTest method testAnnotations.
@Test
public void testAnnotations() throws SecurityException, NoSuchMethodException {
InstrumentedClass annotation = HttpServlet.class.getAnnotation(InstrumentedClass.class);
Assert.assertNotNull(annotation);
Assert.assertFalse(annotation.legacy());
Method m = HttpServlet.class.getMethod("service", ServletRequest.class, ServletResponse.class);
Assert.assertNotNull(m);
InstrumentedMethod methodAnnotation = m.getAnnotation(InstrumentedMethod.class);
Assert.assertNotNull(methodAnnotation);
Assert.assertEquals(InstrumentationType.TracedWeaveInstrumentation, methodAnnotation.instrumentationTypes()[0]);
// Assert.assertEquals(HttpServletPointCut.class.getName(), methodAnnotation.instrumentationName());
// m = HttpServlet.class.getMethod("service", HttpServletRequest.class, HttpServletResponse.class);
// annotations = m.getAnnotations();
// Assert.assertTrue(annotations.length == 0);
// Assert.assertTrue(Arrays.asList(annotations).toString(), annotations[0] instanceof Instrumented);
}
Aggregations