From dev-return-1951-apmail-mrunit-dev-archive=mrunit.apache.org@mrunit.apache.org Tue Apr 2 06:57:20 2013 Return-Path: X-Original-To: apmail-mrunit-dev-archive@www.apache.org Delivered-To: apmail-mrunit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 626A4F7BC for ; Tue, 2 Apr 2013 06:57:20 +0000 (UTC) Received: (qmail 87956 invoked by uid 500); 2 Apr 2013 06:57:19 -0000 Delivered-To: apmail-mrunit-dev-archive@mrunit.apache.org Received: (qmail 85823 invoked by uid 500); 2 Apr 2013 06:57:17 -0000 Mailing-List: contact dev-help@mrunit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mrunit.apache.org Delivered-To: mailing list dev@mrunit.apache.org Received: (qmail 85313 invoked by uid 99); 2 Apr 2013 06:57:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 06:57:15 +0000 Date: Tue, 2 Apr 2013 06:57:15 +0000 (UTC) From: "Ximo Guanter (JIRA)" To: dev@mrunit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MRUNIT-180) Being able to use a comparator on runTest MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MRUNIT-180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ximo Guanter updated MRUNIT-180: -------------------------------- Attachment: MRUNIT-180-2.patch Hello, After some usability testing, I have slightly improved the patch (MRUNIT-180-2.patch) by adding explicit setters and getters for the comparators instead of overloading the runTest() function. Both patches are backwards compatible, since they don't break the interface. With regard to the changes in TestMapReduceDriver: changing the Map type in buildPositionMap from HashMap to TreeMap changes the order in which errors are reported. The tests were previously asserting the full error string, which implies it was also expecting the order of the errors not to change (it was expecting the error for position 1 to be reported before the error for position 0). This is not ideal since the order of the errors doesn't really matter to the user, and the order of errors changed with the change of Map type, so the asserts have been rewritten where necessary so they assert each individual error, but not the relative order of apprearance between them. > Being able to use a comparator on runTest > ----------------------------------------- > > Key: MRUNIT-180 > URL: https://issues.apache.org/jira/browse/MRUNIT-180 > Project: MRUnit > Issue Type: Improvement > Affects Versions: 0.9.0 > Reporter: Ximo Guanter > Assignee: Ximo Guanter > Priority: Minor > Fix For: 1.1.0 > > Attachments: MRUNIT-180-2.patch, MRUNIT-180.patch > > > Sometimes using withOutput and runTest is not possible if the .equals method is not the correct way to compare equality. This is especially true for Mapper and Reducers that return doubles or structure with doubles in them, since there is no way to specify a desired error tolerance for the result. > Being able to specify a Comparator for the key and value types enabled the usage of runTest for these cases. -- 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