|
From: Rob H. <ro...@ca...> - 2004-06-22 08:21:14
|
Tyson,
I have managed to narrow this down to occuring only on advised targets.
I anticipate this is a problem with the hashcode implementation of one
of the callbacks and I will hopefully have a fix by the end of the day.
Rob
On 22 Jun 2004, at 01:34, Norris, Tyson wrote:
> public void testMultipleProxies() {
> ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class
> });
> pf.setProxyTargetClass(true);
>
> MethodInterceptor static1 = new NopInterceptor();
>
> // MethodInterceptor static2 = new
> Advices.ReadDataInterceptor();
>
> pf.addInterceptor(static1);
> // pf.addInterceptor(static2);
>
> // Advisor static3 = new Advices.SetterPointCut(new
> Advices.NopInterceptor());
> // Advisor static4 = new Advices.SetterPointCut(new
> Advices.ReadDataInterceptor());
> //
> // pf.addAdvisor(static3);
> // pf.addAdvisor(static4);
>
> // pf.addAdvisor(new Advices.ObjectReturnPointCut(new
> Advices.NopInterceptor()));
>
> TestBean target = new TestBean();
> TestBean target2 = new TestBean();
>
>
> pf.setTarget(target);
> pf.setFrozen(true);
> pf.setExposeProxy(false);
>
> ProxyFactory pf2 = new ProxyFactory(new Class[] {
> ITestBean.class });
> pf2.copyFrom(pf);
> pf2.setTarget(target2);
>
>
> ITestBean proxy1 = (ITestBean) pf.getProxy();
> ITestBean proxy2 = (ITestBean) pf2.getProxy();
>
> System.out.println(proxy1.getClass().getName());
> System.out.println(proxy2.getClass().getName());
>
> assertTrue(proxy1.getClass() == proxy2.getClass());
>
> }
|