Search in sources :

Example 1 with TestInterceptor2

use of com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2 in project pinpoint by naver.

the class AnnotatedInterceptorFactoryTest method test12.

@Test
public void test12() throws Exception {
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor2.class.getName(), null, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor2.class, interceptor.getClass());
    assertEquals(null, getField(interceptor, "field0"));
    assertEquals(0, getField(interceptor, "field1"));
    assertEquals(0.0, getField(interceptor, "field2"));
    assertEquals(false, getField(interceptor, "field3"));
    assertEquals(0L, getField(interceptor, "field4"));
    assertSame(descriptor, getField(interceptor, "descriptor"));
    assertSame(instrumentClass, getField(interceptor, "targetClass"));
    assertSame(instrumentMethod, getField(interceptor, "targetMethod"));
}
Also used : TestInterceptor2(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 2 with TestInterceptor2

use of com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2 in project pinpoint by naver.

the class AnnotatedInterceptorFactoryTest method test9.

@Test
public void test9() throws Exception {
    Object[] args = new Object[] { "arg0", 1, 2.0, true, 3L };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor2.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor2.class, interceptor.getClass());
    assertEquals(args[0], getField(interceptor, "field0"));
    assertEquals(args[1], getField(interceptor, "field1"));
    assertEquals(args[2], getField(interceptor, "field2"));
    assertEquals(args[3], getField(interceptor, "field3"));
    assertEquals(args[4], getField(interceptor, "field4"));
    assertSame(descriptor, getField(interceptor, "descriptor"));
    assertSame(instrumentClass, getField(interceptor, "targetClass"));
    assertSame(instrumentMethod, getField(interceptor, "targetMethod"));
}
Also used : TestInterceptor2(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 3 with TestInterceptor2

use of com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2 in project pinpoint by naver.

the class AnnotatedInterceptorFactoryTest method test13.

@Test
public void test13() throws Exception {
    Object[] args = new Object[] { "arg0" };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor2.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor2.class, interceptor.getClass());
    assertEquals(args[0], getField(interceptor, "field0"));
    assertEquals(0, getField(interceptor, "field1"));
    assertEquals(0.0, getField(interceptor, "field2"));
    assertEquals(false, getField(interceptor, "field3"));
    assertEquals(0L, getField(interceptor, "field4"));
    assertSame(descriptor, getField(interceptor, "descriptor"));
    assertSame(instrumentClass, getField(interceptor, "targetClass"));
    assertNull(getField(interceptor, "targetMethod"));
}
Also used : TestInterceptor2(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 4 with TestInterceptor2

use of com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2 in project pinpoint by naver.

the class AnnotatedInterceptorFactoryTest method test10.

@Test
public void test10() throws Exception {
    Object[] args = new Object[] { "arg0", 1, 2.0 };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor2.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor2.class, interceptor.getClass());
    assertEquals(args[0], getField(interceptor, "field0"));
    assertEquals(args[1], getField(interceptor, "field1"));
    assertEquals(args[2], getField(interceptor, "field2"));
    assertEquals(false, getField(interceptor, "field3"));
    assertEquals(0L, getField(interceptor, "field4"));
    assertSame(descriptor, getField(interceptor, "descriptor"));
    assertSame(instrumentClass, getField(interceptor, "targetClass"));
    assertSame(instrumentMethod, getField(interceptor, "targetMethod"));
}
Also used : TestInterceptor2(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 5 with TestInterceptor2

use of com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2 in project pinpoint by naver.

the class AnnotatedInterceptorFactoryTest method test11.

@Test
public void test11() throws Exception {
    Object[] args = new Object[] { "arg0", 1 };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor2.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor2.class, interceptor.getClass());
    assertEquals(args[0], getField(interceptor, "field0"));
    assertEquals(args[1], getField(interceptor, "field1"));
    assertEquals(0.0, getField(interceptor, "field2"));
    assertEquals(false, getField(interceptor, "field3"));
    assertEquals(0L, getField(interceptor, "field4"));
    assertSame(descriptor, getField(interceptor, "descriptor"));
    assertSame(instrumentClass, getField(interceptor, "targetClass"));
    assertSame(instrumentMethod, getField(interceptor, "targetMethod"));
}
Also used : TestInterceptor2(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Aggregations

Interceptor (com.navercorp.pinpoint.bootstrap.interceptor.Interceptor)5 AnnotatedInterceptorFactory (com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory)5 TestInterceptor2 (com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor2)5 Test (org.junit.Test)5