----- Original Message -----
From: "Alex Fernández" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 14, 2001 12:07 PM
Subject: Re: Mock Objects vs In-Container/Cactus


> Hi Vincent!
>
> I like Mock Objects a lot. In fact, without even knowing them, we built
> a similar framework for servlets: mock Request, Response, Session,
> Context.
>
> They are really simple objects, that include a set...() for every
> get...() in the interface. E.g., in HttpServletRequest you have a
> getParameter(), so in our Request we have a setParameter(). We do not
> simulate an HttpServlet, since it didn't seem necessary at the time --
> we do not use log() or any other container-specific stuff.
>

you can if you want by just implementing a mock ServletConfig and calling
myServlet.init(mockServletConfig) ...

> Perhaps our classes might be used; we have no problem in changing the
> name/package/license. They were developed as part of a project that
> failed, so the code is orphaned.
>

great ! I was also considering integrating the Mock Object framework located
at http://sourceforge.net/projects/mockobjects. That's of course providing
they do accept .... :-) But we're getting too far ahead .... Nothing has
been decided yet ! I want to have the opinion of everyone first, then do
some experiment with mock objects in an experimental Cactus2 version, ....

> Also, we're in sore need of something else. As part of a new project,
> which uses EJB, we'd like to simulate an EJB container with mock
> objects. Is there any way we can do it? Of course, simulating just the
> EJB or just the servlet should be piece'o'cake, but we need to simulate
> calls from the servlet to an EJB, without the added cost of testing the
> container:
> servlet -> EJB Container -> EJB
>

That's the problem with Mock Objects. You can test methods individually but
when it comes to testing interactions between objects, it is not very good.
I would say that Cactus as it is in its current form is better suited for
that ...

> If you care to have a look at what we've got, I'll send them along.
>

Sure. Please do so. I'll be happy to have a look.

> Un saludo,
>
> Alex.
>
Muchas Gracias para tu tiempo y tu ayuda ...
Hasta luego

Vicente

Reply via email to