Search in sources :

Example 16 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class InvokeMethodInterceptorTest method spyTraceContext.

private TraceContext spyTraceContext() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    TraceContext traceContext = MockTraceContextFactory.newTestTraceContext(profilerConfig);
    return spy(traceContext);
}
Also used : ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TraceContext(com.navercorp.pinpoint.bootstrap.context.TraceContext)

Example 17 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class InvokeMethodInterceptorTest method spyTraceContext.

private TraceContext spyTraceContext() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    TraceContext traceContext = MockTraceContextFactory.newTestTraceContext(profilerConfig);
    return spy(traceContext);
}
Also used : ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TraceContext(com.navercorp.pinpoint.bootstrap.context.TraceContext)

Example 18 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class JavassistClassTest method getTestClassLoader.

private TestClassLoader getTestClassLoader() {
    PLoggerFactory.initialize(new Slf4jLoggerBinder());
    DefaultProfilerConfig profilerConfig = new DefaultProfilerConfig();
    profilerConfig.setApplicationServerType(ServiceType.TEST_STAND_ALONE.getName());
    MockApplicationContext applicationContext = MockApplicationContext.of(profilerConfig);
    TestClassLoader testClassLoader = new TestClassLoader(applicationContext);
    testClassLoader.initialize();
    return testClassLoader;
}
Also used : TestClassLoader(com.navercorp.pinpoint.test.classloader.TestClassLoader) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) Slf4jLoggerBinder(com.navercorp.pinpoint.profiler.logging.Slf4jLoggerBinder) MockApplicationContext(com.navercorp.pinpoint.test.MockApplicationContext)

Example 19 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class AccessorInjectionTest method getTestClassLoader.

private TestClassLoader getTestClassLoader() {
    PLoggerFactory.initialize(new Slf4jLoggerBinder());
    DefaultProfilerConfig profilerConfig = new DefaultProfilerConfig();
    profilerConfig.setApplicationServerType(ServiceType.TEST_STAND_ALONE.getName());
    MockApplicationContext applicationContext = MockApplicationContext.of(profilerConfig);
    TestClassLoader testClassLoader = new TestClassLoader(applicationContext);
    testClassLoader.initialize();
    return testClassLoader;
}
Also used : TestClassLoader(com.navercorp.pinpoint.test.classloader.TestClassLoader) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) Slf4jLoggerBinder(com.navercorp.pinpoint.profiler.logging.Slf4jLoggerBinder) MockApplicationContext(com.navercorp.pinpoint.test.MockApplicationContext)

Example 20 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class MockApplicationContextModuleTest method test.

@Test
public void test() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    AgentOption agentOption = new DefaultAgentOption(new DummyInstrumentation(), "mockAgent", "mockApplicationName", profilerConfig, new URL[0], null, new DefaultServiceTypeRegistryService(), new DefaultAnnotationKeyRegistryService());
    final PluginApplicationContextModule pluginApplicationContextModule = new PluginApplicationContextModule();
    PluginTestAgent pluginTestAgent = new PluginTestAgent(agentOption) {

        @Override
        protected ApplicationContext newApplicationContext(AgentOption agentOption, InterceptorRegistryBinder interceptorRegistryBinder) {
            ApplicationContext applicationContext = new DefaultApplicationContext(agentOption, interceptorRegistryBinder) {

                @Override
                protected Module newApplicationContextModule(AgentOption agentOption, InterceptorRegistryBinder interceptorRegistryBinder) {
                    Module applicationContextModule = super.newApplicationContextModule(agentOption, interceptorRegistryBinder);
                    //                        PluginApplicationContextModule pluginApplicationContextModule = new PluginApplicationContextModule();
                    return Modules.override(applicationContextModule).with(pluginApplicationContextModule);
                }
            };
            return applicationContext;
        }
    };
    try {
        pluginTestAgent.start();
    } finally {
        pluginTestAgent.stop(true);
    }
}
Also used : 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) DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) ApplicationContext(com.navercorp.pinpoint.profiler.context.module.ApplicationContext) DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) DefaultServiceTypeRegistryService(com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) DefaultAnnotationKeyRegistryService(com.navercorp.pinpoint.common.service.DefaultAnnotationKeyRegistryService) Module(com.google.inject.Module) Test(org.junit.Test)

Aggregations

DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)36 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)33 Test (org.junit.Test)25 Properties (java.util.Properties)24 BeanDefinition (org.springframework.beans.factory.config.BeanDefinition)12 RootBeanDefinition (org.springframework.beans.factory.support.RootBeanDefinition)12 DefaultAnnotationKeyRegistryService (com.navercorp.pinpoint.common.service.DefaultAnnotationKeyRegistryService)5 DefaultServiceTypeRegistryService (com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService)5 AgentOption (com.navercorp.pinpoint.bootstrap.AgentOption)4 DefaultAgentOption (com.navercorp.pinpoint.bootstrap.DefaultAgentOption)4 TraceContext (com.navercorp.pinpoint.bootstrap.context.TraceContext)4 InterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder)4 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)3 Module (com.google.inject.Module)2 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)2 Slf4jLoggerBinder (com.navercorp.pinpoint.profiler.logging.Slf4jLoggerBinder)2 TestInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder)2 MockApplicationContext (com.navercorp.pinpoint.test.MockApplicationContext)2 TestClassLoader (com.navercorp.pinpoint.test.classloader.TestClassLoader)2 Instrumentation (java.lang.instrument.Instrumentation)2