Java Reference
In-Depth Information
You want to automatically run your unit tests, rather than manually invoke them.
Solution
Use and configure JUnit and Ant. To do so, follow these steps:
1.
Download Apache Ant (located at http://ant.apache.org/ ).
2.
Uncompress Apache Ant into a folder (for example, c:\ant for
Windows systems or /Development for OS X).
3.
Make sure that Apache Ant can be executed from the command-line
or terminal. In Windows, this means adding the apache-ant/bin
folder to the path as follows:
a.
Go to Control Panel
System.
b.
Click Advanced system settings.
c.
Click Environment Variables.
d.
In the System Variables list, double-click the variable name
PATH .
e.
At the end of the string, add ; C:\apache-ant-1.8.2\bin
(or the folder that you uncompressed Apache Ant into).
f.
Click OK (on each of the popup boxes that were opened before)
to accept the changes.
Note Apache Ant comes pre-installed on OS X, so you do not
have to install or configure it. To verify this, open a terminal win-
dow and type ant -version to see which version is installed
on the system.
Make sure that the JAVA_HOME environment variable is defined.
In Windows, this means adding a new environment variable called
JAVA_HOME . For example:
Go to Control Panel
System.
4.
Click Advanced system settings.
Search WWH ::




Custom Search