hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Rawson <ryano...@gmail.com>
Subject Re: testing, powermock, jmockit - from pow-wow
Date Fri, 21 Sep 2012 16:49:19 GMT
I've used mockito a few times, and it's great... but it can make your
tests very brittle.  It can also be hard to successfully use if the
code is complex.  For example I had a class that took an HBaseAdmin,
and i mocked out the few calls it used.  Then when I needed to access
Configuration, things went downhill fast.  I ended up abandoning
easymock even.

The issue ultimately stems from not writing your code in a certain way
with a minimal of easy to mock external interfaces.  When this isn't
true, then easymock does nothing for you.  It can save your bacon if
you are trying to unit test something deep though.

The other question I guess is integration testing... there is no
specific good reason why everything is done in 1 jvm, except 'because
we can'.  a longer lived 'minicluster' could amortize the cost of
running one.

-ryan

On Fri, Sep 21, 2012 at 9:06 AM, Rogerio <rliesenfeld@gmail.com> wrote:
> lars hofhansl <lhofhansl@...> writes:
>
>> > To get the low-level access we could instead use jmockit at the cost of
> dealing with code-weaving.
>>
>> As we had discussed, this scares me :).
>> I do not want to have to debug some test code that was weaved (i.e. has no
> matching source code lying around *anywhere*).
>>
>
> I think you are imagining a problem that does not exist. JMockit users can debug
> Java code just fine...
>
>

Mime
View raw message