[jboss-user] [JBoss AOP] New message: "Re: withincode from JUnit test not working"

Flavia Rainone do-not-reply at jboss.com
Thu Jan 28 11:37:14 EST 2010


User development,

A new message was posted in the thread "withincode from JUnit test not working":

http://community.jboss.org/message/522811#522811

Author  : Flavia Rainone
Profile : http://community.jboss.org/people/flavia.rainone@jboss.com

Message:
--------------------------------------------------------------
Alan,
 
Taking a look at your older http://community.jboss.org/message/520849#520849, I see that the bean you're mentioning in the pointcut is an EJB session bean, is that right?
 
If it is, then I may know why is your pointcut not picking the call. When a call is made to a session bean, you are actually calling the session bean stub, whose type is unknown but implements the bean's interface. For that reason, I think that if you use instanceof{session interface type} as the class name in the call pointcut, it will work:
 
<bind pointcut="call(public void $instanceof{<fill in with the bean interface here>}->createObject(..))">
 <advice name="throwMultefileException" aspect="com.ecebs.unittest.aop.aspect.ExceptionInjector" />
</bind>



 
Let me know if that solves your problem!

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/522811#522811




More information about the jboss-user mailing list