src/test-cactus
directory in your project and
put your Cactus test classes in it (with the normal package directory
structure). Note that the location of the Cactus test sources can be
configured through the cactus.src.dir
property.
build.properties
file in your project root
directory (where project.xml
is located) and define in
it the location of the container you wish to use for the tests. For
example, if you wish to run the Cactus tests on Tomcat 4.1.24 and on
Resin 2.6, you will write:
cactus.home.tomcat4x = C:/Apps/jakarta-tomcat-4.1.24 cactus.home.resin2x = C:/Apps/resin-2.1.6
maven cactus:test
(or maven cactus
for
short) to run the Cactus tests.
src/webapp/WEB-INF/web.xml
file. You can put inside the <ejb-ref>
entries
required to call your EJBs from your Cactus test case classes.
To start your EJB unit tests, simply type
maven cactus:test-ear
.
Some jars are used only for testing (for example, DbUnit). These
jars can be entered as dependencies in the project.xml
and tagged with cactus.bundle
. When the Cactus plugin
finds such jars it will automatically add them to the deployed war.
For example:
<dependency> <groupId>dbunit</groupId>> <artifactId>dbunit</artifactId>> <version>1.5.5</version> <properties> <cactus.bundle>true</cactus.bundle> </properties> </dependency>