atom feed20 messages in org.apache.incubator.adffaces-devRe: Thoughts about unit testing and m...
FromSent OnAttachments
John FallowsMay 10, 2006 5:23 pm 
Adam WinerMay 10, 2006 5:43 pm 
Dennis ByrneMay 10, 2006 6:29 pm 
Adam WinerMay 10, 2006 9:44 pm 
Craig McClanahanMay 10, 2006 10:09 pm 
John FallowsMay 12, 2006 9:08 pm 
Craig McClanahanMay 12, 2006 9:15 pm 
John FallowsMay 12, 2006 9:16 pm 
Craig McClanahanMay 12, 2006 9:24 pm 
John FallowsMay 12, 2006 10:12 pm 
Craig McClanahanMay 12, 2006 10:32 pm 
John FallowsMay 12, 2006 11:43 pm 
Adam WinerMay 13, 2006 9:08 am 
Martin MarinschekMay 13, 2006 2:46 pm 
John FallowsMay 13, 2006 3:44 pm 
Craig McClanahanMay 13, 2006 4:49 pm 
John FallowsMay 14, 2006 11:14 am 
Adam WinerMay 14, 2006 12:35 pm 
John FallowsMay 14, 2006 9:47 pm 
Matthias WessendorfJun 19, 2006 3:31 pm 
Subject:Re: Thoughts about unit testing and mock objects
From:John Fallows (john@gmail.com)
Date:May 12, 2006 10:12:15 pm
List:org.apache.incubator.adffaces-dev

On 5/12/06, Craig McClanahan <crai@apache.org> wrote:

On 5/12/06, John Fallows <john@gmail.com> wrote:

On 5/10/06, Adam Winer <awi@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

lega@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.