Hi Thomas!

Thomas Calivera wrote:
> "I sent along some classes, supposed to be mock objects for the served
> 2.2 API. I'm resending them, now with the correct package and license,
> to be inserted in org.apache.commons.cactus.mock. "
> 
> I took a very brief glance at your mock objects and they look like they are
> right on the money for a need of mine to test a servlet in a simple fashion.
> Making these available to the community seems wise since a lot of people
> doing unit testing on servlets in this fashion usually end up writing these
> same mock objects (I was about to). I shall let you know how the experience
> goes once I plug them into a servlet or two.

Go ahead! I hope they're useful.

The usual collaborative-development benefits apply: we did not implement
all of the methods in the HttpServletRequest and HttpServletResponse,
some of them were not needed (like getRequestedSessionId()). So, if you
complement the classes and share them, we will all benefit :)

> As for the role of Cactus in general, I'd like to write tests for a
> particular servlet in such a way that I can test using *either* mock objects
> or in container without recompiling or changing any code in the test
> classes. This allows a first round of pure J2EE testing, then progressive
> rounds testing different containers as necessary. In larger teams with the
> proper scripts, this process allows a daily "container test." Developers
> test against the mock objects on the development machines and a
> comprehensive project test, including containers, occurs over night or
> during lunch.

That's a cool scheme. Are you working in a big project? Will you
implement that scheme?

Un saludo,

Alex.

Reply via email to