Search in sources :

Example 1 with TestInterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder in project pinpoint by naver.

the class DefaultApplicationContextTest method newApplicationContext.

private DefaultApplicationContext newApplicationContext() {
    ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
    when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
    // when(profilerConfig.getTransportModule()).thenReturn("GRPC");
    Instrumentation instrumentation = mock(Instrumentation.class);
    AgentOption agentOption = new DefaultAgentOption(instrumentation, "mockAgentId", "mockAgentName", "mockApplicationName", false, profilerConfig, Collections.<String>emptyList(), Collections.<String>emptyList());
    InterceptorRegistryBinder interceptorRegistryBinder = new TestInterceptorRegistryBinder();
    Module interceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(interceptorRegistryModule);
    return new DefaultApplicationContext(agentOption, moduleFactory);
}
Also used : DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) Instrumentation(java.lang.instrument.Instrumentation) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) Module(com.google.inject.Module)

Example 2 with TestInterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder in project pinpoint by naver.

the class JavassistEngineTest method newJavassistEngine.

private InstrumentEngine newJavassistEngine() {
    Instrumentation instrumentation = mock(Instrumentation.class);
    ObjectBinderFactory objectBinderFactory = mock(ObjectBinderFactory.class);
    Provider<ApiMetaDataService> apiMetaDataService = Providers.of(mock(ApiMetaDataService.class));
    InterceptorRegistryBinder binder = new TestInterceptorRegistryBinder();
    return new JavassistEngine(instrumentation, objectBinderFactory, binder, apiMetaDataService, null);
}
Also used : TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) Instrumentation(java.lang.instrument.Instrumentation) ObjectBinderFactory(com.navercorp.pinpoint.profiler.objectfactory.ObjectBinderFactory) ApiMetaDataService(com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService)

Example 3 with TestInterceptorRegistryBinder

use of com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder in project pinpoint by naver.

the class DependencyGraph method newApplicationContext.

private DefaultApplicationContext newApplicationContext() {
    ProfilerConfig profilerConfig = spy(new DefaultProfilerConfig());
    Mockito.when(profilerConfig.getStaticResourceCleanup()).thenReturn(true);
    Instrumentation instrumentation = mock(Instrumentation.class);
    AgentOption agentOption = new DefaultAgentOption(instrumentation, "mockAgentId", "mockAgentName", "mockApplicationName", false, profilerConfig, Collections.<String>emptyList(), Collections.<String>emptyList());
    InterceptorRegistryBinder interceptorRegistryBinder = new TestInterceptorRegistryBinder();
    Module testInterceptorRegistryModule = InterceptorRegistryModule.wrap(interceptorRegistryBinder);
    ModuleFactory moduleFactory = new OverrideModuleFactory(testInterceptorRegistryModule);
    return new DefaultApplicationContext(agentOption, moduleFactory);
}
Also used : OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) ModuleFactory(com.navercorp.pinpoint.profiler.context.module.ModuleFactory) DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) OverrideModuleFactory(com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory) Instrumentation(java.lang.instrument.Instrumentation) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) Module(com.google.inject.Module) InterceptorRegistryModule(com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule) GraphvizModule(com.google.inject.grapher.graphviz.GraphvizModule)

Aggregations

InterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder)3 TestInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder)3 Instrumentation (java.lang.instrument.Instrumentation)3 Module (com.google.inject.Module)2 AgentOption (com.navercorp.pinpoint.bootstrap.AgentOption)2 DefaultAgentOption (com.navercorp.pinpoint.bootstrap.DefaultAgentOption)2 DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)2 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)2 GraphvizModule (com.google.inject.grapher.graphviz.GraphvizModule)1 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)1 InterceptorRegistryModule (com.navercorp.pinpoint.profiler.context.module.InterceptorRegistryModule)1 ModuleFactory (com.navercorp.pinpoint.profiler.context.module.ModuleFactory)1 OverrideModuleFactory (com.navercorp.pinpoint.profiler.context.module.OverrideModuleFactory)1 ApiMetaDataService (com.navercorp.pinpoint.profiler.metadata.ApiMetaDataService)1 ObjectBinderFactory (com.navercorp.pinpoint.profiler.objectfactory.ObjectBinderFactory)1