Search in sources :

Example 11 with InstrumentContext

use of com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext in project pinpoint by naver.

the class JavassistEngineTest method testGetClass_original.

@Test
public void testGetClass_original() throws Exception {
    InstrumentEngine instrumentEngine = newJavassistEngine();
    InstrumentContext instrumentContext = mock(InstrumentContext.class);
    final byte[] originalByteCode = BytecodeUtils.getClassFile(null, mock);
    final InstrumentClass transformClass = instrumentEngine.getClass(instrumentContext, null, mock, originalByteCode);
    Assert.assertNotNull(transformClass.getDeclaredMethod("test"));
    Assert.assertNull("transform method", transformClass.getDeclaredMethod("transformMethod"));
}
Also used : InstrumentContext(com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext) InstrumentClass(com.navercorp.pinpoint.bootstrap.instrument.InstrumentClass) Test(org.junit.Test)

Aggregations

InstrumentContext (com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext)11 InstrumentClass (com.navercorp.pinpoint.bootstrap.instrument.InstrumentClass)8 Test (org.junit.Test)8 InstrumentEngine (com.navercorp.pinpoint.profiler.instrument.InstrumentEngine)6 InstrumentMethod (com.navercorp.pinpoint.bootstrap.instrument.InstrumentMethod)3 ClassFileTransformerLoader (com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader)2 PluginInstrumentContext (com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext)2 MethodDescriptor (com.navercorp.pinpoint.bootstrap.context.MethodDescriptor)1 TraceContext (com.navercorp.pinpoint.bootstrap.context.TraceContext)1 ApplicationContext (com.navercorp.pinpoint.profiler.context.module.ApplicationContext)1 GuardInstrumentContext (com.navercorp.pinpoint.profiler.instrument.GuardInstrumentContext)1 ClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector)1 DebugTransformerClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.DebugTransformerClassInjector)1 LegacyProfilerPluginClassInjector (com.navercorp.pinpoint.profiler.instrument.classloading.LegacyProfilerPluginClassInjector)1 DefaultProfilerPluginSetupContext (com.navercorp.pinpoint.profiler.plugin.DefaultProfilerPluginSetupContext)1 GuardProfilerPluginContext (com.navercorp.pinpoint.profiler.plugin.GuardProfilerPluginContext)1 SetupResult (com.navercorp.pinpoint.profiler.plugin.SetupResult)1