I find that I frequently need to implement tests that require multiple HTTP 
request/response round trips to set up the conditions for the test.  I have been 
implementing this by using HttpUnit inside my beginXXX method to make a 
WebConversation and use an HttpUnit to send requests, check response, send next 
request, etc.  After the multi-request setup is complete I can set up the 
org.apache.cactus.WebRequest for my real test request that will go to my testXXX 
method and allow me to make assertions about the resulting state of my servlet in my 
real container (something I can't do with just HttpUnit).

I would think that multi-request setup would be a typical requirement.  Are other 
people doing something similar - or has this been solved in a different way?

What I would like to see in a future version is better integration with HttpUnit in 
the beginXXX methods.  I very much like the version of the endXXX methods that takes a 
com.meterware.httpunit.WebResponse.  I would like to see a similar version of the 
beginXXX that takes a com.meterware.httpunit.WebRequest instead of the Cactus one.  I 
am very new to Cactus, so perhaps I am missing something here, but this seems like a 
useful approach to me.  Any input would be appreciated.

Reply via email to