You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Bernd Fondermann <bf...@brainlounge.de> on 2009/12/01 09:44:05 UTC

Unit Testing Mapper with new MR API

Hi,

Unit testing a mapper with the old mapred API is easy.

However, for the new mapreduce API, I struggle creating the Context
object in an easy and elegant way.

How do I best mock the Context for the mapper, as MRUnit does not seem
to be ready to be used with the new API yet?

Is there example code somewhere?

Thanks,

  Bernd

Re: Unit Testing Mapper with new MR API

Posted by Aaron Kimball <aa...@cloudera.com>.
MRUnit has had new API support for a while now (see MAPREDUCE-800). The new
Driver classes are in org.apache.hadoop.mrunit.mapreduce.

- Aaron

On Tue, Dec 1, 2009 at 12:44 AM, Bernd Fondermann <bf...@brainlounge.de>wrote:

> Hi,
>
> Unit testing a mapper with the old mapred API is easy.
>
> However, for the new mapreduce API, I struggle creating the Context
> object in an easy and elegant way.
>
> How do I best mock the Context for the mapper, as MRUnit does not seem
> to be ready to be used with the new API yet?
>
> Is there example code somewhere?
>
> Thanks,
>
>  Bernd
>