You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mrunit.apache.org by Ajay Srivastava <Aj...@guavus.com> on 2012/04/11 07:53:04 UTC

Context and DistributedCache

Hi, 

I am planning to use mrunit in one of the projects and written some test cases. These test cases run fine for simple map reduce jobs but give error for most of the others.

For an example, in one of the map reduce job I have following code in setup method of Mapper class.
 
context.getInputSplit()).getPath(); 

I get null pointer exception at above statement.  Is there a way that I can set this context in test code ? If not, how can this kind of mrjobs be tested.
Similarly we are using DistributedCache in some of our mr jobs. How can I test such jobs? Is there a mockup available for DistributedCache class in mrunit.


Regards,
Ajay Srivastava





Re: Context and DistributedCache

Posted by Jarek Jarcec Cecho <ja...@apache.org>.
I believe that you can't test input split filename and distributed cache at the moment.

If you could file a JIRA on https://issues.apache.org/jira/browse/MRUNIT, I'm sure that someone would look on that sooner or later.

Jarcec

On Apr 11, 2012, at 7:53 AM, Ajay Srivastava wrote:

> Hi, 
> 
> I am planning to use mrunit in one of the projects and written some test cases. These test cases run fine for simple map reduce jobs but give error for most of the others.
> 
> For an example, in one of the map reduce job I have following code in setup method of Mapper class.
> 
> context.getInputSplit()).getPath(); 
> 
> I get null pointer exception at above statement.  Is there a way that I can set this context in test code ? If not, how can this kind of mrjobs be tested.
> Similarly we are using DistributedCache in some of our mr jobs. How can I test such jobs? Is there a mockup available for DistributedCache class in mrunit.
> 
> 
> Regards,
> Ajay Srivastava
> 
> 
> 
>