You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mrunit.apache.org by Sahana Bhat <sa...@gmail.com> on 2012/09/05 13:38:01 UTC

Testing TableMapper with MRUnit

Hi,

           Can MRUnit be used to test classes extending TableMapper? Any
information/documentation regarding the same would be appreciated.

Regards,
Sahana

Re: Testing TableMapper with MRUnit

Posted by Sahana Bhat <sa...@gmail.com>.
Hi,

              Thanks a lot for the input.

Regards,
Sahana

On Wed, Sep 5, 2012 at 5:55 PM, Bertrand Dechoux <de...@gmail.com> wrote:

> As far as I know, MRUnit has no special support for any specific mapper
> (ie handle all Mapper the same way).
> If you can provide the input (key,value) for your mapper then you should
> be able to assert the output (key,value).
>
> Regards
>
> Bertrand
>
>
>
>
> On Wed, Sep 5, 2012 at 1:38 PM, Sahana Bhat <sa...@gmail.com> wrote:
>
>> Hi,
>>
>>            Can MRUnit be used to test classes extending TableMapper? Any
>> information/documentation regarding the same would be appreciated.
>>
>> Regards,
>> Sahana
>>
>>
>>
>
>
>
> --
> Bertrand Dechoux
>

Re: Testing TableMapper with MRUnit

Posted by Bertrand Dechoux <de...@gmail.com>.
As far as I know, MRUnit has no special support for any specific mapper (ie
handle all Mapper the same way).
If you can provide the input (key,value) for your mapper then you should be
able to assert the output (key,value).

Regards

Bertrand



On Wed, Sep 5, 2012 at 1:38 PM, Sahana Bhat <sa...@gmail.com> wrote:

> Hi,
>
>            Can MRUnit be used to test classes extending TableMapper? Any
> information/documentation regarding the same would be appreciated.
>
> Regards,
> Sahana
>
>
>



-- 
Bertrand Dechoux

Re: Testing TableMapper with MRUnit

Posted by Dave Beech <da...@paraliatech.com>.
Hi Sahana

Yes - you can use MRUnit to test TableMapper subclasses just like any other
mapper. The key needs to be an instance of ImmutableBytesWritable. The hard
part (or time-consuming, rather) will be the manual construction of the
HBase Result object that the mapper needs to process.

>From the HBase javadoc it looks like you would have to create a number of
KeyValue objects, put these in a list and then instantiate a new Result
object from that list.

Hope that helps - let me know if you need further detail

Regards,
Dave

On 5 September 2012 12:38, Sahana Bhat <sa...@gmail.com> wrote:

> Hi,
>
>            Can MRUnit be used to test classes extending TableMapper? Any
> information/documentation regarding the same would be appreciated.
>
> Regards,
> Sahana
>
>
>