I guess I was commenting since I'm exploring similar situations to your
example where we want to test code that is written against a framework like
Struts or Turbine, but I don't want to end up testing the framework. I
was/am thinking that using MO will allow me to test my code, instead of
testing the framework. Enough, sorry for moving OT.
-----------------------------------------------------------------
Throw away my code, but never, never throw away my tests.
-----------------------------------------------------------------
Jeffrey D. Brekke Quad/Graphics
[EMAIL PROTECTED] http://www.qg.com
-----------------------------------------------------------------
> -----Original Message-----
> From: Vincent Massol [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 08, 2001 1:14 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Another point of Mock vs In-Container approach
>
>
>
> ----- Original Message -----
> From: "Brekke, Jeff" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 08, 2001 6:41 PM
> Subject: RE: Another point of Mock vs In-Container approach
>
>
> > Hello,
> >
> > I've not posted wrt to cactus or MO, but have been lurking
> here and in the
> > SF mock objects project.
>
> annother one, eh ? :)
>
> > One thing that strikes me about below is what is
> > it you're trying to test? Quoting:
> >
> > > Note that we are *not* interested in finding out what
> > > happens if they locale is not correctly set as Struts is
> > > supposed to handle that and always return a valid Locale.
> > > However we are interested in finding out that our code
> > > behaves well with different locales.
> >
> > So we don't want to test that Strut's getLocale() method
> can extract and
> > return a locale from the session. The developers of Struts
> need to test
> > that. "... we are interested in finding out that our code
> behaves well
> with
> > different locales. " So we should mock Locale and test
> behavior of our
> code
> > against the mock locale. Noting that we should test 'behavior' not
> methods
> > or classes, correct? Maybe we also extract a method, for
> easier testing.
> >
> > I'm not sure I'm correct on this, it is just some thoughts
> and I have no
> > experience/exposure to Struts. I believe I have the same
> issues wrt to
> > testing applications we implement with Turbine. Still
> mulling the in
> > container vs. mo issues also, and learning along the way ;)
>
> I'm not sure I understand what you're saying ... :)
> I was just saying, as a side note (nothing really to do with
> the main stream
> of the discussion), that the goal of our action unit test was
> not ensure to
> the getLocal() method of Struts would behave correctly if the
> locale was not
> set for example in struts-config.xml. And that was why if we
> used the Cactus
> approach, neither solution 1 nor solutoin 2 would be needed at all.
>
> >
> > jb
> -Vincent
>