Search in sources :

Example 6 with ClassTransformerConfig

use of com.newrelic.agent.config.ClassTransformerConfig in project newrelic-java-agent by newrelic.

the class InstrumentationImplTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.setClassTransformerService(classTransformerService);
    serviceManager.setSamplerService(samplerService);
    serviceManager.setCoreService(mockCoreService);
    ConfigService configService = mock(ConfigService.class);
    serviceManager.setConfigService(configService);
    AgentConfigImpl agentConfig = mock(AgentConfigImpl.class);
    when(configService.getDefaultAgentConfig()).thenReturn(agentConfig);
    ClassTransformerConfig classTransformerConfig = mock(ClassTransformerConfig.class);
    when(agentConfig.getClassTransformerConfig()).thenReturn(classTransformerConfig);
}
Also used : AgentConfigImpl(com.newrelic.agent.config.AgentConfigImpl) ConfigService(com.newrelic.agent.config.ConfigService) MockServiceManager(com.newrelic.agent.MockServiceManager) ClassTransformerConfig(com.newrelic.agent.config.ClassTransformerConfig) BeforeClass(org.junit.BeforeClass)

Aggregations

ClassTransformerConfig (com.newrelic.agent.config.ClassTransformerConfig)6 WeavePackage (com.newrelic.weave.weavepackage.WeavePackage)3 WeavePackageConfig (com.newrelic.weave.weavepackage.WeavePackageConfig)3 IOException (java.io.IOException)3 AgentConfig (com.newrelic.agent.config.AgentConfig)2 CachedWeavePackage (com.newrelic.weave.weavepackage.CachedWeavePackage)2 JarInputStream (java.util.jar.JarInputStream)2 MockServiceManager (com.newrelic.agent.MockServiceManager)1 AgentConfigImpl (com.newrelic.agent.config.AgentConfigImpl)1 ConfigService (com.newrelic.agent.config.ConfigService)1 ClassLoaderPackageAccessInstrumentation (com.newrelic.agent.instrumentation.builtin.ClassLoaderPackageAccessInstrumentation)1 ClassMatchVisitorFactory (com.newrelic.agent.instrumentation.context.ClassMatchVisitorFactory)1 WeaveViolation (com.newrelic.weave.violation.WeaveViolation)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IllegalClassFormatException (java.lang.instrument.IllegalClassFormatException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 BeforeClass (org.junit.BeforeClass)1