use of com.newrelic.agent.instrumentation.classmatchers.OptimizedClassMatcher.Match in project newrelic-java-agent by newrelic.
the class OptimizedClassMatcherTest method testAnnotationMatch.
@Test
public void testAnnotationMatch() throws IOException {
InstrumentationContext instrumentationContext = getInstrumentationContext(matcher, AnnotatedClass.class);
Match match = instrumentationContext.getMatches().values().iterator().next();
Assert.assertNotNull(match);
Assert.assertEquals(2, match.getMethods().size());
Assert.assertTrue(match.getMethods().contains(new Method("annotation1", "()V")));
Assert.assertTrue(match.getMethods().contains(new Method("annotation2", "()Z")));
}
use of com.newrelic.agent.instrumentation.classmatchers.OptimizedClassMatcher.Match in project newrelic-java-agent by newrelic.
the class OptimizedClassMatcherTest method testOrMatch.
@Test
public void testOrMatch() throws IOException {
Runnable run = new Runnable() {
public void run() {
}
};
Match match = getMatch(matcher, run.getClass());
Assert.assertNotNull(match);
Assert.assertEquals(1, match.getMethods().size());
Assert.assertTrue(match.getMethods().contains(new Method("run", "()V")));
Assert.assertEquals(1, match.getClassMatches().size());
Assert.assertTrue(match.getClassMatches().containsKey(match5));
}
Aggregations