Testing Mapper
This lesson demonstrates how to write a unit test case for a Mapper class.
We'll cover the following...
Testing Mapper
In the previous section, we wrote our CarMapper
class. It takes in a long offset and a string line as input key-value pairs. The class then splits out car brand names and a count (always 1) as intermediate key-value pairs for the reducer function to consume. When developing code, we need to test it along the way. However, debugging and testing map reduce take a departure from the traditional testing and debugging of Java applications because of its distributed nature. We’ll ...