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

Switch to Threaded View
Drill, mail # dev - mocking library


Copy link to this message
-
Re: mocking library
Timothy Chen 2013-05-21, 04:59
Just FYI I'm adding jmockit as I'm adding tests for the JsonRecordReader.
The FragmentContext class has lots of dependencies and I remembered our
conversation here.

Tim
On Fri, Feb 15, 2013 at 3:26 PM, Jacques Nadeau <[EMAIL PROTECTED]>wrote:

> Hey Chris,
>
> It sounds like people have had the most positive experiences with jmockit
> and mockito with jmockit seeming to gain some traction.  Do you want to try
> out jmockit on your stuff and see how it goes?
>
> Jacques
>
> On Fri, Feb 15, 2013 at 12:55 PM, Ted Dunning <[EMAIL PROTECTED]>
> wrote:
>
> > Last time I tried PowerMock, I was unable to mock System.nanoTime nor
> > properly fake classes.
> >
> > On Fri, Feb 15, 2013 at 3:03 AM, Stevo Slavić <[EMAIL PROTECTED]> wrote:
> >
> > > +1 (non-binding) for jmockit. After being easymock user for years, I've
> > > turned to jmockit on recent projects and it has proven to be really
> > > powerful.
> > > Nice overview with rationale and comparison can be found here:
> > > http://jmockit.googlecode.com/svn/trunk/www/about.html
> > >
> > > One downside I've noticed, which comes from all that power of being
> able
> > to
> > > mock anything entirely or partially, is that sometimes it's not that
> > > obvious why build has failed. With jmockit instrumentation if a test
> > fails,
> > > e.g. SUT dependency mocked but with default settings (so without static
> > > initialization mocked), some other tests running in parallel or after
> > > failed one might fail as well so, it might look like that there's
> > something
> > > wrong with testing frameworks/tools, but actually root cause is an
> > invalid
> > > test.
> > >
> > > Another small downside is that APIs tended to change in
> > > non-backward-compatible way. I guess that's acceptable for releases
> > before
> > > recently published 1.0, and we'll see what future will bring. Older
> > > versions would allow misuse, and newer ones perform various checks so
> are
> > > more strict, thus the changes were for better (e.g. before it was
> > possible
> > > by mistake to record two different non strict expectations/behaviors
> for
> > > same mocked method on same mocked instance).
> > >
> > > Make sure to use latest version, older ones had issues with Java 7
> > > compiler.
> > >
> > > Kind regards,
> > > Stevo Slavic.
> > >
> > >
> > > On Fri, Feb 15, 2013 at 10:29 AM, Ed Kohlwey <[EMAIL PROTECTED]>
> wrote:
> > >
> > > > That matrix is quite impressive. This is the first time I've come
> > across
> > > > JMockit but I may start using it soon - it seems very fully featured
> > and
> > > > the syntax is quite elegant.
> > > >
> > > >
> > > > On Thu, Feb 14, 2013 at 11:53 AM, Jacques Nadeau <
> > > [EMAIL PROTECTED]
> > > > >wrote:
> > > >
> > > > > Rather than reinvent the pros/cons wheel here, does someone want to
> > > find
> > > > a
> > > > > couple of evaluations/discussions that other Apache projects did
> and
> > > see
> > > > > what conclusions they came to?
> > > > >
> > > > > Interesting comparison here, of course probably skewed since
> Jmockit
> > > > built
> > > > > it and has the most features....
> > > > >
> > > > >
> http://code.google.com/p/jmockit/wiki/MockingToolkitComparisonMatrix
> > > > >
> > > > >
> > > > >
> > > > > On Thu, Feb 14, 2013 at 8:47 AM, Ted Dunning <
> [EMAIL PROTECTED]>
> > > > > wrote:
> > > > >
> > > > > > For me, the ability to mock statics and final classes is a big
> > > > > requirement.
> > > > > >
> > > > > > On Thu, Feb 14, 2013 at 7:41 AM, Ed Kohlwey <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > >
> > > > > > > The power mock/easy mock combo is also quite effective and has
> > one
> > > of
> > > > > the
> > > > > > > cleanest and easiest to understand  interfaces I've seen in a
> > > mocking
> > > > > > > library, however I'm not familiar with Jmockit.
> > > > > > > On Feb 13, 2013 11:42 AM, "Ted Dunning" <[EMAIL PROTECTED]
> >
> > > > wrote:
> > > > > > >
> > > > > > > > For basic mocking, none of the libraries make much