Search in sources :

Example 1 with OrClassMatcher

use of com.newrelic.agent.instrumentation.classmatchers.OrClassMatcher in project newrelic-java-agent by newrelic.

the class InstrumentationConstructorTest method andOrClassMatchers.

@Test
public void andOrClassMatchers() throws Exception {
    String classes = "[ !exact_class_matcher 'java/lang/Dude', !exact_class_matcher 'java/lang/Object' ]";
    ClassMatcher[] matchers = new ClassMatcher[] { new ExactClassMatcher("java/lang/Dude"), new ExactClassMatcher("java/lang/Object") };
    AndClassMatcher classMatcher = load("!and_class_matcher " + classes);
    Assert.assertEquals(new AndClassMatcher(matchers), classMatcher);
    ClassMatcher orClassMatcher = load("!or_class_matcher " + classes);
    Assert.assertEquals(OrClassMatcher.getClassMatcher(matchers), orClassMatcher);
}
Also used : ExactClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher) ClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ClassMatcher) AndClassMatcher(com.newrelic.agent.instrumentation.classmatchers.AndClassMatcher) OrClassMatcher(com.newrelic.agent.instrumentation.classmatchers.OrClassMatcher) ChildClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ChildClassMatcher) ExactClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher) AndClassMatcher(com.newrelic.agent.instrumentation.classmatchers.AndClassMatcher) Test(org.junit.Test)

Aggregations

AndClassMatcher (com.newrelic.agent.instrumentation.classmatchers.AndClassMatcher)1 ChildClassMatcher (com.newrelic.agent.instrumentation.classmatchers.ChildClassMatcher)1 ClassMatcher (com.newrelic.agent.instrumentation.classmatchers.ClassMatcher)1 ExactClassMatcher (com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher)1 OrClassMatcher (com.newrelic.agent.instrumentation.classmatchers.OrClassMatcher)1 Test (org.junit.Test)1