hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: testing, powermock, jmockit - from pow-wow
Date Sat, 15 Sep 2012 03:34:14 GMT
On Fri, Sep 14, 2012 at 7:16 PM, Jesse Yates <jesse.k.yates@gmail.com> wrote:
>  I hacked on
> it for a bit and still couldn't get a mini-cluster up and running :-/

Good on you Jesse.

You put up a patch w/ your hackery so we can see the pain?

> To resolve the cases where the powermock class-loading would be useful
> (e.g. catching object creation to use your own mock, rather than using
> factories or DI everywhere) we could use jmockit. Jmockit does the same
> basic stuff as powermock (minus the nice reflection library), but it does
> it through run-time code weaving for tests through the java agent
> framework.

Does that mean we have to pass args to the JVM to run tests?

> This will give us really fine grained access to the code under test without
> having to do a lot of funky rewrites. However, code-weaving comes at the
> cost of loosing debugger usage as the code-weaving messes with the
> bytecode. I'd argue that its a small price to pay for getting highly
> controllable tests, *as long as we don't go overboard with the
> weaving.*Yes, when we start doing too much test weaving it can become
> untenable, but
> it can be really useful for many situations without having to write
> funky/awkward code.
> What do ya'll think?

Thanks for digging in J,

View raw message