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

Switch to Threaded View
HBase >> mail # dev >> testing, powermock, jmockit - from pow-wow

Copy link to this message
Re: testing, powermock, jmockit - from pow-wow
On Fri, Sep 14, 2012 at 7:16 PM, Jesse Yates <[EMAIL PROTECTED]> 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,