Fixing build breakage with GroovyScriptFactoryTests.

The problem was that the Messenger object was not being proxed (assertTrue(AopUtils.isAopProxy(messenger)) was returning false).  The cause for this seemed to be that the
pointcut was malformed / out of date, reading execution(* org.springframework.scripting.Messenger.*(..)), when the groovy Messenger class is actually declared in the org.springframework.scripting.groovy package.
I tried updating the fully-qualified package name in the pointcut expression, and this caused AspectJ matching errors saying that there was not such type that matches that FQ name.
So as a final resort, I removed the full-qualification entirely and went with execution(* *..Messenger.*(..)).  All tests pass now, but it raises the question, why was AJ having matching errors?  Is it because
the pointcut matching is being done before the groovy class is loaded?  There could be a potential bug here.
master
Chris Beams 16 years ago
parent 7d10d05b27
commit 7ba4c563a6
  1. 2
      org.springframework.context/src/test/java/org/springframework/scripting/groovy/groovy-with-xsd.xml

@ -8,7 +8,7 @@
<aop:config> <aop:config>
<aop:aspect ref="getMessageAspect"> <aop:aspect ref="getMessageAspect">
<aop:before method="before" pointcut="execution(* org.springframework.scripting.Messenger.*(..))"/> <aop:before method="before" pointcut="execution(* *..Messenger.*(..))"/>
</aop:aspect> </aop:aspect>
</aop:config> </aop:config>

Loading…
Cancel
Save