<?xml version="1.0"?>

<!--
 * ========================================================================
 * 
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * ========================================================================
-->

<document id="index">

  <properties>
    <title>Jakarta Cactus</title>
  </properties>

  <body>

    <section title="Project Description">
      <p>
        Cactus is a simple test framework for unit testing server-side java
        code (Servlets, EJBs, Tag Libs, Filters, ...).
      </p>
      <p>
        The intent of Cactus is to lower the cost of writing tests for
        server-side code. It uses <link href="ext:junit">JUnit</link> and 
        extends it.
      </p>
      <p>
        Cactus implements an in-container strategy, meaning that tests are
        executed inside the container.
      </p>
      <figure src="images/ecosystem.jpg" alt="The Cactus Ecosystem"
        usemap="#ecosystem">
        <map name="ecosystem">
          <area shape="circle" href="site:index"
              alt="Cactus Framework" coords="225,200,35"/>
          <area shape="circle" href="site:integration_eclipse"
              alt="Eclipse Plugin" coords="165,145,35"/>
          <area shape="circle" href="site:integration_browser"
              alt="Browser Integration" coords="305,220,35"/>
          <area shape="circle" href="ext:maven_cactus"
              alt="Maven Plugin" coords="390,175,35"/>
          <area shape="circle" href="ext:strutstestcase"
              alt="StrutsTestCase" coords="375,235,35"/>
          <area shape="circle" href="ext:junitee"
              alt="JUnitEE Runner" coords="345,295,35"/>
          <area shape="circle" href="ext:jenerator"
              alt="Jenerator" coords="355,115,35"/>
          <area shape="circle" href="site:integration_ant"
              alt="Ant Integration" coords="140,225,35"/>
          <area shape="circle" href="site:integration_jetty"
              alt="Jetty Integration" coords="280,145,35"/>
          <area shape="circle" href="site:howto_sample"
              alt="Servlet Sample" coords="55,200,35"/>
          <area shape="circle" href="site:howto_config"
              alt="Manual Configuration" coords="225,270,35"/>
        </map>
      </figure>
      <p>
        The Cactus Ecosystem is made of several components:
      </p>
      <ul>
        <li>
          The Cactus Framework: This is the heart of Cactus. It is the engine
          that provides the API to write Cactus tests.
        </li>
        <li>
          The Cactus Integration Modules: They are front ends and frameworks 
          that provide easy ways of using the Cactus Framework (Ant scripts,
          Eclipse plugin, Maven plugin, ...).
        </li>
        <li>
          The Cactus Samples: They are simple projects that demonstrate how
          to write Cactus tests and how to use some of the Integration Modules.
        </li>
      </ul>
    </section>

    <anchor id="unittest_types"/>
    <section title="Different kinds of unit tests">

      <p>
        There are several kinds of unit testing frameworks. We categorize them
        in 3 types:
      </p>
      <ol>
        <li>
          <strong>Type 1: code logic unit testing</strong>. Probably the
          best strategy for these tests is to use a
          <link href="ext:mockobjects">Mock Objects</link> type
          framework.
        </li>
        <li>
          <strong>Type 2: integration unit testing</strong>. Cactus is
          typically in this category (we'll let you judge if it is the best or
          not :)). These tests will exercise the interactions with the
          container.
        </li>
        <li>
          <strong>Type 3: functional unit testing</strong>. These unit tests
          will let you test the returned values from your server code. This is
          for example
          <link href="ext:httpunit">HttpUnit</link> (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).
        </li>
      </ol>
      <p>
        Ideally you would use 3 different frameworks just to unit test your
        code ! Then you have to think about acceptance testing, system
        integration testing, ...
      </p>
      <p>
        Cactus was developed to fit Type 2 but also to be a very good
        compromise for types 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.
      </p>

    </section>

    <section title="Getting Started">

      <p>
        To get started, read the
        <link href="site:getting_started">Getting Started</link> guide.
      </p>

    </section>

  </body>
</document>