[jboss-user] [JBoss AOP] - Re: Different jboss-aop.xml files for unit testing

nizzy do-not-reply at jboss.com
Thu Apr 16 06:45:38 EDT 2009


Hi Flavia,

Can I just confirm a few things about my setup;

1. I would have thought the following pointcut would have worked


  | <aspect class="com.ecebs.unittest.aop.aspect.ExceptionInjector" scope="PER_CLASS" />
  | 
  | <bind pointcut="call(public void com.ecebs.unittest.aop.ExampleManagerBean->createObject(..))
  |     AND withincode(public void com.ecebs.unittest.aop.ExampleManagerBeanTest->testCreateObject_MultefileException())">
  |     	<advice name="throwMultefileException" aspect="com.ecebs.unittest.aop.aspect.ExceptionInjector" />
  | </bind>

Just to explain what I have done

ExampleManagerBean - session bean under test
ExampleManagerBeanTest - junit test

So pointcut is saying "if createObject method in session bean is called from within the junit test then execute aspect - ExceptionInjector"

Is my understanding correct?
I still can't get the aspect to be executed!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225870#4225870

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225870



More information about the jboss-user mailing list