On 16/05/2001 09:18:47 Vincent Massol wrote:
> ----- 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".
But that was not my point.
I was trying to argue that you shouldn't move Cactus to use mock objects only
but should preserve its ability to run tests within a real servlet container as
valuable testing opportunities would be lost.
>
> > .../Bob
> >
>
> Thanks
> Vincent.
>
Now on to "Test classification", sounds like fun :)
.../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.