Search in sources :

Example 1 with CachedWeavePackage

use of com.newrelic.weave.weavepackage.CachedWeavePackage in project newrelic-java-agent by newrelic.

the class TestCachedWeavePackage method testCachedWeavePackage.

/**
 * Test to make sure internal WeavePackage caching is working.
 */
@Test
public void testCachedWeavePackage() {
    WeavePackage internalPackage = manager.getWeavePackage("com.newrelic.instrumentation.servlet-2.4");
    Assert.assertNotNull(internalPackage);
    Assert.assertTrue("Class type is " + internalPackage.getClass().getName(), internalPackage instanceof CachedWeavePackage);
    WeavePackage externalPackage = manager.getWeavePackage("Weave Test");
    Assert.assertNotNull(externalPackage);
    Assert.assertFalse(externalPackage instanceof CachedWeavePackage);
}
Also used : CachedWeavePackage(com.newrelic.weave.weavepackage.CachedWeavePackage) WeavePackage(com.newrelic.weave.weavepackage.WeavePackage) CachedWeavePackage(com.newrelic.weave.weavepackage.CachedWeavePackage) Test(org.junit.Test)

Aggregations

CachedWeavePackage (com.newrelic.weave.weavepackage.CachedWeavePackage)1 WeavePackage (com.newrelic.weave.weavepackage.WeavePackage)1 Test (org.junit.Test)1