@Test
public void testOnCall() throws IOException {

  this.handler = new NativeCollectorOnlyHandler(taskContext, nativeHandler, pusher, combiner);
  boolean thrown = false;
  try {
    handler.onCall(new Command(-1), null);
  } catch(final IOException e) {
    thrown = true;
  }
  Assert.assertTrue("exception thrown", thrown);
  final String expectedOutputPath = StringUtils.join(File.separator,
      new String[] {LOCAL_DIR, "output", "file.out"});
  final String expectedOutputIndexPath = StringUtils.join(File.separator,
      new String[] {LOCAL_DIR, "output", "file.out.index"});
  final String expectedSpillPath = StringUtils.join(File.separator,
      new String[] {LOCAL_DIR, "output", "spill0.out"});
  final String outputPath = handler.onCall(
    NativeCollectorOnlyHandler.GET_OUTPUT_PATH, null).readString();
  Assert.assertEquals(expectedOutputPath, outputPath);
  final String outputIndexPath = handler.onCall(
    NativeCollectorOnlyHandler.GET_OUTPUT_INDEX_PATH, null).readString();
  Assert.assertEquals(expectedOutputIndexPath, outputIndexPath);
  final String spillPath = handler.onCall(
    NativeCollectorOnlyHandler.GET_SPILL_PATH, null).readString();
  Assert.assertEquals(expectedSpillPath, spillPath);
}