Search in sources :

Example 1 with NoMethodsMatcher

use of com.newrelic.agent.instrumentation.methodmatchers.NoMethodsMatcher in project newrelic-java-agent by newrelic.

the class PointCutConfigTest method invalidMethodDescriptor.

@Test
public void invalidMethodDescriptor() throws Exception {
    PointCutConfig config = new PointCutConfig(new ByteArrayInputStream("pre:\n  class_matcher: !exact_class_matcher 'java/lang/String'\n  method_matcher: !exact_method_matcher [ 'concat', '(java/lang/String;)Ljava/lang/String;' ]\n".getBytes(StandardCharsets.UTF_8)));
    List<ExtensionClassAndMethodMatcher> pcs = config.getPointCuts();
    Assert.assertEquals(1, pcs.size());
    ExtensionClassAndMethodMatcher pc = config.getPointCuts().get(0);
    Assert.assertNotNull(pc);
    MethodMatcher methodMatcher = pc.getMethodMatcher();
    Assert.assertTrue(methodMatcher instanceof NoMethodsMatcher);
}
Also used : ExtensionClassAndMethodMatcher(com.newrelic.agent.instrumentation.custom.ExtensionClassAndMethodMatcher) NoMethodsMatcher(com.newrelic.agent.instrumentation.methodmatchers.NoMethodsMatcher) ByteArrayInputStream(java.io.ByteArrayInputStream) ExtensionClassAndMethodMatcher(com.newrelic.agent.instrumentation.custom.ExtensionClassAndMethodMatcher) MethodMatcher(com.newrelic.agent.instrumentation.methodmatchers.MethodMatcher) ExactMethodMatcher(com.newrelic.agent.instrumentation.methodmatchers.ExactMethodMatcher) Test(org.junit.Test)

Aggregations

ExtensionClassAndMethodMatcher (com.newrelic.agent.instrumentation.custom.ExtensionClassAndMethodMatcher)1 ExactMethodMatcher (com.newrelic.agent.instrumentation.methodmatchers.ExactMethodMatcher)1 MethodMatcher (com.newrelic.agent.instrumentation.methodmatchers.MethodMatcher)1 NoMethodsMatcher (com.newrelic.agent.instrumentation.methodmatchers.NoMethodsMatcher)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Test (org.junit.Test)1