assertNotSame(TestAspect.class, clazz);
assertSame(loader, clazz.getClassLoader());
Aspect aspect = assertInstanceOf(getBean("Aspect"), Aspect.class, false);
AspectDefinition def = aspect.getDefinition();
AspectFactory factory = def.getFactory();
Object global = factory.createPerVM();
assertSame(getClass().getClassLoader(), global.getClass().getClassLoader());
AspectFactoryWithClassLoader factoryCl = assertInstanceOf(factory, AspectFactoryWithClassLoader.class);
factoryCl.pushScopedClassLoader(loader);
try
{
Object scoped = factory.createPerVM();
ClassLoader scopedLoader = scoped.getClass().getClassLoader();
assertSame(loader, scopedLoader);
}
finally
{