2011/08/05 - Jakarta Cactus has been retired.

For more information, please explore the Attic.

Forewords and Requirements

This document describes steps to setup Cactus to unit test Server side code (i.e. EJBs, Servlets, etc) deployed to Weblogic 6.1 within JBuilder5 IDE.

The steps described below apply to current release (Cactus 1.3 as of this writing) and assume that Cactus has been installed correctly (which means that you can run sample successfully).

Step 1: Create cactus.properties file

Create cactus.properties file: Add entry to identify the URL of the redirector (see the Configuration Howto for details).

Step 2: Configure Cactus to work with JBuilder5

Follow these steps:

  1. Click Menu item Tools/Configure Libraries to open Configure Libraries wizard
  2. On the lefthand side of Configure Libraries wizard, click on New button to open New Library Wizard.
  3. Enter value "cactus" in the Name field. Choose "user home" from the Location drop down menu.
  4. Click on Add button to open the dialog to choose files.
  5. Navigate to [cactus home]/lib/ directory, select cactus.jar and click OK button.
  6. Click on Add button again to open the dialog to choose files.
  7. Navigate to the directory where the cactus.properties file is saved.
  8. Click OK button.
  9. Click "Add as Class Path" button if "No Paths Found" dialog box pops up
  10. Follow steps 2 - 6 to add junit.jar, httpclient.jar and aspectjrt.jar which are all in [cactus home]/lib directory
  11. Optionally, add log4j.jar in [cactus home]/lib directory to enable cactus logging
  12. Click Menu item Project/Project Properties to open Project Properties dialog box
  13. Click Path tab and then Required Libraries tab
  14. Click Add button and add the libraries created above to your project.

Step 3: Configure Cactus for Weblogic6.1

  1. Open web.xml in WEB-INF directory of the web application deployed on Weblogic
  2. Add the mapping for the redirector under the <web-app> element.
  3. Copy cactus.jar, junit.jar, aspectjrt.jar and log4j.jar(optional) to WEB-INF/lib directory of the web application
  4. Copy your classes files to WEB-INF/classes directory of the web application

Step 4: Run the test

  1. In JBuilder, click Menu item Project/Project Properties
  2. Click Run tab and then Application tab
  3. Open "Select Main Class for Project" dialog box and choose the test case class which has a main method in it.
  4. Run your project