Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # dev >> Mocking framework

Copy link to this message
Mocking framework
Hi all,

Currently Accumulo doesn't have any mocking framework. However, in some
recent work (ACCUMULO-53) doing good testing was greatly facilitated by
adding in a mocking framework. They make it easy to only test the piece of
the architecture that we are interested in testing, helping to isolate and
ensure that we are really fixing problems in the code.

So, I would like to propose adding the following test-time dependencies for

EasyMock (http://easymock.org/)
This is a really popular mocking framework for java and is really easy to
use. I've rarely run into a situation that wasn't covered with what EasyMock

PowerMock (http://code.google.com/p/powermock/)
This is the utility to cover what other mocking frameworks (including
Mockito) can't do - capturing creation of objects (new Whatever(...)) and
returning mocks instead, mocking static calls, mocking standard java lib
calls, and accessing private methods/fields.

This combination has proven to be incredibly effective and easy to use in
the past, allowing for a really comprehensive testing suite.

 If you want to see an example of this stuff in action, check out the patch
'java_ACCUMULO-53_v2.patch' on ACCUMULO-53.

What does everyone think?


Jesse Yates