use of com.newrelic.agent.instrumentation.classmatchers.InterfaceMatcher in project newrelic-java-agent by newrelic.
the class ExtensionDomParserTest method testInterfacePointCut.
@Test
public void testInterfacePointCut() throws Exception {
Extension ext = ExtensionDomParser.readFile(getFile(INTERFACE_FILE_PATH));
Instrumentation inst = ext.getInstrumentation();
List<Pointcut> thePcs = inst.getPointcut();
Assert.assertEquals(1, thePcs.size());
Pointcut pc = thePcs.get(0);
Assert.assertNull(pc.getClassName());
Assert.assertEquals("javax.servlet.Filter", pc.getInterfaceName());
// Assert.assertEquals(ClassType.INTERFACE_NAME, pc.getClassType());
List<ExtensionClassAndMethodMatcher> pcs = ExtensionConversionUtility.convertToPointCutsForValidation(ext);
Assert.assertNotNull(pcs);
Assert.assertEquals(1, pcs.size());
ExtensionClassAndMethodMatcher actual = pcs.get(0);
Assert.assertTrue(actual.getClassMatcher() instanceof InterfaceMatcher);
}
use of com.newrelic.agent.instrumentation.classmatchers.InterfaceMatcher in project newrelic-java-agent by newrelic.
the class InstrumentationConstructorTest method interfaceMatcher.
@Test
public void interfaceMatcher() throws Exception {
InterfaceMatcher classMatcher = load("!interface_matcher 'java/lang/Runnable'");
Assert.assertEquals(new InterfaceMatcher("java/lang/Runnable"), classMatcher);
}
Aggregations