Search in sources :

Example 1 with MockTraceContextFactory

use of com.navercorp.pinpoint.profiler.context.MockTraceContextFactory in project pinpoint by naver.

the class ActiveTraceRepositoryTest method setUp.

@Before
public void setUp() {
    final ProfilerConfig profilerConfig = Mockito.mock(ProfilerConfig.class);
    Mockito.when(profilerConfig.isTraceAgentActiveThread()).thenReturn(true);
    Mockito.when(profilerConfig.isSamplingEnable()).thenReturn(true);
    Mockito.when(profilerConfig.getSamplingRate()).thenReturn(SAMPLING_RATE);
    MockTraceContextFactory mockTraceContextFactory = MockTraceContextFactory.newTestTraceContextFactory(profilerConfig);
    this.traceContext = mockTraceContextFactory.getTraceContext();
    this.transactionCounter = new DefaultTransactionCounter(mockTraceContextFactory.getIdGenerator());
    this.activeTraceRepository = mockTraceContextFactory.getActiveTraceRepository();
}
Also used : DefaultTransactionCounter(com.navercorp.pinpoint.profiler.context.id.DefaultTransactionCounter) MockTraceContextFactory(com.navercorp.pinpoint.profiler.context.MockTraceContextFactory) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) Before(org.junit.Before)

Aggregations

ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)1 MockTraceContextFactory (com.navercorp.pinpoint.profiler.context.MockTraceContextFactory)1 DefaultTransactionCounter (com.navercorp.pinpoint.profiler.context.id.DefaultTransactionCounter)1 Before (org.junit.Before)1