----- Original Message -----
From: "Bob Davison" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 15, 2001 10:35 AM
Subject: Re: Mock Objects vs In-Container/Cactus


>
>
> On 14/05/2001 15:10:21 Vincent Massol wrote:
> > ----- Original Message -----
> > From: "Bob Davison" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, May 14, 2001 10:01 AM
> > Subject: Re: Mock Objects vs In-Container/Cactus
> >
> >
> > >
> > >
> > > 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.
> >
> > correct but then Cactus does not provide unit testing of JSP either.
Also, I
> > don't believe in unit testing JSPs. IMO, all logic should be delegated
to
> > Taglibs so only the presentation code remains in the JSP. And
presentation
> > code is testing using a functional test framework (like HttpUnit).
> >
> > Note: You can always use an Ant jspc task (it uses Jasper, the Tomcat
JSP
> > compiler) to compile the JSPs if you wish ...
>
> I came late to this project so I am limited in what I can change.
Retrofitting
> Taglibs and changing the build procedure are not possible at the moment,
its
> been hard enough getting them to consider automated unit tests :-(
>

:)

> But even if I could I still think that there is a case for automated unit
> testing of JSP's using the current Cactus style.  In this project servlets
> create beans (which get their data from 3rd pary back end systems) and
forward
> to JSPs.   I am creating mock beans so I can control and reproduce the
data,
> forward to the JSP and capture the output.   By comparing against previous
runs
> this makes an excellent regression test tool.  Being able to automatically
> generate all of the different application pages for the customer to see is
a
> great side effect.
>

I agree with you but this is not what I would call Mock Object. Rather I
would call that Stubbing.
See my next post on subject "Test classification".

> .../Bob
>

Thanks
Vincent.

Reply via email to