Description
Currently MapDriver.runTest() assumes that the order of pairs emitted by the mapper matches the order of the MapDriver.addOutput() calls. However, there are valid mappers that for a given input pair produce output pairs whose order is unspecified for testing purposes. (For example, if the mapper being tested uses a set object for deduplication before emission.) runTest() cannot be used to test these kinds of mappers.
A workaround is to not use runTest() but instead put the output of run() into a Set and assert that the contents of the set are correct, bypassing MRUnit's validation code.
A possible improvement would be to add a boolean orderMatters parameter to MapDriver.runTest(), invoking an order-insensitive version of TestDriver.validate() when orderMatters is false and the existing version otherwise.
For clarity's sake only mappers are discussed in this feature request, but the same applies to reducers as well.