JBoss.org Community Documentation
Running tests with aop is a different matter since the maven tests plugin is rather complex. But we can add the hooks we need to run it both compiletime and loadtime with the maven tests too. An example on how to run a test thats been aop compiled:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4</version> <configuration> <forkMode>always</forkMode> <useSystemClassLoader>true</useSystemClassLoader> <argLine>-Djboss.aop.path=src/main/resources/jboss-aop_testcase.xml</argLine> </configuration> </plugin>
To run it loadtime we only need to add the javaagent option to argLine. Like this:
<argLine>-javaagent:${settings.localRepository}/org/jboss/jboss-aop/2.0.0.CR3/\ jboss-aop-2.0.0.CR3.jar \ -Djboss.aop.path=src/main/resources/jboss-aop_testcase.xml</argLine>
- big thanks to henrik and finn for figuring out how to do this :) Note again that the versions used here are just for a reference and to provide as examples. Check the JBoss AOP homepage for the up-to-date versions.