manager.addAspectDefinition(def);
manager.addInterceptorFactory(advice.getName(), advice);
manager.addPointcut(pointcut);
manager.addBinding(binding);
AOPProxyFactoryParameters params = new AOPProxyFactoryParameters();
params.setTarget(new POJO());
GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory();
POJO plain = (POJO)factory.createAdvisedProxy(params);
assertFalse(plain instanceof AspectManaged);
MetaData someAnnMD = setupMetaData(POJO.class, new SomeAnnotationImpl());
params.setMetaData(someAnnMD);
params.setMetaDataHasInstanceLevelData(true);
params.setContainerCache(null);
POJO instanceAnnotationWithNoBindings = (POJO)factory.createAdvisedProxy(params);
assertFalse(instanceAnnotationWithNoBindings instanceof AspectManaged);
MetaData annMD = setupMetaData(POJO.class, new AnnotationImpl());
params.setMetaData(annMD);
params.setMetaDataHasInstanceLevelData(true);
params.setContainerCache(null);
POJO instanceAnnotationWithBindings = (POJO)factory.createAdvisedProxy(params);
assertFalse(instanceAnnotationWithBindings instanceof AspectManaged);
assertTrue(TestInterceptor.invoked);
InterfaceIntroduction intro = new InterfaceIntroduction("intro", "@" + SomeAnnotation.class.getName(), new String[] {SomeInterface.class.getName()});
manager.addInterfaceIntroduction(intro);
params.setMetaData(someAnnMD);
params.setContainerCache(null);
POJO introduced = (POJO)factory.createAdvisedProxy(params);
assertTrue(introduced instanceof AspectManaged);
assertTrue(introduced instanceof SomeInterface);
}
finally