@Test
public void testSetOutputPathException() throws Exception {

  Job job = Job.getInstance();
  try {
    // Give it an invalid filesystem so it'll throw an exception
    FileOutputFormat.setOutputPath(job, new Path("foo:///bar"));
    fail("Should have thrown a RuntimeException with an IOException inside");
  }
  catch (RuntimeException re) {
    assertTrue(re.getCause() instanceof IOException);
  }
}