[ 
https://issues.apache.org/jira/browse/MRUNIT-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13567784#comment-13567784
 ] 

David Parks commented on MRUNIT-13:
-----------------------------------

I couldn't wait on the feature so I ended up hacking something together that 
works. I'm curious to see what better solution might come from folks more 
experienced here. If what I've done doesn't sound too far off base I'll be 
happy to pass it on. Though this isn't my area of expertise, so I may very well 
have come up with a less than optimal solution.

What I did:
  - Create a MockMapperWrapper/MockReducerWrapper class which wraps & mocks the 
users Mapper/Reducer class (I had to create this class in the Hadoop package 
org.apache.hadoop.mapreduce because the methods we need to mock were protected 
and mockito couldn't get around that).

  - Use the MockMapperWrapper/MockReducerWrapper instead of the users 
mapper/reducer directly (so we can inject our mock MultipleOutputs object into 
the users code).

  - Use MockMapperWrapper/MockReducerWrapper to inject a mock of 
MultipleOutputs immediately after the setup method has been executed.  Then use 
that mock to capture the output written to the various write(...) methods of 
MultilpleOutputs

  - I created a method: MapReduceOutput<K2,V2> runWithMultipleOutputs(), which 
returns an object containing both the context output as a List as well as a Map 
of such Lists for the multiple outputs (I haven't yet implemented the runTest() 
methods as those aren't critical to us).
                
> Add support for MultipleOutputs
> -------------------------------
>
>                 Key: MRUNIT-13
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-13
>             Project: MRUnit
>          Issue Type: New Feature
>            Reporter: E. Sammer
>            Assignee: Jim Donofrio
>
> Add support to mrunit for Hadoop's MultipleOutputs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to