|
Last update : September 25 2001
About
What is Cactus ?
Features/Status
Goals
News/Changes
Roadmap/Todo
Contributors
Contributing
License
Feedback
Downloads
Downloads
Documentation
How it works ?
Getting Started
Mock vs Container
API Reference
Howto Guides
Config Howto
TestCase Howto
Ant Howto
HttpUnit Howto
Sample Howto
EJB Howto
IDE Howto
Support
Bug database
Mailing list
FAQ
Misc.
Why the name ?
Resources
Developers
CVS
Coding Conventions
|
Current scope and status of Cactus |

 |
Support for testing the View layer is done through integration
with HttpUnit.
This is functional testing and not unit testing.
|
 |
EJB unit testing is done by calling the EJB to unit test as you
would if you were writing code to call an EJB from a servlet.
|
|
General design features |
-
Cactus gives you a very good confidence that your code is going
to run fine on the server it will be deployed to (thanks to Cactus
in-container approach that executes the test inside the
container),
-
Cactus let you test container interactions. This is essential
in a world where containers are providing more and more
features for their components every day,
-
Cactus let you test and automate the deployment process to your
server (using prebuilt powerful custom Ant task),
-
Cactus does not mandate any change to your classes to test, although
it helps think about writing better code and do some refactoring,
-
Cactus provides a good middle ground in term of test graininess :
too fine-grained tests are hard to write (like mock objects tests
that completely simulates the domain objects and focus exclusively
on unit testing your logic code) and need complementary tests. Too
coarse-grained tests (like functional tests) are not enough to
easily uncover bugs and work in a iterative development process
where tests are run very often to ensure everything is working
|
Detailed feature list |
-
Integrates seamlessly with the JUnit testing framework. Any tool
that works with JUnit will work with Cactus because a Cactus test
is a JUnit test ! See
TestCase Howto
tutorial for details.
-
Provides a
ServletTestCase class that your test case
must extends for unit testing Servlets or any java classes that
make use of Servlet API objects.
-
Provides a
JspTestCase class that your test case
must extends for unit testing Taglibs or any java classes that
make use of JSP API objects.
-
Provides a
FilterTestCase class that your test case
must extends for unit testing Filters or any java classes that
make use of Filter API objects (Cactus 1.2 only).
-
Extends JUnit by defining two additional (and optional) methods
that can be implemented for each test case (i.e. for each
testXXX() method) : beginXXX() and
endXXX() . See the
TestCase Howto tutorial
for details.
-
Predefined Ant build scripts that demonstrate how to automate Cactus
unit tests (automatically starting your servlet engine, running the
tests and stopping your server). There are scripts provided for the
following Servlet engines (but it is easy to add new engines) :
-
Tomcat 3.2 (Servlet API 2.2)
-
Tomcat 3.3 (Servlet API 2.2)
-
Tomcat 4.0 (Servlet API 2.3)
-
Resin 1.2 (Servlet API 2.2)
-
Resin 1.3 (Servlet API 2.3)
-
Resin 2.0 (Servlet API 2.2 and 2.3)
-
WebLogic 5.1 (Servlet API 2.2)
-
Orion 1.4 (Servlet API 2.2 and 2.3)
-
Orion 1.5 (Servlet API 2.2 and 2.3)
-
Handles
setUp() and tearDown() methods
which work the same as for JUnit except that they are run on the
server side before and after calling each testXXX()
method
-
Tested with all versions of JUnit up to 3.7 included
-
Support for Servlet API 2.2 and 2.3 (Support for Servlet API 2.1 is
no longer provided)
-
Works with JDK 1.2 or 1.3 (not tested with 1.4 yet)
-
Wraps some of the standard API objects in order to provide
additional methods to help write unit tests.
See the TestCase
Howto tutorial for details.
-
Transparent Log4j logging (if you don't have Log4j in your classpath
no logging is done) for helping debugging problems.
-
HttpUnit integration. See the
HttpUnit Howto) tutorial
for details (for Cactus 1.2 only). This enables
Cactus to provide strong and integrated functional
testing features.
|
|
|