Search in sources :

Example 1 with MockApplicationContextFactory

use of com.navercorp.pinpoint.test.MockApplicationContextFactory in project pinpoint by naver.

the class AccessorInjectionTest method getTestClassLoader.

private TestClassLoader getTestClassLoader() {
    LoggerContext context = LogManager.getContext();
    PLoggerFactory.initialize(new Log4j2Binder(context));
    DefaultProfilerConfig profilerConfig = new DefaultProfilerConfig();
    MockApplicationContextFactory factory = new MockApplicationContextFactory();
    this.applicationContext = factory.build(profilerConfig);
    this.applicationContext.start();
    TestClassLoader testClassLoader = new TestClassLoader(applicationContext);
    testClassLoader.initialize();
    return testClassLoader;
}
Also used : MockApplicationContextFactory(com.navercorp.pinpoint.test.MockApplicationContextFactory) TestClassLoader(com.navercorp.pinpoint.test.classloader.TestClassLoader) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) Log4j2Binder(com.navercorp.pinpoint.profiler.logging.Log4j2Binder) LoggerContext(org.apache.logging.log4j.spi.LoggerContext)

Example 2 with MockApplicationContextFactory

use of com.navercorp.pinpoint.test.MockApplicationContextFactory in project pinpoint by naver.

the class TestContext method createMockApplicationContext.

private DefaultApplicationContext createMockApplicationContext(String configPath) {
    logger.trace("agent create");
    MockApplicationContextFactory factory = new MockApplicationContextFactory();
    return factory.build(configPath);
}
Also used : MockApplicationContextFactory(com.navercorp.pinpoint.test.MockApplicationContextFactory)

Aggregations

MockApplicationContextFactory (com.navercorp.pinpoint.test.MockApplicationContextFactory)2 DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)1 Log4j2Binder (com.navercorp.pinpoint.profiler.logging.Log4j2Binder)1 TestClassLoader (com.navercorp.pinpoint.test.classloader.TestClassLoader)1 LoggerContext (org.apache.logging.log4j.spi.LoggerContext)1