[ANN] Cargo 0.2 Released
Download · Release Notes · Learn More · Project Weblog. I've been looking for something like Cargo for a while now - mainly so I could provide an easy way to test JSPs (and therefore the whole app) in-container. For the last couple of years, I've been using Cactus' <runservertests> task, but it requires you to configure your own startup and shutdown targets - which can be difficult for the different containers. Cargo makes this easy. So easy that I've added it as a topic to Chapter 8 of Spring Live. BTW, the MyUsers sample app shows you how to use jMock and Easy Mock for isolating Manager tests and Action/Controller tests - something that I might eventually move to with AppFuse.
In 1.5, AppFuse's build.xml is tightly coupled to Tomcat for running Cactus tests and Canoo WebTests. There are only a couple of Cactus tests in the Spring and WebWork versions - LoginServletTest and ActionFilterTest and I believe I can use Spring Mocks to refactor those and test them out-of-container.
Using Spring's ContextLoaderPlugin for Struts, I should be able start testing the Struts Actions using MockStrutsTestCase too. This means that the only in-container tests will be Canoo WebTests. As part of 1.6, hopefully you'll be able to run the "test-web" target sans container. Right now it sounds like quite a challenge, but being able to run Spring's Controllers and WebWorks Actions out-of-container is a really nice feature. Furthermore, removing Cactus as a dependency would open the doors for using JDK 5.0.
I'm also hoping to add support for switching containers - by running a simple script that nips and tucks the build.xml. For 1.6, I'll try to add an installer for Resin. If it's easy, I might take a stab at Jetty and Orion too.
Update: Cactus is gone - there's no need for it anymore as all actions/controllers, filters and listeners can be tested out-of-container. The best part is I didn't have to change any application code - just a few tests. Sweet!
Posted by Carlos Sanchez on October 05, 2004 at 08:10 AM MDT #
Posted by Matt Raible on October 05, 2004 at 10:26 PM MDT #