Upgrading to latest WebTest and Cactus
I attempted (and succeeded) in upgrading to the latest and greatest releases of Canoo's WebTest and Jakarta's Cactus this afternoon. It wasn't too bad. Both have revised their taskdef's to read from a properties file, and Cactus has simplified the process to include cactus-related JARs/mappings in your webapps. Now you can "cactify" your war with a little Ant-lovin:
<cactifywar srcfile="${webapp.dist}/${webapp.war}"
destfile="${webapp.dist}/${webapp.name}-cactus.war">
<lib dir="${strutstestcase.dir}" includes="*.jar"/>
<lib dir="${cactus.dir}">
<include name="*.jar"/>
</lib>
</cactifywar>
Pretty slick IMO. Now if I could only figure out how to do form-based authentication with Cactus (I couldn't find it in the docs).
The other issue I've been banging my head against the wall over is running canoo/httpunit tests with a compression filter enabled. Yep, the problems still exist, despite the fact that I patched httpunit. So I've come up with a new fix that satisfies me and eases the pain in my noggin'. In my compression filter, I simply disabled compression when it's an httpunit test:
String userAgent = req.getHeader("User-Agent");
if (!isGzipSupported(req) || userAgent.startsWith("httpunit")) {
// Invoke resource normally.
chain.doFilter(req, res);
} else {
// gzip it
}

