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

  Assert.assertFalse(del.exists());
  del.mkdirs();
  byte[] data = "testSymLinkData".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();
  Assert.assertEquals(0, link.length());
  // create the symlink
  FileUtil.symLink(file.getAbsolutePath(), link.getAbsolutePath());
  // ensure that File#length returns the target file and link size
  Assert.assertEquals(data.length, file.length());
  Assert.assertEquals(data.length, link.length());
  file.delete();
  Assert.assertFalse(file.exists());
  if (Shell.WINDOWS && !Shell.isJava7OrAbove()) {
    // On Java6 on Windows, we copied the file
    Assert.assertEquals(data.length, link.length());
  } else {
    // Otherwise, the target file size is zero
    Assert.assertEquals(0, link.length());
  }
  link.delete();
  Assert.assertFalse(link.exists());
}