Vincent,

I have been using mock objects for a while and they are very useful but do not
invalidate the work that you have done so far.  Before I heard about Cactus I
was about to write a mock servlet api implementation to allow me to test my
servlet and jsp code but hit the following issues:

-  who is going to compile my jsp's?  I rely on the container to do it for me
and mock objets won't help.
-  who is going to handle includes and forwards?  Again I rely on the container
to do this for me.

I think that in-container and mock objects address different issues.  At one
point you want to test your use of the servlet api and for that you need mock
objects.  At another point your test relies upon some service that the container
provides and for that you need in-container.

A mock servlet api implementation would be a great asset to Cactus and would
bring the added benefit that we could have many more unit tests for Cactus
itself, which currently relies mainly on functional tests.

Re. your pro/con section on the web page you mention the issue of adding
flexibility into your app that is needed purely for testing and not for
production use.  This does seem to fly in the face of YAGNI and the simplest
thing that could possibly work but I don't think that it does, you do need it to
test things properly.  And you have the added bonus that you end up with
considerably more supple software.

.../Bob


-----------------------------------------------------------------
        Visit our Internet site at http://www.reuters.com

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.

Reply via email to