try {
File child = new File(tmp,"child");
FilePath childP = new FilePath(child);
childP.touch(4711);
Chmod chmodTask = new Chmod();
chmodTask.setProject(new Project());
chmodTask.setFile(child);
chmodTask.setPerm("0400");
chmodTask.execute();
FilePath copy = new FilePath(british,tmp.getPath()).child("copy");
childP.copyToWithPermission(copy);
assertEquals(childP.mode(),copy.mode());