@Test(timeout = 30000)
public void testGetLocalPathForWriteForInvalidPaths() throws Exception {

  conf.set(CONTEXT, " ");
  try {
    dirAllocator.getLocalPathForWrite("/test", conf);
    fail("not throwing the exception");
  } catch (IOException e) {
    assertEquals("Incorrect exception message",
        "No space available in any of the local directories.", e.getMessage());
  }
}