This tutorial explains where to get Cactus samples and how to use them.
There are some samples available as part of the documentation. The samples depend on the kind of test case you are writing (Servlet, Taglibs, Filters, ...). For this reason you'll find some samples in the TestCase Howto tutorial.
However, the majority of Cactus samples are in the form of source
samples. These samples are part of the Cactus distribution that
you have downloaded (in the samples
directory).
The following section explains how to execute the Cactus Samples using Ant or Maven2(the Maven2 execution only calls the Ant execution). If you wish to integrate them in your own build system or in your favorite IDE, you'll have to understand the principles first and manually install them (read the Getting Started and the Configuration Howto tutorials). Some detailed explanations for IDE integration are also available in the IDE Howto tutorial.
You need to install the following items prior to building the Cactus Sample application:
m2
repository.
The installation of Ivy is pretty straight-forward: simply place the two Ivy
jars(ivy-[version].jar
and ivy-core[version].jar
) in the ANT_HOME/lib
directory.
[downloaded_directory]/samples
directory
sampleroot
.
sampleroot
directory and select which samples you want to run. To run all of the
dependencies type in sampleroot
the following: mvn install
.
If you want to run just one type of samples, cd to the corresponding directory and
type agsain mvn install
. What will happen is that Maven will get all of the
dependencies(approximately 10-15 min.) and then will invoke Ant to execute the tests.
Ant will call Cargo to get the container that is needed to execute the tests in (approximately 5-10 min.)
and will execute the tests (approximately 2-3 mins.) As you can see the majority of time
is spent on getting the dependencies and the containers. Hopefully this is done only one time(dependencies)
or until you call mvn clean
(containers).