You want to use HttpUnit to perform complex assertions on the returned result.
Implement an endXXX(com.meterware.httpunit.WebResponse) method for a given testXXX( ) method.
Cactus provides support for two endXXX(WebResponse) signatures. You, as the test writer, need to choose one of the method signatures. Cactus ensures that the correct method is invoked.
// write this method for the standard Cactus response public void endXXX(org.apache.cactus.WebResponse) { // insert simple assertions } // or write this method to use HttpUnit public void endXXX(com.meterware.httpunit.WebResponse) { // insert complex assertions }
These methods are executed on the client side JVM after the corresponding server side testXXX( ) method completes without throwing an exception.
For more information on how to use HttpUnit to perform complex assertions, see Chapter 5.