FileMapReduceJobOutput extends MapReduceJobOutput { @Override public void configure(Job job) throws IOException { super.configure(job); FileOutputFormat.setOutputPath(job, mFilePath); job.setNumReduceTasks(mNumSplits); } FileMapReduceJobOutput();   FileMapReduceJobOutput(Path filePath, int numSplits); @Override void initialize(Map<String, String> params); @Override void configure(Job job);  }
@Test public void testConfigure() throws ClassNotFoundException, IOException { final Path filePath = new Path("foo/bar"); final int numSplits = 42; final Class<? extends OutputFormat> outputFormatClass = TextOutputFormat.class; FileMapReduceJobOutput jobOutput = new ConcreteFileMapReduceJobOutput( filePath, numSplits, outputFormatClass); Job job = new Job(); jobOutput.configure(job); assertEquals(outputFormatClass, job.getOutputFormatClass()); assert(FileOutputFormat.getOutputPath(job).toString().endsWith(filePath.toString())); assertEquals(numSplits, job.getNumReduceTasks()); }