My goal is to launch my integration tests contained within my Play app.
To do so, I used to launch them through Intellij. Those tests needs Spring aspectJ weaving, thus I precised in my Intellij test conf this VM argument:
-javaagent:/Users/myName/.ivy2/cache/org.springframework/spring-instrument/jars/spring-instrument-3.2.2.RELEASE.jar
The whole works.
Now I want to be able to launch them through command-line using the simple play
command following by test-only
command.
First I read this post dealing with the way to add any javaagent to Play app.
Thus, I modify my Play's build
file like this, adding the Spring's javaagent:
java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M ${JAVA_OPTS} -javaagent:/Users/myName/.ivy2/cache/org.springframework/spring-instrument/jars/spring-instrument-3.2.2.RELEASE.jar -Dfile.encoding=UTF-8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
However, my test merely fails.. complaining about the missing Spring's aspectJ weaving.
But it's surely logic since test-only
launches another process...
Is there a way to make my test care about aspectJ weaving using javaagent?