Code of practice from requirements documents to design documents (v)

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.