Search in sources :

Example 1 with TestInterceptor0

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

the class AnnotatedInterceptorFactoryTest method test2.

@Test(expected = PinpointException.class)
public void test2() throws Exception {
    Object[] args = new Object[] { 1 };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    factory.getInterceptor(getClass().getClassLoader(), TestInterceptor0.class.getName(), args, null, null, instrumentClass, instrumentMethod);
}
Also used : TestInterceptor0(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor0) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 2 with TestInterceptor0

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

the class AnnotatedInterceptorFactoryTest method test14.

@Test
public void test14() throws Exception {
    String arg0 = "arg0";
    Object[] args = new Object[] { ObjectFactory.byConstructor("java.lang.String", arg0) };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor0.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor0.class, interceptor.getClass());
    assertEquals(arg0, getField(interceptor, "field0"));
}
Also used : TestInterceptor0(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor0) Interceptor(com.navercorp.pinpoint.bootstrap.interceptor.Interceptor) AnnotatedInterceptorFactory(com.navercorp.pinpoint.profiler.interceptor.factory.AnnotatedInterceptorFactory) Test(org.junit.Test)

Example 3 with TestInterceptor0

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

the class AnnotatedInterceptorFactoryTest method test0.

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

Example 4 with TestInterceptor0

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

the class AnnotatedInterceptorFactoryTest method test1.

@Test
public void test1() throws Exception {
    Object[] args = new Object[] { "arg0" };
    AnnotatedInterceptorFactory factory = newAnnotatedInterceptorFactory();
    Interceptor interceptor = factory.getInterceptor(getClass().getClassLoader(), TestInterceptor0.class.getName(), args, null, null, instrumentClass, instrumentMethod);
    assertEquals(TestInterceptor0.class, interceptor.getClass());
    assertEquals(args[0], getField(interceptor, "field0"));
}
Also used : TestInterceptor0(com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor0) 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)4 TestInterceptor0 (com.navercorp.pinpoint.profiler.plugin.TestInterceptors.TestInterceptor0)4 Test (org.junit.Test)4 Interceptor (com.navercorp.pinpoint.bootstrap.interceptor.Interceptor)3