On Apr 29, 2011, at 11:12 AM, Stack wrote:

> On Fri, Apr 29, 2011 at 10:27 AM, Joe Pallas <[email protected]> wrote:
>> We’ve been using Mockito to mock HTable and friends and are pretty happy 
>> with its ease of use and capabilities.
>> 
> 
> To avoid going to an hbase backing cluster?

We have tests that use the minicluster and tests that use mocks (or both).  
Since we do TDD, we need tests that cover some cases that are pretty hard to do 
without mocks.  For example, a test that verifies the implementation loops 
until checkAndPut is successful is hard to do without mocks.

I will say that startup time for the minicluster is pretty bad for unit 
testing.  Maybe what the original request was really asking for is what Fowler 
calls "fakes" <http://martinfowler.com/articles/mocksArentStubs.html>.  A fake 
HBase would probably be in-process and have only in-memory tables.  But it 
might be a fair amount of effort to get all the semantics right.

joe

Reply via email to