/**
* Tests the annotation of an aspect factory as @Aspect.
*/
public void testAspectFactory() throws Exception
{
AdviceBinding binding = new AdviceBinding(
"execution(void *PreparedPOJO->someMethod(..))", null);
AspectDefinition aspectDefinition = AspectManager.instance()
.getAspectDefinition(AnnotatedAspectFactory.class.getName());
assertNotNull(aspectDefinition);
binding.addInterceptorFactory(new AdviceFactory(aspectDefinition,
"advice"));
AspectManager.instance().addBinding(binding);
PreparedPOJO pojo = new PreparedPOJO();
pojo.someMethod();
assertTrue(AnnotatedAspectFactory.isAspectCreated());
assertTrue(AnnotatedAspectFactory.getAspectCreated().isAdvised());
AspectManager.instance().removeBinding(binding.getName());
}