Jakarta Cactus

Last update : April 21 2002
Doc for : v1.3

About
  • What is Cactus ?
  • News
  • Changes
  • Features/Status
  • Goals
  • Roadmap/Todo
  • Contributors
  • Contributing
  • Cactus Users
  • Tested on ...
  • License


  • Downloads
  • Downloads


  • Documentation
  • How it works ?
  • Getting Started
  • Mock vs Container
  • Javadocs
  • FAQ


  • Howto Guides
  • Classpath Howto
  • Config Howto
  • Migration Howto
  • TestCase Howto
  • Security Howto
  • Ant Howto
  • HttpUnit Howto
  • Sample Howto
  • EJB Howto
  • IDE Howto
  • JUnitEE Howto


  • Support
  • Bug database
  • Mailing list


  • Misc.
  • Why the name ?
  • Logo Challenge
  • Resources
  • Stats


  • Developers
  • CVS
  • Coding Conventions
  • Build results


  • Project description

    Cactus is a simple test framework for unit testing server-side java code (Servlets, EJBs, Tag Libs, Filters, ...).

    The intent of Cactus is to lower the cost of writing tests for server-side code. It uses JUnit and extends it.

    Cactus has been developed with the idea of automatic testing in mind and it provides a packaged and simple mechanism based on Ant to automate server-side testing.

    Cactus implements an in-container strategy (click on the diagram below to understand how it works). An alternative but complementary approach not covered by Cactus is to use Mock Objects (see the Mock vs Container page to understand the differences and why Cactus believes in the usefulness of an in-container approach).

    How it works ...


    Different kinds of unit tests

    There are several kinds of unit testing frameworks. We categorize them in 3 types :

    1. Type 1 : code logic unit testing. Probably the best strategy for these tests is to use a Mock Objects type framework.
    2. Type 2 : integration unit testing. Cactus is typically in this category (I'll let you judge if it is the best or not :)). These tests will exercise the interactions with the container.
    3. Type 3 : functional unit testing. These unit tests will let you test the returned values from your server code. This is for example HttpUnit (Note that HttpUnit also performs standard functional testing - as opposed to functional unit testing -, which let you test full use cases - a login use case for example, which is comprised of several requests/responses).

    Ideally you would use 3 different frameworks just to unit test your code ! Then you have to think about acceptance testing, system integration testing, ...

    Cactus was developed to fit Type 2 but also to be a very good compromise for Type 1 and 3, with the idea that it is much easier to have to write tests for a single framework than for several ! Moreover, you can never fully test your code. We believe Cactus provides a middle ground that provides a high confidence that your code will run when deployed. However, it is your choice and you can use Cactus only for Type 2 if you wish.


    Getting Started

    To get started, read the Getting Started guide.




    Copyright © 2000-2002 The Apache Software Foundation. All Rights Reserved.