Ejemplo n.º 1
0
 @Test(timeout = 30000)
 public void testFailFullyDeleteContentsGrantPermissions() throws IOException {
   setupDirsAndNonWritablePermissions();
   boolean ret = FileUtil.fullyDeleteContents(new MyFile(del), true);
   // this time the directories with revoked permissions *should* be deleted:
   validateAndSetWritablePermissions(false, ret);
 }
Ejemplo n.º 2
0
 @Test(timeout = 30000)
 public void testFullyDeleteContents() throws IOException {
   setupDirs();
   boolean ret = FileUtil.fullyDeleteContents(del);
   Assert.assertTrue(ret);
   Assert.assertTrue(del.exists());
   Assert.assertEquals(0, del.listFiles().length);
   validateTmpDir();
 }
Ejemplo n.º 3
0
 @Test(timeout = 30000)
 public void testFailFullyDeleteContents() throws IOException {
   if (Shell.WINDOWS) {
     // windows Dir.setWritable(false) does not work for directories
     return;
   }
   LOG.info("Running test to verify failure of fullyDeleteContents()");
   setupDirsAndNonWritablePermissions();
   boolean ret = FileUtil.fullyDeleteContents(new MyFile(del));
   validateAndSetWritablePermissions(true, ret);
 }