Re: [aspectwerkz-user] aspectwerkz , ant and junit

Mattias Jiderhamn <[email protected]> Wed, 23 Nov 2005 08:31:14 +0100
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
At 2005-11-23 06:10, you wrote:
>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.

Try to execute the JUnit tests with fork="true", since this *might* 
be a classloader issue.

   /Mattias Jiderhamn