Alex

"Yes and no. beginXxx() is necessary anyway to do the setup."

If we are using strictly MO objects with proper methods setting initial
state (perhaps in addition to the methods defined in the interface we are
providing a mock implementation of, what is to prevent me from setting them
up in testXXX()?

"If you only want to catch possible exceptions, you wouldn't need to do
endXxx(); but if you wanted to check for bugs in the resulting HTML or
something like that, living inside Cactus would be a big plus -- even better
now that HttpUnit is willing to lend its powerful validating capacities."

Agreed, but this is not unit testing. Also, (please feel free to say RTFM),
but if I understand HttpUnit correctly, what it is really doing is sucking
data off a stream and then validating whatever comes through. If so, why
cannot a mock object stream the response written by the servlet to HttpUnit
and return a reference to an HttpUnit object allowing you to perform
validation still within testXXX(), but after the test subject has flushed
and closed the response stream?

Tom



Reply via email to