mrunit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Beech (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MRUNIT-158) withOutput doesn't generate useful information with MapWritable on error
Date Thu, 15 Nov 2012 09:48:13 GMT

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

Dave Beech commented on MRUNIT-158:
-----------------------------------

The lack of a toString override will always produce a less-than-ideal error message, but I
suppose we could do a check to see if the Writable types being used override hashCode and
equals, and print a loud warning if they don't. 

Something like:
Class<? extends Writable> clazz = outputKey.getClass();
if (clazz.getMethod("equals", Object.class).getDeclaringClass() != clazz) {
  LOG.warn("Equals method is not being overridden - tests may fail");
}

... repeat for value types, hashCode method, etc etc ...

We could do this either at the time expected output is added, or at the top of the validate
method before checking outputs. 

                
> withOutput doesn't generate useful information with MapWritable on error
> ------------------------------------------------------------------------
>
>                 Key: MRUNIT-158
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-158
>             Project: MRUnit
>          Issue Type: Improvement
>    Affects Versions: 0.9.0
>            Reporter: Patrick Hunt
>            Priority: Minor
>
> Using withOutput generates the following, notice that the hashcode is printed rather
than some useful detail as to the content of the maps:
> Nov 9, 2012 2:40:01 PM org.apache.hadoop.mrunit.TestDriver logError
> SEVERE: Missing expected output (null-0, org.apache.hadoop.io.MapWritable@e1) at position
0.
> Nov 9, 2012 2:40:01 PM org.apache.hadoop.mrunit.TestDriver logError
> SEVERE: Received unexpected output (null-0, org.apache.hadoop.io.MapWritable@2059) at
position 0.

--
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

Mime
View raw message