@Test
public void testRename() throws IOException {

  // Rename a file
  fileSystemTestHelper.createFile(fSys, "/newDir/foo");
  fSys.rename(new Path("/newDir/foo"), new Path("/newDir/fooBar"));
  Assert.assertFalse(fSys.exists(new Path("/newDir/foo")));
  Assert.assertFalse(fSysTarget.exists(new Path(chrootedTo,"newDir/foo")));
  Assert.assertTrue(fSys.isFile(fileSystemTestHelper.getTestRootPath(fSys,"/newDir/fooBar")));
  Assert.assertTrue(fSysTarget.isFile(new Path(chrootedTo,"newDir/fooBar")));
  
  
  // Rename a dir
  fSys.mkdirs(new Path("/newDir/dirFoo"));
  fSys.rename(new Path("/newDir/dirFoo"), new Path("/newDir/dirFooBar"));
  Assert.assertFalse(fSys.exists(new Path("/newDir/dirFoo")));
  Assert.assertFalse(fSysTarget.exists(new Path(chrootedTo,"newDir/dirFoo")));
  Assert.assertTrue(fSys.isDirectory(fileSystemTestHelper.getTestRootPath(fSys,"/newDir/dirFooBar")));
  Assert.assertTrue(fSysTarget.isDirectory(new Path(chrootedTo,"newDir/dirFooBar")));
}