Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-641

WordCount unit test plus a helper class to facilitate testing Mappers and Reducers

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Not A Problem
    • None
    • None
    • examples
    • None

    Description

      There are to pieces to this The first is a test for WordCount, not because word count actually needed one but because it would be useful to beginners to have an example of how to unit test Mappers and Reducers.

      The second piece is AOutputCollector and it's associated unit test TestAOutputCollector. This is an abstract class that can be quickly extended by a stub OutputCollector in your unit tests to collect the output from your Mapper and Reducer tests and make it available for easy retreival when testing to see if the fourth key that was emitted was the one you expected. I think that this would be a useful tool to have in the main test folder but wasn't sure where would be best to put it. Also, since nothing else in Hadoop uses Hungarian notation you'll probably want to rename it. I didn't because I'm not confident about the naming conventions here and figured that since it and its test probably wouldn't end up living in the same folder as WordCount that you could just rename it when you moved it.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            masukomi Kate Rhodes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment