use of com.navercorp.pinpoint.test.MockApplicationContext 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;
}
use of com.navercorp.pinpoint.test.MockApplicationContext 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;
}
use of com.navercorp.pinpoint.test.MockApplicationContext in project pinpoint by naver.
the class BasePinpointTest method setup.
public void setup(TestContext testContext) {
MockApplicationContext mockApplicationContext = testContext.getMockApplicationContext();
DataSender spanDataSender = mockApplicationContext.getSpanDataSender();
if (spanDataSender instanceof ListenableDataSender) {
ListenableDataSender listenableDataSender = (ListenableDataSender) spanDataSender;
final TBaseRecorder tBaseRecord = new TBaseRecorder();
listenableDataSender.setListener(new ListenableDataSender.Listener() {
@Override
public boolean handleSend(TBase<?, ?> data) {
return tBaseRecord.add(data);
}
});
setTBaseRecorder(tBaseRecord);
}
ServerMetaDataHolder serverMetaDataHolder = mockApplicationContext.getTraceContext().getServerMetaDataHolder();
if (serverMetaDataHolder instanceof ResettableServerMetaDataHolder) {
ResettableServerMetaDataHolder resettableServerMetaDataHolder = (ResettableServerMetaDataHolder) serverMetaDataHolder;
this.setServerMetaDataHolder(resettableServerMetaDataHolder);
}
this.serverMetaDataHolder.addListener(this.listener);
}
Aggregations