@Test(timeout=5000)
public void testRelativeTimeConversion() throws Exception {

  try {
    DFSUtil.parseRelativeTime("1");
  } catch (IOException e) {
    assertExceptionContains("too short", e);
  }
  try {
    DFSUtil.parseRelativeTime("1z");
  } catch (IOException e) {
    assertExceptionContains("unknown time unit", e);
  }
  try {
    DFSUtil.parseRelativeTime("yyz");
  } catch (IOException e) {
    assertExceptionContains("is not a number", e);
  }
  assertEquals(61*1000, DFSUtil.parseRelativeTime("61s"));
  assertEquals(61*60*1000, DFSUtil.parseRelativeTime("61m"));
  assertEquals(0, DFSUtil.parseRelativeTime("0s"));
  assertEquals(25*60*60*1000, DFSUtil.parseRelativeTime("25h"));
  assertEquals(4*24*60*60*1000l, DFSUtil.parseRelativeTime("4d"));
  assertEquals(999*24*60*60*1000l, DFSUtil.parseRelativeTime("999d"));
}