On previous web-based projects that I've worked on, the build script assumed that a web-container was running that it could deploy the application to for functional tests. In the continuous integration demo that I was working on recently, Mike showed me a cool technique that he had found to eliminate the dependancy.
He's beaten me to it though, and already written about how to decorate test suites with Jetty.
Comments
Seems the trackback didn't work, I blogged about some additional information here: http://www.uwyn.com/blog/archives/000081.html (Testing web application failures when using Jetty as a decorator)
Posted by: Geert Bevin | July 12, 2004 05:14 PM
We've also done this now within our Ant script to start and stop Jetty around the execution of a test suite, using the "parallel" task. In this way the tests don't care about which container is running.
The decorator gets a lot more complex when you have 8 or 9 datasources to configure (using JettyPlus features) and the xml jetty configuration works nicely if you use the new syspropertyset feature of Ant 1.6 to pass all jetty.* ant properties to the jetty start jar.
I also created a hacked version of Jetty such that the WEB-INF/lib directory does not have to be under WEB-INF which saves us some build time by not copying a bunch of libraries to each different app.
If you're interested I can send you the relevant build scripts.
Posted by: Grant Gardner | July 13, 2004 09:55 AM