I am modifying an MapReduce program in the Record Reader and wanted to write a test case for mapper to call customised InputFormat or Record Reader. I have modified test case for record reader but the record reader test cases are not an mrunit one.
How to call the customised Record Reader from Mapper, as withInputFormat function is not listed under MapDriver.newMapDriver?
Please find the snapshot of my code:
@Before
public void setUp(){
MapDriver<Object, Text, Text, Text> mapDriver = MapDriver.newMapDriver(new myMapper());
}
@Test
public void testFunction1() throws IOException {
mapDriver.withInput(...).withOutput(...).runTest();
}
Thanks
I was checking the
MRUnitAPI, so. If you want to add a customRecordReaderi would guess you must have a customInputFormatdue to must assign the custom RecordReader into thecreateRecordReadermethod of the customInputFormatclass.So,
MRUnitAPI allows you to assign a customInputFormatwith also the customOutputFormat.Based on this, you can call
mapDriver.withOutFormat(customOutputFormat.class, customInputFormat.class). With this way, you can use your RecordReader for testing.