JUnit is the unit framework in testing which helps in JAVA Programming to get quality products. It is known as xUnit and later changed to JUnit.
ANT JUnit Test can be run automatically and uses JUnit task as a part of a build process.
Description
To start testing, create a test target based on compile. The junit can perform the following tasks like
Printing summary – printsummary
Halting on failure – haltonfailure
Displaying the output – showoutput
It also uses failureproperty while performing the event. If any of the event gets failed, it terminates the entire project. If the event fails, war file building would be not helpful.
Further
Process
Now, include junit.jar in class path to use junit. Also, include build/classes directory in classpath.formatter that defines the type of format for test output. Here, HTML output is required and hence use XML format.
Then, the test class is called and a report directory is attached to it by writing the resulting file. However, the resulting file will not be in readable format, so, it should be converted to HTML. For that, specification is given to fileset tag such that beginning with test and ending as XML.