assertEquals(1, Interceptions.size());
assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(0));
System.out.println("---- Adding more interceptors");
InstanceAdvisor pojoIa1 = ((Advised)pojo1)._getInstanceAdvisor();
pojoIa1.insertInterceptor(new MyInterceptor());
Interceptions.clear();
pojo1.someMethod(123);
assertEquals(2, Interceptions.size());
assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(1));
pojoIa1.appendInterceptor(new YourInterceptor());
Interceptions.clear();
pojo1.someMethod(123);
assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(1));
assertEquals(Interceptions.getMethodName("YourInterceptor", "POJO", "someMethod"), Interceptions.get(2));
System.out.println("Testing SubPOJO");
SubPOJO sub1 = new SubPOJO();
Interceptions.clear();
sub1.someMethod(123);
assertEquals(1, Interceptions.size());
assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(0));
InstanceAdvisor subPojoIa1 = ((Advised)sub1)._getInstanceAdvisor();
subPojoIa1.insertInterceptor(new MyInterceptor());
subPojoIa1.appendInterceptor(new YourInterceptor());
Interceptions.clear();
sub1.someMethod(123);
assertEquals(3, Interceptions.size());
assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));