incubator-adffaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Fallows" <john.r.fall...@gmail.com>
Subject Re: Thoughts about unit testing and mock objects
Date Sat, 13 May 2006 05:12:38 GMT
On 5/12/06, Craig McClanahan <craigmcc@apache.org> wrote:
>
> On 5/12/06, John Fallows <john.r.fallows@gmail.com> wrote:
> >
> > On 5/10/06, Adam Winer <awiner@gmail.com> wrote:
> > >
> > > JMock does look interesting, but a couple of basic questions:
> > > - Is it available in a maven repository?
> >
> >
> > Yes.  http://www.ibiblio.org/maven2/jmock/
> >
> > - Is its license compatible?
>
>
> On the surface, it would appear so, but IANAL and never played one on TV.


I had to read that several times to figure it out - does IANAL mean "I Am
Not A Laywer" ? :-)

The way to get a definitive answer is to submit this to the
> legal-discuss@apache.org mailing list where license-savvy folks are
> hanging
> out.  I'll forward them a query.


Thanks, that'll be useful to know.

CGLib is under Apache2 license and jMock is under the following license
> >
> > http://jmock.codehaus.org/license.html
> >
> > ... and one more general one.  The thing that drives me up the
> > > wall with the current mock codebase in the ADF Faces tests
> > > is that it forces you to say "I expect method foo() to be called
> > > at least N times", even though with JSF there's rarely any
> > > such assurances whether a method will be called or not,
> > > and if so how many times.   E.g., how often is
> FacesContext.getViewRoot
> > ()
> > > called?  Once?  Twice?  20 times?
> >
> >
> > As the test writer you have the flexibility to either specify the number
> > of
> > calls precisely or not, depending on whether or not it is important to
> the
> > test.
>
>
> I think Adam's point was that the number of calls might be indeterminate
> if
> different implementations of JSF do things differently.  On the other
> hand,
> I wouldn't want to use a library that *forced* me to specify call counts,
> even when I didn't care, either :-).


Yep.  Sorry if I wasn't clear, jMock doesn't force you to specify call
counts.

tc,
-john.

-- 
http://apress.com/book/bookDisplay.html?bID=10044
Author: Pro JSF and Ajax: Building Rich Internet Components, Apress

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message