public class InstanceAdvisedTestCase extends AbstractProxyTest
{
public void testInstanceAdvised() throws Exception
{
SimpleBean bean1 = new SimpleBean();
Simple simple1 = (Simple) assertCreateProxy(bean1, Simple.class);
SimpleBean bean2 = new SimpleBean();
Simple simple2 = (Simple) assertCreateProxy(bean2, Simple.class);
InstanceInterceptor.last = null;
simple1.doSomething();
assertTrue(bean1.invoked);
Object instance1 = InstanceInterceptor.last;
assertNotNull(instance1);
InstanceInterceptor.last = null;
simple2.doSomething();
assertTrue(bean2.invoked);
Object instance2 = InstanceInterceptor.last;
assertNotNull(instance2);
assertFalse(instance1 == instance2);
}