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

  byte[] data = "testSymLink".getBytes();
  File file = new File(del, FILE);
  File link = new File(del, "_link");
  //write some data to the file
  FileOutputStream os = new FileOutputStream(file);
  os.write(data);
  os.close();
  //create the symlink
  FileUtil.symLink(file.getAbsolutePath(), link.getAbsolutePath());
  //ensure that symlink length is correctly reported by Java
  Assert.assertEquals(data.length, file.length());
  Assert.assertEquals(data.length, link.length());
  //ensure that we can read from link.
  FileInputStream in = new FileInputStream(link);
  long len = 0;
  while (in.read() > 0) {
    len++;
  }
  in.close();
  Assert.assertEquals(data.length, len);
}