Mock Objects

Jason Rogers jacaetevha at gmail.com
Fri Jun 23 13:36:57 UTC 2006


While this mock layer is good for many applications, I think it's
probably too deep for what Chad is dealing with.  Chad -- you should
be able to mock out the service itself and inject that into your
application code.  While I haven't done this in a Smalltalk
application I have successfully and easily done it in *many*
applications in other languages.

Jason

On 6/23/06, Frank Shearar <frank.shearar at angband.za.org> wrote:
> "Chad Nantais" <chad at clearwaterassociates.ca> wrote:
>
> > Hi.
> >
> > Could someone please direct me to a Squeak project (or some
> > documentation) that uses mock objects in its tests, specifically
> > dealing with testing network code like a web service.  I'm looking for
> > a way to speed up some unit tests that hit a remote service.
>
> It's by no means fully functional, but you might want to look at
> MockSocketStream. That SHOULD be in Squeak-3.8 and up, seeing as I wrote it
> in 2004.
>
> Having a mock network layer not only lets you speed up tests, it also allows
> you to disregard all the lovely things that can go wrong in the network. You
> can run your tests knowing that you're not going to get red everywhere
> because your colleague tripped over your fly lead, or is fiddling with a
> patch panel in the next room. And, of course, a mock network layer lets you
> INJECT errors :)
>
> I do intend adding to the MockSocketStream at some stage, but my plate's too
> full for the next several months.
>
> frank
>
>
>


-- 
Jason Rogers

"Where there is no vision, the people perish..."
    Proverbs 29:18



More information about the Squeak-dev mailing list