Ok, here it is !
I have committed the changes to enable running cactus unit tests within
Struts. Please have a look and tell me what you think. Please note that
although I have committed the changes, David Winterfeldt was the one who
initially wrote this Cactus integration with Struts and sent it to me by
email. I have only slightly modified his scripts (Is that ok David ?).

I have only put a very simple test class (which is not even finished !). The
goal was to set up the build mechanism.

In order to run the unit tests :
- modify your build.properties, looking at the build.properties.sample for
additional properties required for unit testing
- simply type "ant test.all" to run the unit tests on all servlet engines or
"ant test.tomcat.32" for Tomcat 3.2 or "ant test.tomcat.40" for Tomcat 4.0

Now, the next step, for which we need as much help as possible is to write
test classes for existing Struts classes.

Here is the final directory structure :

Here is the directory structure proposal (I have put a + in front of new
items and * in front of modified existing items) :

jakarta-struts
  |_ * build.xml
  |_ + build-tests.xml
  |_ * build.properties.sample
  |_ conf
    |_ share
    |_ + test
      |_  + tomcat32
        |_ + server.xml
      |_ + tomcat40
        |_ + server.xml
      |_ + web.xml
      |_ + cactus.properties
      |_ + struts-config.xml
  |_ src
    |_ share
    |_ [...]
    |_ + test
      |_ + org
        |_  + ... test classes
  |_ target (output directory)
    |_ library
    |_ [...]
    |_  + test
      |_ test.war
      |_ + classes
      |_ + lib
      |_ + servers
        |_ + tomcat32
          |_ + conf
            |_ + server.xml
          |_ + webapps
            |_ + test.war
            |_ + test
              |_ (see below for details)
        |_ + tomcat40
          |_ + conf
            |_ + server.xml
          |_ + webapps
            |_ + test.war
            |_ + test
              |_ (see below for details)

The expanded test.war will contain :

test
  |_ WEB-INF
    |_ classes
      |_ <test classes>
    |_ lib
      |_ struts.jar
      |_ junit.jar
      |_ commons-cactus.jar (the one for the correct servlet API)
    |_ web.xml

Thanks.
Vincent.


Reply via email to