I'm writing an Ant script to do some additional checks on my Play! Framework Application.

Currently, I am executing my tests from my Ant script by simply making an exec call to "play auto-test".

    <exec executable="${play.dir}/play.bat">
        <arg line="auto-test"/>
    </exec>

Would anyone know how to integrate Clover into a Play test suite? Obviously I am not tied to having to run my tests using the above.

I also tried writing the Ant script using the traditional way of executing JUnit tests (i.e. using Ant's junit target) and I got two problems:

  • When executing all my tests, only the first would execute successfully while the others would fail for strange reasons
  • If I just expose one test in my suite and have the test run successfully, it would say I have code coverage of 0%. I then thought I set up clover incorrectly, however, I created a simple class that tested a production class that did nothing and the coverage went up as I would expect.

So if I were to go down the junit route, I would need to know how to execute all my tests so that they can run one after another successfully (it works when using the Play way of running play auto-test) and I would need to know why Clover does not seem to pick up lines of code touched by Play tests.

(I know there is a Cobertura module for Play, however, I find that Clover does a better job telling me an accurate coverage figure)

Update: Unfortunately I am unable to replicate the exact error I was getting before as I have run into compilation issues when I try and compile things manually. I've started to use the Secure module and it only contains Java source files. So in my Ant script, I call play precompile which produces th

Edit
Report