You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Barak Yaish <ba...@gmail.com> on 2013/01/17 21:07:13 UTC

How to unit test mappers reading data from DistributedCache?

Hi,

I've found MRUnit a very easy to unit test jobs, is it possible as well to
test mappers reading data from DisributedCache? If yes, can you share an
example how the test' setup() should look like?

Thanks.

Re: How to unit test mappers reading data from DistributedCache?

Posted by Hemanth Yamijala <yh...@thoughtworks.com>.
Hi,

Not sure how to do it using MRUnit, but should be possible to do this using
a mocking framework like Mockito or EasyMock. In a mapper (or reducer),
you'd use the Context classes to get the DistributedCache files. By mocking
these to return what you want, you could potentially run a true unit test.

Thanks
Hemanth


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>

Re: How to unit test mappers reading data from DistributedCache?

Posted by Hemanth Yamijala <yh...@thoughtworks.com>.
Hi,

Not sure how to do it using MRUnit, but should be possible to do this using
a mocking framework like Mockito or EasyMock. In a mapper (or reducer),
you'd use the Context classes to get the DistributedCache files. By mocking
these to return what you want, you could potentially run a true unit test.

Thanks
Hemanth


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>

Re: How to unit test mappers reading data from DistributedCache?

Posted by Harsh J <ha...@cloudera.com>.
Best to ask on MRUnit's own lists at user@mrunit.apache.org.

However, to answer your question, yes it does. Look at this test case:
https://svn.apache.org/repos/asf/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestDistributedCache.java
.

The JIRA https://issues.apache.org/jira/browse/MRUNIT-98 implemented this.


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>



-- 
Harsh J

Re: How to unit test mappers reading data from DistributedCache?

Posted by Harsh J <ha...@cloudera.com>.
Best to ask on MRUnit's own lists at user@mrunit.apache.org.

However, to answer your question, yes it does. Look at this test case:
https://svn.apache.org/repos/asf/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestDistributedCache.java
.

The JIRA https://issues.apache.org/jira/browse/MRUNIT-98 implemented this.


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>



-- 
Harsh J

Re: How to unit test mappers reading data from DistributedCache?

Posted by Harsh J <ha...@cloudera.com>.
Best to ask on MRUnit's own lists at user@mrunit.apache.org.

However, to answer your question, yes it does. Look at this test case:
https://svn.apache.org/repos/asf/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestDistributedCache.java
.

The JIRA https://issues.apache.org/jira/browse/MRUNIT-98 implemented this.


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>



-- 
Harsh J

Re: How to unit test mappers reading data from DistributedCache?

Posted by Hemanth Yamijala <yh...@thoughtworks.com>.
Hi,

Not sure how to do it using MRUnit, but should be possible to do this using
a mocking framework like Mockito or EasyMock. In a mapper (or reducer),
you'd use the Context classes to get the DistributedCache files. By mocking
these to return what you want, you could potentially run a true unit test.

Thanks
Hemanth


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>

Re: How to unit test mappers reading data from DistributedCache?

Posted by Hemanth Yamijala <yh...@thoughtworks.com>.
Hi,

Not sure how to do it using MRUnit, but should be possible to do this using
a mocking framework like Mockito or EasyMock. In a mapper (or reducer),
you'd use the Context classes to get the DistributedCache files. By mocking
these to return what you want, you could potentially run a true unit test.

Thanks
Hemanth


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>

Re: How to unit test mappers reading data from DistributedCache?

Posted by Harsh J <ha...@cloudera.com>.
Best to ask on MRUnit's own lists at user@mrunit.apache.org.

However, to answer your question, yes it does. Look at this test case:
https://svn.apache.org/repos/asf/mrunit/trunk/src/test/java/org/apache/hadoop/mrunit/TestDistributedCache.java
.

The JIRA https://issues.apache.org/jira/browse/MRUNIT-98 implemented this.


On Fri, Jan 18, 2013 at 1:37 AM, Barak Yaish <ba...@gmail.com> wrote:

> Hi,
>
> I've found MRUnit a very easy to unit test jobs, is it possible as well to
> test mappers reading data from DisributedCache? If yes, can you share an
> example how the test' setup() should look like?
>
> Thanks.
>



-- 
Harsh J