Configure Ant Run Cactus Test
Settings for the class path
We're going to set the client (in the Ant junit Task) setting classpath, and put the class shown in the right half on the server or WebApp classpath.
Client Cactus.properties
We know that Cactus needs redirector agents to work, except that we take these agents to the corresponding WebApp classpath (for filter and servlet proxies) or WebApp paths (for JSP proxies), We also need to tell the client where the test instance is going to find these agents, and here's what cactus.properties:
Cactus.contexturl = Http://localhost:8080/test
Where test is the context path of the test WebApp.
Cactus.properties must also be placed in the classpath of the Ant junit task.
Settings for server (assumed Tomcat 4.12) Server.xml
We must add Cactus Redirector proxies in Server.xml to allow these agents to accept requests from client test instances. For detailed additions, see the Cactus documentation.
With the correct junit classpath settings, the rest is the same as the normal JUnit test.
1.4 Clover Test Coverage calculation
Clover coverage calculation tool by inserting relevant instructions in the source code, the instructions are executed when the source code is executed to count the number of times the source code was executed, clover use a database to hold the data. Clover also provides tools to access the database and generates HTML report documents.
Configure Ant run Clover analysis
Clover implemented some ant tasks, the following is the code that defines these tasks in ant
<taskdef resource= "Clovertasks" >
<classpath>
<pathelement location= "${clover.jar}"/>
</classpath>
</taskdef>