[aspectwerkz-user] aspectwerkz , ant and junit

Colin Taylor <[email protected]> Wed, 23 Nov 2005 18:10:22 +1300
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Hi there, having a bit of bit somewhere between ant, junit, and aspectwerkz.

I making a dynamic proxy with makeProxyAdvisable set to true but for some
reason this fails in my units tests .. ie. I get a ClassCastException

So :

1.        Object proxy = Proxy.newInstance(classToProxy, false, true);  //
not an instanceof Advisable

2.        ((Advisable) proxy).aw_addAdvice(ASYNCHABLE_METHOD,new
SchedulingAdvice(this, schedule, serviceClass)); // ClassCastException.

Presumably

Does anyone have any suggestions? I guess I could mock out Aspectwerkz with
JMock but seems like a tricky hassle.  Is that how these things are normally
done ?


cheers for any help
Colin.