On 2/18/06, Vincent Massol <[EMAIL PROTECTED]> wrote: > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Carlos > > Sanchez > > Sent: samedi 18 février 2006 20:14 > > To: Maven Developers List > > Subject: Re: plugin testing > > > > I thought more about static mocks vs. dinamic mocks, i think this is > > what you call stubs vs. mocks. > > Not quite. There are 2 types of mocks: static and dynamic. They are > different from stubs. I could point you at JUnit in Action where I've tried > to explain the difference ;-) but here's another explanation: > http://martinfowler.com/bliki/TestDouble.html >
Thanks for the pointer. After reading it, what I'd like to have are stubs > > What I found is that while jmock is great for certain cases, like > > throwing an exception as you say, for other common tasks static mocks > > are easier and require less test code. > > I don't quite agree... :-) > > When this happens this is a code smell. As I said either you're mocking too > deep or your code has a design issue. Here's a very good article on the > topic of using mocks: > http://www.jmock.org/oopsla2004.pdf > Creating a mock with jMock takes more lines than creating a Stub (castings, setting expectations,... vs. just "new X()"), that's why I'd like to have stubs for the common objects. > I do agree though that there are some very simple cases when you don't need > a mock at all. For example when you have a data object there's usually no > point in mocking it. Sure --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]