Search in sources :

Example 1 with ClassName

use of com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName in project newrelic-java-agent by newrelic.

the class ExtensionConversionUtilityTest method createClassMatcher.

@Test
public void createClassMatcher() throws XmlException {
    Pointcut pointcut = new Pointcut();
    ClassName name = new ClassName();
    name.setValue(ArrayList.class.getName());
    pointcut.setClassName(name);
    ClassMatcher classMatcher = ExtensionConversionUtility.createClassMatcher(pointcut, "test");
    Assert.assertTrue(classMatcher instanceof ExactClassMatcher);
    Assert.assertTrue(classMatcher.isMatch(ArrayList.class));
}
Also used : Pointcut(com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut) ExactClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher) ClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ClassMatcher) ExactClassMatcher(com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher) ClassName(com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with ClassName

use of com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName in project newrelic-java-agent by newrelic.

the class ReinstrumentUtilsTest method setClassName.

private static void setClassName(Pointcut pc, Class clazz) {
    ClassName name = new ClassName();
    name.setValue(clazz.getName());
    pc.setClassName(name);
}
Also used : ClassName(com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName)

Example 3 with ClassName

use of com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName in project newrelic-java-agent by newrelic.

the class ExtensionConversionUtilityTest method createClassMatcher_empty.

@Test(expected = XmlException.class)
public void createClassMatcher_empty() throws XmlException {
    Pointcut pointcut = new Pointcut();
    ClassName name = new ClassName();
    name.setValue(ArrayList.class.getName());
    ExtensionConversionUtility.createClassMatcher(pointcut, "test");
}
Also used : Pointcut(com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut) ClassName(com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ClassName (com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut.ClassName)3 Pointcut (com.newrelic.agent.extension.beans.Extension.Instrumentation.Pointcut)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 ClassMatcher (com.newrelic.agent.instrumentation.classmatchers.ClassMatcher)1 ExactClassMatcher (com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher)1