You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Alexander Shirkov <sg...@gmail.com> on 2010/07/23 04:51:12 UTC

New joiner's question - mocking for unit tests

Hello all

I have quick question: Is there mocking framework in project?
Writing dummies for unit tests is quite useless and boring thing. Plus it¹s
filling codebase with ³noise².
I have some experience with:
 
JMock - http://www.jmock.org/
EasyMock - http://easymock.org/
Mockito (my favourite) - http://mockito.org/

First one hasn¹t updated since Feb 2009, so I think it¹s  not a good idea to
look there. Two others are great: both have dynamic proxying for interfaces
and classes.

Re: New joiner's question - mocking for unit tests

Posted by Mark Thomas <ma...@apache.org>.
On 23/07/2010 03:51, Alexander Shirkov wrote:
> Hello all
> 
> I have quick question: Is there mocking framework in project?
No.

> Writing dummies for unit tests is quite useless and boring thing. Plus it¹s
> filling codebase with ³noise².
With the tests we have written so far, there hasn't been that much
noise. I quite like that most of the tests Tomcat does have take the
form of Servlets, JSPs or similar. As well as testing the specific bug
or feature, I like the assurance it gives that things are working
end-to-end.

> I have some experience with:
>  
> JMock - http://www.jmock.org/
> EasyMock - http://easymock.org/
> Mockito (my favourite) - http://mockito.org/
> 
> First one hasn¹t updated since Feb 2009, so I think it¹s  not a good idea to
> look there. Two others are great: both have dynamic proxying for interfaces
> and classes.

As I recall, someone did submit a unit test for a Tomcat bug some time
(years) ago that used a mocking framework. That is about the only
instance I can recall.

I guess I am neutral on the idea overall. I'm not against it if there is
sufficient need, but so far I haven't found a need for it. Maybe there
is a need and I just can't see it. Shrug.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: New joiner's question - mocking for unit tests

Posted by Jeremy Boynes <jb...@apache.org>.
There is some use of EasyMock in the Taglibs sub-project.

On Jul 22, 2010, at 7:51 PM, Alexander Shirkov wrote:

> Hello all
> 
> I have quick question: Is there mocking framework in project?
> Writing dummies for unit tests is quite useless and boring thing. Plus it’s
> filling codebase with “noise”.
> I have some experience with:
> 
> JMock - http://www.jmock.org/
> EasyMock - http://easymock.org/
> Mockito (my favourite) - http://mockito.org/
> 
> First one hasn’t updated since Feb 2009, so I think it’s  not a good idea to
> look there. Two others are great: both have dynamic proxying for interfaces
> and classes.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org