I am trying to create
Struts unit test using AspectJ. I installed AJDT plugin in Eclipse, and created an easy aspect. There are only two pointcuts and two advices in the aspect. The first advice gets applied, and the second does not get applied because it doesn't find right match (can not find a match for Action "execute" method. I can not figure out why. Did someone had similar problems with applying advice to "execute" method :
Here is my code (
advice highligted in green, gets applied, advice hightligted in red does not get applied):
public aspect ErrorLookupAspect {
pointcut errorLookupTest(ErrorLookupActionTest actionTest):
execution(public void ErrorLookupActionTest+.test*())
&& this(actionTest);
pointcut actionExecute()
: execution(public ActionForward ErrorLookupAction.execute(..));
before(ErrorLookupActionTest actionTest)
: errorLookupTest(actionTest){
System.out.println("Before Test");
}
before(): actionExecute(){
System.out.println("Executing");
}}