2

I'm trying to test some MapReduces with MRUnit 1.1.0, but I got this error:

14/10/13 14:19:49 ERROR mrunit.TestDriver: Missing expected outputs for namedOutput 'a'
14/10/13 14:19:49 ERROR mrunit.TestDriver: Missing expected output (b, a) for namedOutput 'a' at position 0.
14/10/13 14:19:49 ERROR mrunit.TestDriver: Expected no pathOutputs; got 1 pathOutputs.
14/10/13 14:19:49 ERROR mrunit.TestDriver: Received unexpected output (b, a) for unexpected PathOutput 'a'

The code that I execute is:

mapTextDriver.withInput(new LongWritable(1), new Text(content));
mapTextDriver.withMultiOutput("a", "b", "a");
mapTextDriver.runTest();

I was reading the JIRA https://issues.apache.org/jira/browse/MRUNIT-13 where they add the new feature to MRUnit but I don't know what I'm missing..

I included as well the annotations:

@RunWith(..)
@PrepareForTest(..)

I continued checking the code and debugging and I fixed. The proble was the way that I was writting in the Mapper. I was using mop.write(K,V,baseOutput) instance mop.write(NameFile, K, V), now, it's working with

mapTextDriver.runTest();

But I really feel more confortable with

List<Pair<NullWritable, Text>> outputs = mapTextDriver.run();

I don't know why it doesn't work MRUnit on this way, It returns nothing. I went inside of the code and I didn't get it. Any clue?

Guille
  • 2,248
  • 3
  • 24
  • 42

0 Answers0