Search in sources :

Example 1 with TestInterceptor1

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

the class AnnotatedInterceptorFactoryTest method test4.

@Test
public void test4() throws Exception {
    Object[] args = new Object[] { (byte) 1, (short) 2, (float) 3.0, "arg0" };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor1.class, interceptor.getClass());
    assertEquals(args[3], getField(interceptor, "field0"));
    assertEquals(args[0], getField(interceptor, "field1"));
    assertEquals(args[1], getField(interceptor, "field2"));
    assertEquals(args[2], getField(interceptor, "field3"));
}
Also used : TestInterceptor1(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 2 with TestInterceptor1

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

the class AnnotatedInterceptorFactoryTest method test8.

@Test(expected = PinpointException.class)
public void test8() throws Exception {
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), null, null, null, instrumentClass, instrumentMethod);
}
Also used : TestInterceptor1(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 3 with TestInterceptor1

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

the class AnnotatedInterceptorFactoryTest method test7.

@Test(expected = PinpointException.class)
public void test7() throws Exception {
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), null, null, null, instrumentClass, instrumentMethod);
}
Also used : TestInterceptor1(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 4 with TestInterceptor1

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

the class AnnotatedInterceptorFactoryTest method test6.

@Test
public void test6() throws Exception {
    Object[] args = new Object[] { (float) 3.0, (short) 2, (byte) 1, "arg0" };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor1.class, interceptor.getClass());
    assertEquals(args[3], getField(interceptor, "field0"));
    assertEquals(args[2], getField(interceptor, "field1"));
    assertEquals(args[1], getField(interceptor, "field2"));
    assertEquals(args[0], getField(interceptor, "field3"));
}
Also used : TestInterceptor1(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 5 with TestInterceptor1

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

the class AnnotatedInterceptorFactoryTest method test5.

@Test
public void test5() throws Exception {
    Object[] args = new Object[] { (short) 2, (float) 3.0, "arg0", (byte) 1 };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor1.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor1.class, interceptor.getClass());
    assertEquals(args[2], getField(interceptor, "field0"));
    assertEquals(args[3], getField(interceptor, "field1"));
    assertEquals(args[0], getField(interceptor, "field2"));
    assertEquals(args[1], getField(interceptor, "field3"));
}
Also used : TestInterceptor1(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Aggregations

AnnotatedInterceptorFactory (com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory)6 TestInterceptor1 (com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor1)6 Test (org.junit.Test)6 Interceptor (com.navercorp.pinpoint.bootstrap.interceptor.Interceptor)4