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

Dan Ziemba commented on MRUNIT-213:
-----------------------------------

I have the same issue.  I found that adding 
{code:java}
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyReducer.class)
{code}
to the test class class prevents the IllegalArgumentException, but causes 
numerous other issues.  For example, marshalling and unmarshalling xml with 
JAXB in completely separate classes breaks in strange ways, but only when the 
xml has namespaces specified with xmlns="...".  I also ran into some issues 
with log4j.  

It appears that just having the @PrepareForTest annotation, even without 
arguments, changes the class loader of all code ran during the test, which can 
lead to strange and hard to track down issues.  I was able to solve my problems 
by also adding
{code:java}
@PowerMockIgnore({"javax.xml.*", "org.xml.sax.*", "org.apache.xerces.*", 
"org.w3c.dom.*"})
{code}
to the test class.

> MultipleOutputs for Reducers throws Named output 'test' not defined
> -------------------------------------------------------------------
>
>                 Key: MRUNIT-213
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-213
>             Project: MRUnit
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>         Environment: OSX, IntelliJ, CDH4.6.0
>            Reporter: John Conwell
>
> I pulled the unit test for testing multiple outputs for a reducer from the 
> patch of MRUNIT-13 and the test fails with the exception:
> java.lang.IllegalArgumentException: Named output 'test' not defined
>       at 
> org.apache.hadoop.mapreduce.lib.output.MultipleOutputs.checkNamedOutputName(MultipleOutputs.java:188)
>       at 
> org.apache.hadoop.mapreduce.lib.output.MultipleOutputs.write(MultipleOutputs.java:358)
>       at 
> org.apache.hadoop.mapreduce.lib.output.MultipleOutputs.write(MultipleOutputs.java:343)
> It looks like multiple reducer outputs needs to be setup in the Configuration 
> object the same way MultipleOutputs.addNamedOutput() does.
> I'm running cdh4.6.0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to