Appendix D. Running tests with Ant

Apache Ant is the de facto build tool used by Java developers all around the world. Not surprisingly, Ant has had JUnit integration as long as I can remember. Here’s a quick tutorial for creating an Ant script that runs our unit tests and cranks out a pretty HTML report of the results. If you’re not familiar with Ant, please refer to the online documentation[1] or grab one of the excellent books on the topic.[2]

1 Especially the User’s Manual (http://ant.apache.org/manual) and the Ant Wiki (http://wiki.apache.org/ant).

2 I would personally recommend Ant in Action by Steve Loughran and Erik Hatcher (Manning Publications, 2007). It’s basically a 2nd edition of their earlier book, Java Development with Ant ...

Get Test Driven now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.