@SuppressWarnings("unchecked")
@Test
public void testInitNextRecordReader() throws IOException{

  JobConf conf = new JobConf();
  Path[] paths = new Path[3];
  long[] fileLength = new long[3];
  File[] files = new File[3];
  LongWritable key = new LongWritable(1);
  Text value = new Text();
  try {
    for(int i=0;i<3;i++){
      fileLength[i] = i;
      File dir = new File(outDir.toString());
      dir.mkdir();
      files[i] = new File(dir,"testfile"+i);
      FileWriter fileWriter = new FileWriter(files[i]);
      fileWriter.close();
      paths[i] = new Path(outDir+"/testfile"+i);
    }
    CombineFileSplit combineFileSplit = new CombineFileSplit(conf, paths, fileLength);
    Reporter reporter = Mockito.mock(Reporter.class);
    CombineFileRecordReader cfrr = new CombineFileRecordReader(conf, combineFileSplit,
      reporter,  TextRecordReaderWrapper.class);
    verify(reporter).progress();
    Assert.assertFalse(cfrr.next(key,value));
    verify(reporter, times(3)).progress();
  } finally {
    FileUtil.fullyDelete(new File(outDir.toString()));
  }
}