O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automating tests with Ant

Ant provides several tasks to run test classes from the build file and generate test reports. To use these tasks, the junit.jar file must be in the Ant classpath (in the ANT_HOME/lib directory) or in the application classpath (in the application's lib directory).

The junit task is an Ant task that allows us to execute the test classes automatically with the application's build process. Here is a typical usage of the junit task inside the build.xml file, introduced in Chapter 2:

<target name="all-tests" depends="compile" description="Run All Test Cases"> <javac destdir="${target.test-classes}" debug="true" classpathref="class.path"> <src path="${test.java}"/> <classpath> <pathelement location="${target.classes}"/> </classpath> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required