geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kdul...@apache.org
Subject [2/3] geode git commit: GEODE-2457: Replace org.apache.geode.internal.FileUtil with org.apache.commons.io.FileUtils
Date Thu, 23 Feb 2017 19:41:28 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java
index 3852dee..71daecc 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/JarDeployerIntegrationTest.java
@@ -107,7 +107,7 @@ public class JarDeployerIntegrationTest {
   @Test
   public void testDeployToInvalidDirectory() throws IOException, ClassNotFoundException {
     final File alternateDir = new File(temporaryFolder.getRoot(), "JarDeployerDUnit");
-    FileUtil.delete(alternateDir);
+    alternateDir.delete();
 
     final JarDeployer jarDeployer = new JarDeployer(alternateDir);
     final CyclicBarrier barrier = new CyclicBarrier(2);

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldDUnitTest.java
index 00bb6fb..435655d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldDUnitTest.java
@@ -14,18 +14,12 @@
  */
 package org.apache.geode.internal;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -46,6 +40,16 @@ import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 @Category(DistributedTest.class)
 public class PdxDeleteFieldDUnitTest extends JUnit4CacheTestCase {
@@ -186,7 +190,7 @@ public class PdxDeleteFieldDUnitTest extends JUnit4CacheTestCase {
   public void preTearDownCacheTestCase() throws Exception {
     for (String path : this.filesToBeDeleted) {
       try {
-        FileUtil.delete(new File(path));
+        Files.delete(new File(path).toPath());
       } catch (IOException e) {
         LogWriterUtils.getLogWriter().error("Unable to delete file", e);
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldJUnitTest.java
index 1d18ed1..affa7e3 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/PdxDeleteFieldJUnitTest.java
@@ -14,13 +14,32 @@
  */
 package org.apache.geode.internal;
 
-import org.apache.geode.cache.*;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DiskStoreFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache.query.internal.DefaultQuery;
 import org.apache.geode.internal.cache.DiskStoreImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.util.BlobHelper;
-import org.apache.geode.pdx.*;
-import org.apache.geode.pdx.internal.*;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxInstanceFactory;
+import org.apache.geode.pdx.PdxReader;
+import org.apache.geode.pdx.PdxSerializable;
+import org.apache.geode.pdx.PdxWriter;
+import org.apache.geode.pdx.internal.PdxField;
+import org.apache.geode.pdx.internal.PdxInstanceImpl;
+import org.apache.geode.pdx.internal.PdxType;
+import org.apache.geode.pdx.internal.PdxUnreadData;
+import org.apache.geode.pdx.internal.TypeRegistry;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -29,11 +48,6 @@ import java.io.File;
 import java.util.Collection;
 import java.util.Properties;
 
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
 @Category(IntegrationTest.class)
 public class PdxDeleteFieldJUnitTest {
 
@@ -96,7 +110,7 @@ public class PdxDeleteFieldJUnitTest {
         }
       }
     } finally {
-      FileUtil.delete(f);
+      FileUtils.deleteDirectory(f);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/PdxRenameDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/PdxRenameDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/PdxRenameDUnitTest.java
index 4057069..b05285a 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/PdxRenameDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/PdxRenameDUnitTest.java
@@ -14,18 +14,12 @@
  */
 package org.apache.geode.internal;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
@@ -47,6 +41,16 @@ import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 @Category(DistributedTest.class)
 public class PdxRenameDUnitTest extends JUnit4CacheTestCase {
@@ -195,7 +199,7 @@ public class PdxRenameDUnitTest extends JUnit4CacheTestCase {
   public void preTearDownCacheTestCase() throws Exception {
     for (String path : this.filesToBeDeleted) {
       try {
-        FileUtil.delete(new File(path));
+        Files.delete(new File(path).toPath());
       } catch (IOException e) {
         LogWriterUtils.getLogWriter().error("Unable to delete file", e);
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/PdxRenameJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/PdxRenameJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/PdxRenameJUnitTest.java
index cc393a2..561e8df 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/PdxRenameJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/PdxRenameJUnitTest.java
@@ -14,7 +14,17 @@
  */
 package org.apache.geode.internal;
 
-import org.apache.geode.cache.*;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DiskStoreFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.internal.cache.DiskStoreImpl;
 import org.apache.geode.pdx.PdxReader;
 import org.apache.geode.pdx.PdxSerializable;
@@ -30,10 +40,6 @@ import java.util.Collection;
 import java.util.Properties;
 import java.util.regex.Pattern;
 
-import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-
 @Category(IntegrationTest.class)
 public class PdxRenameJUnitTest {
   @Test
@@ -67,7 +73,7 @@ public class PdxRenameJUnitTest {
         }
       }
     } finally {
-      FileUtil.delete(f);
+      FileUtils.deleteDirectory(f);
     }
   }
 
@@ -118,7 +124,7 @@ public class PdxRenameJUnitTest {
         }
       }
     } finally {
-      FileUtil.delete(f);
+      FileUtils.deleteDirectory(f);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
index 10931e1..f2cee71 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupDUnitTest.java
@@ -14,33 +14,13 @@
  */
 package org.apache.geode.internal.cache;
 
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.geode.GemFireIOException;
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.admin.BackupStatus;
-import org.apache.geode.admin.internal.FinishBackupRequest;
 import org.apache.geode.admin.internal.PrepareBackupRequest;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;
@@ -58,7 +38,6 @@ import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.DistributionMessage;
 import org.apache.geode.distributed.internal.DistributionMessageObserver;
 import org.apache.geode.distributed.internal.ReplyMessage;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.admin.remote.AdminFailureResponse;
 import org.apache.geode.internal.cache.partitioned.PersistentPartitionedRegionTestBase;
 import org.apache.geode.test.dunit.Assert;
@@ -71,6 +50,26 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.regex.Pattern;
 
 @Category(DistributedTest.class)
 public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
@@ -80,7 +79,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
     StringBuilder failures = new StringBuilder();
-    FileUtil.delete(getBackupDir(), failures);
+    delete(getBackupDir(), failures);
     if (failures.length() > 0) {
       LogWriterUtils.getLogWriter().error(failures.toString());
     }
@@ -108,9 +107,9 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     assertEquals(2, status.getBackedUpDiskStores().size());
     assertEquals(Collections.emptySet(), status.getOfflineDiskStores());
 
-
-    List<File> mytexts = FileUtil.findAll(getBackupDir(), ".*my.txt.*");
-    assertEquals(2, mytexts.size());
+    Pattern pattern = Pattern.compile(".*my.txt.*");
+    Collection<File> files = FileUtils.listFiles(getBackupDir(), new String[] {"txt"}, true);
+    assertEquals(4, files.size());
     deleteOldUserUserFile(vm0);
     deleteOldUserUserFile(vm1);
     validateBackupComplete();
@@ -153,8 +152,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   /**
    * Test of bug 42419
-   * 
-   * @throws Throwable
    */
   @Test
   public void testBackupFromMemberWithDiskStore() throws Throwable {
@@ -177,7 +174,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     }
     assertEquals(Collections.emptySet(), status.getOfflineDiskStores());
 
-
     validateBackupComplete();
 
     closeCache(vm0);
@@ -218,8 +214,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   /**
    * Test for bug 42419
-   * 
-   * @throws Throwable
    */
   @Test
   public void testBackupWhileBucketIsCreated() throws Throwable {
@@ -228,7 +222,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     VM vm1 = host.getVM(1);
     final VM vm2 = host.getVM(2);
 
-
     LogWriterUtils.getLogWriter().info("Creating region in VM0");
     createPersistentRegion(vm0);
 
@@ -239,7 +232,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     LogWriterUtils.getLogWriter().info("Creating region in VM1");
     createPersistentRegion(vm1);
 
-
     final AtomicReference<BackupStatus> statusRef = new AtomicReference<BackupStatus>();
     Thread thread1 = new Thread() {
       public void run() {
@@ -259,12 +251,10 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     thread1.join();
     thread2.join();
 
-
     BackupStatus status = statusRef.get();
     assertEquals(2, status.getBackedUpDiskStores().size());
     assertEquals(Collections.emptySet(), status.getOfflineDiskStores());
 
-
     validateBackupComplete();
 
     createData(vm0, 0, 5, "C", "region1");
@@ -416,7 +406,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
    * Test for bug 42420. Invoke a backup when a bucket is in the middle of being moved.
    * 
    * @param observer - a message observer that triggers at the backup at the correct time.
-   * @throws Throwable
    */
   public void backupWhileBucketIsMoved(final DistributionMessageObserver observer)
       throws Throwable {
@@ -467,7 +456,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
         }
       });
 
-
       validateBackupComplete();
 
       createData(vm0, 0, 5, "C", "region1");
@@ -510,8 +498,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   /**
    * Make sure we don't report members without persistent data as backed up.
-   * 
-   * @throws Throwable
    */
   @Test
   public void testBackupOverflow() throws Throwable {
@@ -533,7 +519,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
     assertEquals(2, status.getBackedUpDiskStores().values().iterator().next().size());
     assertEquals(Collections.emptySet(), status.getOfflineDiskStores());
 
-
     validateBackupComplete();
 
   }
@@ -558,14 +543,11 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
     closeCache(vm2);
 
-
     BackupStatus status = backup(vm3);
     assertEquals(2, status.getBackedUpDiskStores().size());
     assertEquals(2, status.getOfflineDiskStores().size());
   }
 
-
-
   // TODO
   // Test default disk store.
   // Test backing up and recovering while a bucket move is in progress.
@@ -574,8 +556,10 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   private void validateBackupComplete() {
     File backupDir = getBackupDir();
-    File incompleteBackup = FileUtil.find(backupDir, ".*INCOMPLETE.*");
-    assertNull(incompleteBackup);
+    Pattern pattern = Pattern.compile(".*INCOMPLETE.*");
+    File[] files = backupDir.listFiles((dir1, name) -> pattern.matcher(name).matches());
+    assertNotNull(files);
+    assertTrue(files.length == 0);
   }
 
   protected void createPersistentRegion(VM vm) throws Throwable {
@@ -594,7 +578,7 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
       public void run() {
         final int pid = vm.getPid();
         try {
-          FileUtil.delete(new File("userbackup_" + pid));
+          FileUtils.deleteDirectory(new File("userbackup_" + pid));
         } catch (IOException e) {
           fail(e.getMessage());
         }
@@ -674,7 +658,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
         dsf.setMaxOplogSize(1);
         DiskStore ds = dsf.create(getUniqueName());
 
-
         RegionFactory rf = new RegionFactory();
         rf.setDiskStoreName(ds.getName());
         rf.setDiskSynchronous(true);
@@ -704,7 +687,6 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
         dsf.setMaxOplogSize(1);
         DiskStore ds = dsf.create(getUniqueName());
 
-
         RegionFactory rf = new RegionFactory();
         rf.setDiskStoreName(ds.getName());
         rf.setDiskSynchronous(true);
@@ -802,4 +784,31 @@ public class BackupDUnitTest extends PersistentPartitionedRegionTestBase {
 
   }
 
+  /**
+   * Recursively delete a file or directory. A description of any files or directories that can not
+   * be deleted will be added to failures if failures is non-null. This method tries to delete as
+   * much as possible.
+   */
+  public static void delete(File file, StringBuilder failures) {
+    if (!file.exists())
+      return;
+
+    if (file.isDirectory()) {
+      File[] fileList = file.listFiles();
+      if (fileList != null) {
+        for (File child : fileList) {
+          delete(child, failures);
+        }
+      }
+    }
+
+    try {
+      Files.delete(file.toPath());
+    } catch (IOException e) {
+      if (failures != null) {
+        failures.append("Could not delete ").append(file).append(" due to ").append(e.getMessage())
+            .append('\n');
+      }
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
index a89c0d1..6d04773 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
@@ -14,9 +14,28 @@
  */
 package org.apache.geode.internal.cache;
 
-import org.apache.geode.cache.*;
+import static junit.framework.TestCase.assertNotNull;
+import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.DiskStore;
+import org.apache.geode.cache.DiskStoreFactory;
+import org.apache.geode.cache.DiskWriteAttributesFactory;
+import org.apache.geode.cache.EvictionAction;
+import org.apache.geode.cache.EvictionAttributes;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.persistence.BackupManager;
 import org.apache.geode.internal.cache.persistence.RestoreScript;
 import org.apache.geode.test.junit.categories.IntegrationTest;
@@ -25,13 +44,19 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.*;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Properties;
+import java.util.Random;
 
 /**
  *
@@ -92,15 +117,15 @@ public class BackupJUnitTest {
   @After
   public void tearDown() throws Exception {
     cache.close();
-    FileUtil.delete(backupDir);
-    FileUtil.delete(diskDirs[0]);
-    FileUtil.delete(diskDirs[1]);
+    FileUtils.deleteDirectory(backupDir);
+    FileUtils.deleteDirectory(diskDirs[0]);
+    FileUtils.deleteDirectory(diskDirs[1]);
   }
 
   private void destroyDiskDirs() throws IOException {
-    FileUtil.delete(diskDirs[0]);
+    FileUtils.deleteDirectory(diskDirs[0]);
     diskDirs[0].mkdir();
-    FileUtil.delete(diskDirs[1]);
+    FileUtils.deleteDirectory(diskDirs[1]);
     diskDirs[1].mkdir();
   }
 
@@ -300,7 +325,10 @@ public class BackupJUnitTest {
     BackupManager backup = cache.startBackup(cache.getDistributedSystem().getDistributedMember());
     backup.prepareBackup();
     backup.finishBackup(backupDir, null, false);
-    File cacheXmlBackup = FileUtil.find(backupDir, ".*config.cache.xml");
+    Collection<File> fileCollection = FileUtils.listFiles(backupDir,
+        new RegexFileFilter("cache.xml"), DirectoryFileFilter.DIRECTORY);
+    assertEquals(1, fileCollection.size());
+    File cacheXmlBackup = fileCollection.iterator().next();
     assertTrue(cacheXmlBackup.exists());
     byte[] expectedBytes = getBytes(cacheXmlFile);
     byte[] backupBytes = getBytes(cacheXmlBackup);
@@ -345,7 +373,9 @@ public class BackupJUnitTest {
   }
 
   private void restoreBackup(boolean expectFailure) throws IOException, InterruptedException {
-    List<File> restoreScripts = FileUtil.findAll(backupDir, ".*restore.*");
+    Collection<File> restoreScripts = FileUtils.listFiles(backupDir,
+        new RegexFileFilter(".*restore.*"), DirectoryFileFilter.DIRECTORY);
+    assertNotNull(restoreScripts);
     assertEquals("Restore scripts " + restoreScripts, 1, restoreScripts.size());
     for (File script : restoreScripts) {
       execute(script, expectFailure);

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
index 6955dc8..44036c0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java
@@ -14,7 +14,18 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.Region;
+import org.apache.geode.test.junit.categories.FlakyTest;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.IOException;
@@ -23,15 +34,6 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import org.apache.geode.cache.DataPolicy;
-import org.apache.geode.cache.Region;
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.test.junit.categories.FlakyTest;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-
 @Category(IntegrationTest.class)
 public class DiskRegionAsyncRecoveryJUnitTest extends DiskRegionTestingBase {
 
@@ -492,15 +494,15 @@ public class DiskRegionAsyncRecoveryJUnitTest extends DiskRegionTestingBase {
     File tmpDir = new File(dirs[0].getParent(), "backupDir");
     tmpDir.mkdirs();
     for (File file : dirs) {
-      FileUtil.copy(file, new File(tmpDir, file.getName()));
+      FileUtils.copyDirectory(file, new File(tmpDir, file.getName()));
     }
   }
 
   private void restoreDisk() throws IOException {
     File tmpDir = new File(dirs[0].getParent(), "backupDir");
     for (File file : dirs) {
-      FileUtil.delete(file);
-      FileUtil.copy(new File(tmpDir, file.getName()), file);
+      FileUtils.deleteDirectory(file);
+      FileUtils.copyDirectory(new File(tmpDir, file.getName()), file);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
index 55cabe7..5333726 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
@@ -17,19 +17,15 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_STATISTICS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_ARCHIVE_FILE;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import org.apache.geode.LogWriter;
 import org.apache.geode.cache.Cache;
@@ -40,9 +36,19 @@ import org.apache.geode.cache.DiskStoreFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.LocalRegion.NonTXEntry;
 import org.apache.geode.internal.cache.versions.VersionTag;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TestName;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
 
 /**
  * All disk region unit tests extend this base class , common method to be used in all tests are
@@ -204,7 +210,7 @@ public abstract class DiskRegionTestingBase {
         while (cnt < 3) {
           try {
             cnt++;
-            FileUtil.delete(files[j]);
+            Files.delete(files[j].toPath());
             break;
           } catch (IOException e) {
             ioe = e;

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
index 9c459a9..0cc003e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/IncrementalBackupDUnitTest.java
@@ -14,24 +14,15 @@
  */
 package org.apache.geode.internal.cache;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
 import org.apache.geode.admin.AdminDistributedSystem;
 import org.apache.geode.admin.AdminDistributedSystemFactory;
 import org.apache.geode.admin.AdminException;
@@ -47,7 +38,6 @@ import org.apache.geode.cache.persistence.PersistentID;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.ClassBuilder;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.JarClassLoader;
 import org.apache.geode.internal.JarDeployer;
 import org.apache.geode.internal.cache.persistence.BackupManager;
@@ -62,6 +52,22 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.file.Files;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
 
 /**
  * Tests for the incremental backup feature.
@@ -105,7 +111,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
   };
 
   protected RegionFactory<Integer, String> getRegionFactory(Cache cache) {
-    return cache.<Integer, String>createRegionFactory(RegionShortcut.PARTITION_PERSISTENT);
+    return cache.createRegionFactory(RegionShortcut.PARTITION_PERSISTENT);
   }
 
   /**
@@ -376,7 +382,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
       }
     });
 
-    final Set<PersistentID> missingMembers = new HashSet<PersistentID>();
+    final Set<PersistentID> missingMembers = new HashSet<>();
     Wait.waitForCriterion(new WaitCriterion() {
       @Override
       public boolean done() {
@@ -415,7 +421,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
       public void run() {
         Collection<DiskStoreImpl> backupInProgress =
             ((GemFireCacheImpl) getCache()).listDiskStores();
-        List<DiskStoreImpl> backupCompleteList = new LinkedList<DiskStoreImpl>();
+        List<DiskStoreImpl> backupCompleteList = new LinkedList<>();
 
         while (backupCompleteList.size() < backupInProgress.size()) {
           for (DiskStoreImpl diskStore : backupInProgress) {
@@ -497,7 +503,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     File[] memberDirs = dateDirs[0].listFiles(new FileFilter() {
       @Override
       public boolean accept(File file) {
-        return (file.isDirectory() && (file.getName().indexOf(memberId) != -1));
+        return (file.isDirectory() && (file.getName().contains(memberId)));
       }
     });
 
@@ -578,9 +584,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
       }
     }).start();
 
-    int result = process.waitFor();
-
-    return result;
+    return process.waitFor();
   }
 
   /**
@@ -593,7 +597,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
      * The restore script will not restore if there is an if file in the copy to directory. Remove
      * these files first.
      */
-    List<File> ifFiles = FileUtil.findAll(memberDir, ".*\\.if$");
+    Collection<File> ifFiles = FileUtils.listFiles(memberDir, new RegexFileFilter(".*\\.if$"),
+        DirectoryFileFilter.DIRECTORY);
     for (File file : ifFiles) {
       file.delete();
     }
@@ -601,7 +606,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Remove all operation logs.
      */
-    List<File> oplogs = FileUtil.findAll(memberDir, OPLOG_REGEX);
+    Collection<File> oplogs = FileUtils.listFiles(memberDir, new RegexFileFilter(OPLOG_REGEX),
+        DirectoryFileFilter.DIRECTORY);
     for (File file : oplogs) {
       file.delete();
     }
@@ -688,9 +694,9 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
    */
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
-    FileUtil.delete(getIncremental2Dir());
-    FileUtil.delete(getIncrementalDir());
-    FileUtil.delete(getBaselineDir());
+    FileUtils.deleteDirectory(getIncremental2Dir());
+    FileUtils.deleteDirectory(getIncrementalDir());
+    FileUtils.deleteDirectory(getBaselineDir());
   }
 
   /**
@@ -709,7 +715,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     assertNotNull(memberDir);
 
     // Find all of the member's oplogs in the disk directory (*.crf,*.krf,*.drf)
-    List<File> memberOplogFiles = FileUtil.findAll(memberDir, OPLOG_REGEX);
+    Collection<File> memberOplogFiles = FileUtils.listFiles(memberDir,
+        new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberOplogFiles.isEmpty());
 
     // Perform a full backup and wait for it to finish
@@ -717,11 +724,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     waitForBackup(Host.getHost(0).getVM(1));
 
     // Find all of the member's oplogs in the baseline (*.crf,*.krf,*.drf)
-    List<File> memberBaselineOplogs =
-        FileUtil.findAll(getBackupDirForMember(getBaselineDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberBaselineOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getBaselineDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberBaselineOplogs.isEmpty());
 
-    List<String> memberBaselineOplogNames = new LinkedList<String>();
+    List<String> memberBaselineOplogNames = new LinkedList<>();
     TransformUtils.transform(memberBaselineOplogs, memberBaselineOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -731,11 +739,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     waitForBackup(Host.getHost(0).getVM(1));
 
     // Find all of the member's oplogs in the incremental (*.crf,*.krf,*.drf)
-    List<File> memberIncrementalOplogs =
-        FileUtil.findAll(getBackupDirForMember(getIncrementalDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberIncrementalOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getIncrementalDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberIncrementalOplogs.isEmpty());
 
-    List<String> memberIncrementalOplogNames = new LinkedList<String>();
+    List<String> memberIncrementalOplogNames = new LinkedList<>();
     TransformUtils.transform(memberIncrementalOplogs, memberIncrementalOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -755,11 +764,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     assertBackupStatus(performIncremental2());
     waitForBackup(Host.getHost(0).getVM(1));
 
-    List<File> memberIncremental2Oplogs =
-        FileUtil.findAll(getBackupDirForMember(getIncremental2Dir(), memberId), OPLOG_REGEX);
+    Collection<File> memberIncremental2Oplogs =
+        FileUtils.listFiles(getBackupDirForMember(getIncremental2Dir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberIncremental2Oplogs.isEmpty());
 
-    List<String> memberIncremental2OplogNames = new LinkedList<String>();
+    List<String> memberIncremental2OplogNames = new LinkedList<>();
     TransformUtils.transform(memberIncremental2Oplogs, memberIncremental2OplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -792,9 +802,10 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Collect all of the restored operation logs.
      */
-    List<File> restoredOplogs = FileUtil.findAll(new File(id.getDirectory()), OPLOG_REGEX);
+    Collection<File> restoredOplogs = FileUtils.listFiles(new File(id.getDirectory()),
+        new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(restoredOplogs.isEmpty());
-    List<String> restoredOplogNames = new LinkedList<String>();
+    List<String> restoredOplogNames = new LinkedList<>();
     TransformUtils.transform(restoredOplogs, restoredOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -854,8 +865,9 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
 
     // Find all of the member's oplogs in the missing member's diskstore directory structure
     // (*.crf,*.krf,*.drf)
-    List<File> missingMemberOplogFiles =
-        FileUtil.findAll(new File(missingMember.getDirectory()), OPLOG_REGEX);
+    Collection<File> missingMemberOplogFiles =
+        FileUtils.listFiles(new File(missingMember.getDirectory()),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(missingMemberOplogFiles.isEmpty());
 
     /*
@@ -866,7 +878,7 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * After reconnecting make sure the other members agree that the missing member is back online.
      */
-    final Set<PersistentID> missingMembers = new HashSet<PersistentID>();
+    final Set<PersistentID> missingMembers = new HashSet<>();
     Wait.waitForCriterion(new WaitCriterion() {
       @Override
       public boolean done() {
@@ -897,16 +909,17 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
 
     // Get list of backed up oplog files in the incremental backup for the missing member
     File incrementalMemberDir = getBackupDirForMember(getIncrementalDir(), memberId);
-    List<File> backupOplogFiles = FileUtil.findAll(incrementalMemberDir, OPLOG_REGEX);
+    Collection<File> backupOplogFiles = FileUtils.listFiles(incrementalMemberDir,
+        new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(backupOplogFiles.isEmpty());
 
     // Transform missing member oplogs to just their file names.
-    List<String> missingMemberOplogNames = new LinkedList<String>();
+    List<String> missingMemberOplogNames = new LinkedList<>();
     TransformUtils.transform(missingMemberOplogFiles, missingMemberOplogNames,
         TransformUtils.fileNameTransformer);
 
     // Transform missing member's incremental backup oplogs to just their file names.
-    List<String> backupOplogNames = new LinkedList<String>();
+    List<String> backupOplogNames = new LinkedList<>();
     TransformUtils.transform(backupOplogFiles, backupOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -932,11 +945,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Find all of the member's oplogs in the baseline (*.crf,*.krf,*.drf)
      */
-    List<File> memberBaselineOplogs =
-        FileUtil.findAll(getBackupDirForMember(getBaselineDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberBaselineOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getBaselineDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberBaselineOplogs.isEmpty());
 
-    List<String> memberBaselineOplogNames = new LinkedList<String>();
+    List<String> memberBaselineOplogNames = new LinkedList<>();
     TransformUtils.transform(memberBaselineOplogs, memberBaselineOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -952,11 +966,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Find all of the member's oplogs in the incremental (*.crf,*.krf,*.drf)
      */
-    List<File> memberIncrementalOplogs =
-        FileUtil.findAll(getBackupDirForMember(getIncrementalDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberIncrementalOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getIncrementalDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberIncrementalOplogs.isEmpty());
 
-    List<String> memberIncrementalOplogNames = new LinkedList<String>();
+    List<String> memberIncrementalOplogNames = new LinkedList<>();
     TransformUtils.transform(memberIncrementalOplogs, memberIncrementalOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -984,11 +999,12 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Find all of the member's oplogs in the baseline (*.crf,*.krf,*.drf)
      */
-    List<File> memberBaselineOplogs =
-        FileUtil.findAll(getBackupDirForMember(getBaselineDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberBaselineOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getBaselineDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberBaselineOplogs.isEmpty());
 
-    List<String> memberBaselineOplogNames = new LinkedList<String>();
+    List<String> memberBaselineOplogNames = new LinkedList<>();
     TransformUtils.transform(memberBaselineOplogs, memberBaselineOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -1021,17 +1037,18 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
      * Do an incremental after deleting the baseline. It should discover that the baseline is gone
      * and backup all of the operation logs that are in the baseline.
      */
-    FileUtil.delete(getBaselineDir());
+    FileUtils.deleteDirectory(getBaselineDir());
     Host.getHost(0).getVM(1).invoke(callable);
 
     /*
      * Find all of the member's oplogs in the incremental (*.crf,*.krf,*.drf)
      */
-    List<File> memberIncrementalOplogs =
-        FileUtil.findAll(getBackupDirForMember(getIncrementalDir(), memberId), OPLOG_REGEX);
+    Collection<File> memberIncrementalOplogs =
+        FileUtils.listFiles(getBackupDirForMember(getIncrementalDir(), memberId),
+            new RegexFileFilter(OPLOG_REGEX), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberIncrementalOplogs.isEmpty());
 
-    List<String> memberIncrementalOplogNames = new LinkedList<String>();
+    List<String> memberIncrementalOplogNames = new LinkedList<>();
     TransformUtils.transform(memberIncrementalOplogs, memberIncrementalOplogNames,
         TransformUtils.fileNameTransformer);
 
@@ -1078,8 +1095,9 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Make sure the user deployed jar is part of the backup.
      */
-    List<File> memberDeployedJarFiles =
-        FileUtil.findAll(getBackupDirForMember(getBaselineDir(), getMemberId(vm0)), jarNameRegex);
+    Collection<File> memberDeployedJarFiles =
+        FileUtils.listFiles(getBackupDirForMember(getBaselineDir(), getMemberId(vm0)),
+            new RegexFileFilter(jarNameRegex), DirectoryFileFilter.DIRECTORY);
     assertFalse(memberDeployedJarFiles.isEmpty());
 
     // Shut down our member so we can perform a restore
@@ -1103,7 +1121,8 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Cleanup "dummy" jar from file system.
      */
-    FileUtil.deleteMatching(new File(vmDir), "^" + JarDeployer.JAR_PREFIX + jarName + ".*#\\d++$");
+    Pattern pattern = Pattern.compile("^" + JarDeployer.JAR_PREFIX + jarName + ".*#\\d++$");
+    deleteMatching(new File("."), pattern);
 
     // Execute the restore
     performRestore(new File(id.getDirectory()), backupDir);
@@ -1111,13 +1130,14 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Make sure the user deployed jar is part of the restore.
      */
-    List<File> restoredJars = FileUtil.findAll(new File(vmDir), jarNameRegex);
+    Collection<File> restoredJars = FileUtils.listFiles(new File(vmDir),
+        new RegexFileFilter(jarNameRegex), DirectoryFileFilter.DIRECTORY);
     assertFalse(restoredJars.isEmpty());
-    List<String> restoredJarNames = new LinkedList<String>();
+    List<String> restoredJarNames = new LinkedList<>();
     TransformUtils.transform(memberDeployedJarFiles, restoredJarNames,
         TransformUtils.fileNameTransformer);
     for (String name : restoredJarNames) {
-      assertTrue(name.indexOf(jarName) != -1);
+      assertTrue(name.contains(jarName));
     }
 
     // Restart the member
@@ -1142,6 +1162,15 @@ public class IncrementalBackupDUnitTest extends JUnit4CacheTestCase {
     /*
      * Cleanup "dummy" jar from file system.
      */
-    FileUtil.deleteMatching(new File(vmDir), "^" + JarDeployer.JAR_PREFIX + jarName + ".*#\\d++$");
+    pattern = Pattern.compile("^" + JarDeployer.JAR_PREFIX + jarName + ".*#\\d++$");
+    deleteMatching(new File(vmDir), pattern);
+  }
+
+  private void deleteMatching(File dir, final Pattern pattern) throws IOException {
+    Collection<File> files =
+        FileUtils.listFiles(dir, new RegexFileFilter(pattern), DirectoryFileFilter.DIRECTORY);
+    for (File file : files) {
+      Files.delete(file.toPath());
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/OplogRVVJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/OplogRVVJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/OplogRVVJUnitTest.java
index 138f3ac..65833c4 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/OplogRVVJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/OplogRVVJUnitTest.java
@@ -14,13 +14,17 @@
  */
 package org.apache.geode.internal.cache;
 
-import java.io.File;
-import java.net.UnknownHostException;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
+import static org.junit.Assert.assertEquals;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.StatisticsFactory;
+import org.apache.geode.i18n.LogWriterI18n;
+import org.apache.geode.internal.cache.DiskInitFile.DiskRegionFlag;
+import org.apache.geode.internal.cache.DiskStoreImpl.OplogEntryIdSet;
+import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
+import org.apache.geode.internal.cache.persistence.DiskStoreID;
+import org.apache.geode.internal.cache.versions.DiskRegionVersionVector;
+import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
@@ -31,15 +35,13 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
-import org.apache.geode.StatisticsFactory;
-import org.apache.geode.i18n.LogWriterI18n;
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.internal.cache.DiskInitFile.DiskRegionFlag;
-import org.apache.geode.internal.cache.DiskStoreImpl.OplogEntryIdSet;
-import org.apache.geode.internal.cache.persistence.DiskRecoveryStore;
-import org.apache.geode.internal.cache.persistence.DiskStoreID;
-import org.apache.geode.internal.cache.versions.DiskRegionVersionVector;
-import org.apache.geode.test.junit.categories.IntegrationTest;
+import java.io.File;
+import java.net.UnknownHostException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
 
 @Category(IntegrationTest.class)
 public class OplogRVVJUnitTest {
@@ -174,10 +176,12 @@ public class OplogRVVJUnitTest {
     });
 
     oplog = new Oplog(1, oplogSet);
-    File drfFile = FileUtil.find(testDirectory, ".*.drf");
-    File crfFile = FileUtil.find(testDirectory, ".*.crf");
-    oplog.addRecoveredFile(drfFile, dirHolder);
-    oplog.addRecoveredFile(crfFile, dirHolder);
+    Collection<File> drfFiles = FileUtils.listFiles(testDirectory, new String[] {"drf"}, true);
+    assertEquals(1, drfFiles.size());
+    Collection<File> crfFiles = FileUtils.listFiles(testDirectory, new String[] {"crf"}, true);
+    assertEquals(1, crfFiles.size());
+    oplog.addRecoveredFile(drfFiles.iterator().next(), dirHolder);
+    oplog.addRecoveredFile(crfFiles.iterator().next(), dirHolder);
     OplogEntryIdSet deletedIds = new OplogEntryIdSet();
     oplog.recoverDrf(deletedIds, false, true);
     oplog.recoverCrf(deletedIds, true, true, false, Collections.singleton(oplog), true);

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java
index 2529639..e433771 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java
@@ -22,17 +22,7 @@ package org.apache.geode.internal.cache;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Set;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.LogWriter;
 import org.apache.geode.Statistics;
 import org.apache.geode.cache.AttributesFactory;
@@ -43,8 +33,17 @@ import org.apache.geode.cache.EvictionAttributes;
 import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.PartitionedRegionStorageException;
 import org.apache.geode.cache.RegionExistsException;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Random;
+import java.util.Set;
 
 /**
  *  
@@ -62,7 +61,7 @@ public class PartitionedRegionStatsJUnitTest {
   @After
   public void tearDown() throws IOException {
     PartitionedRegionTestHelper.closeCache();
-    FileUtil.delete(DISK_DIR);
+    FileUtils.deleteDirectory(DISK_DIR);
   }
 
   private PartitionedRegion createPR(String name, int lmax, int redundancy) {

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/PersistentPartitionedRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PersistentPartitionedRegionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PersistentPartitionedRegionJUnitTest.java
index 478f5e3..bfdf1c0 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PersistentPartitionedRegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PersistentPartitionedRegionJUnitTest.java
@@ -14,9 +14,24 @@
  */
 package org.apache.geode.internal.cache;
 
-import org.apache.geode.cache.*;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.EntryNotFoundException;
+import org.apache.geode.cache.EvictionAction;
+import org.apache.geode.cache.EvictionAttributes;
+import org.apache.geode.cache.ExpirationAction;
+import org.apache.geode.cache.ExpirationAttributes;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.util.ObjectSizer;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
@@ -27,10 +42,6 @@ import java.io.File;
 import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
 @Category(IntegrationTest.class)
 public class PersistentPartitionedRegionJUnitTest {
 
@@ -48,7 +59,7 @@ public class PersistentPartitionedRegionJUnitTest {
     if (cache != null && !cache.isClosed()) {
       cache.close();
     }
-    FileUtil.delete(dir);
+    FileUtils.deleteDirectory(dir);
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
index 47520bc..8748df6 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDUnitTest.java
@@ -14,39 +14,19 @@
  */
 package org.apache.geode.internal.cache.partitioned;
 
-import org.junit.experimental.categories.Category;
-import org.mockito.ArgumentCaptor;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.Appender;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.Logger;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
 import static org.awaitility.Awaitility.await;
-
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.times;
-
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.admin.internal.AdminDistributedSystemImpl;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
@@ -64,7 +44,6 @@ import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.DistributionMessage;
 import org.apache.geode.distributed.internal.DistributionMessageObserver;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.ColocationLogger;
 import org.apache.geode.internal.cache.InitialImageOperation.RequestImageMessage;
 import org.apache.geode.internal.cache.PartitionedRegion;
@@ -73,16 +52,34 @@ import org.apache.geode.internal.cache.control.InternalResourceManager;
 import org.apache.geode.internal.cache.control.InternalResourceManager.ResourceObserver;
 import org.apache.geode.test.dunit.Assert;
 import org.apache.geode.test.dunit.AsyncInvocation;
+import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.IgnoredException;
 import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.RMIException;
-import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.SerializableCallable;
 import org.apache.geode.test.dunit.SerializableRunnable;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
+import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.FlakyTest;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.Logger;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.ArgumentCaptor;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 @Category(DistributedTest.class)
 public class PersistentColocatedPartitionedRegionDUnitTest
@@ -105,7 +102,7 @@ public class PersistentColocatedPartitionedRegionDUnitTest
 
   @Override
   public final void preTearDownCacheTestCase() throws Exception {
-    FileUtil.delete(getBackupDir());
+    FileUtils.deleteDirectory(getBackupDir());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
index 09893be..ccdd38d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java
@@ -14,20 +14,11 @@
  */
 package org.apache.geode.internal.cache.partitioned;
 
-import static org.apache.geode.test.dunit.Assert.*;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.InetAddress;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
+import static org.apache.geode.test.dunit.Assert.assertEquals;
 
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
 import org.apache.geode.admin.AdminDistributedSystem;
 import org.apache.geode.admin.AdminDistributedSystemFactory;
 import org.apache.geode.admin.AdminException;
@@ -45,7 +36,6 @@ import org.apache.geode.cache.partition.PartitionRegionHelper;
 import org.apache.geode.cache.partition.PartitionRegionInfo;
 import org.apache.geode.cache.persistence.PersistentID;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.DiskRegion;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.PartitionedRegion;
@@ -65,6 +55,18 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.util.Collection;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
 public abstract class PersistentPartitionedRegionTestBase extends JUnit4CacheTestCase {
 
   public static String PR_REGION_NAME = "region";
@@ -774,7 +776,8 @@ public abstract class PersistentPartitionedRegionTestBase extends JUnit4CacheTes
   }
 
   protected void restoreBackup(int expectedNumScripts) throws IOException, InterruptedException {
-    List<File> restoreScripts = FileUtil.findAll(getBackupDir(), ".*restore.*");
+    Collection<File> restoreScripts = FileUtils.listFiles(getBackupDir(),
+        new RegexFileFilter(".*restore.*"), DirectoryFileFilter.DIRECTORY);
     assertEquals("Restore scripts " + restoreScripts, expectedNumScripts, restoreScripts.size());
     for (File script : restoreScripts) {
       execute(script);

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
index d8aa379..5d4096e 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningTestBase.java
@@ -14,23 +14,15 @@
  */
 package org.apache.geode.internal.cache.partitioned.fixed;
 
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.Set;
-
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
-import org.junit.experimental.categories.Category;
-
 import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.Cache;
@@ -48,7 +40,6 @@ import org.apache.geode.cache.partition.PartitionRegionHelper;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.FixedPartitionAttributesImpl;
 import org.apache.geode.internal.cache.HARegion;
 import org.apache.geode.internal.cache.PartitionRegionConfig;
@@ -70,6 +61,19 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Properties;
+import java.util.Set;
 
 /**
  * This is the base class to do operations
@@ -1285,7 +1289,7 @@ public class FixedPartitioningTestBase extends JUnit4DistributedTestCase {
   }
 
   public static void cleanDiskDirs() throws IOException {
-    FileUtil.delete(getDiskDir());
+    FileUtils.deleteDirectory(getDiskDir());
   }
 
   public static void closeCache() {

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/BackupInspectorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/BackupInspectorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/BackupInspectorJUnitTest.java
index 1da360e..5fd3585 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/BackupInspectorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/BackupInspectorJUnitTest.java
@@ -14,22 +14,22 @@
  */
 package org.apache.geode.internal.cache.persistence;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Set;
-
-import org.junit.After;
+import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.test.junit.categories.IntegrationTest;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Set;
 
 /**
  * TODO: fails when running integrationTest from gradle command-line on Windows 7

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java
index c76292e..4c82742 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java
@@ -14,13 +14,9 @@
  */
 package org.apache.geode.internal.cache.persistence;
 
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
+import static org.junit.Assert.fail;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.DataPolicy;
 import org.apache.geode.cache.DiskStore;
@@ -28,7 +24,6 @@ import org.apache.geode.cache.DiskStoreFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionFactory;
 import org.apache.geode.cache.Scope;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Invoke;
@@ -38,6 +33,11 @@ import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
 public abstract class PersistentReplicatedTestBase extends JUnit4CacheTestCase {
 
   protected static final int MAX_WAIT = 30 * 1000;
@@ -51,7 +51,7 @@ public abstract class PersistentReplicatedTestBase extends JUnit4CacheTestCase {
         new Object[] {getUniqueName()});
     setRegionName(getUniqueName());
     diskDir = new File("diskDir-" + getName()).getAbsoluteFile();
-    org.apache.geode.internal.FileUtil.delete(diskDir);
+    FileUtils.deleteDirectory(diskDir);
     diskDir.mkdir();
     diskDir.deleteOnExit();
   }
@@ -62,7 +62,7 @@ public abstract class PersistentReplicatedTestBase extends JUnit4CacheTestCase {
 
   @Override
   public final void postTearDownCacheTestCase() throws Exception {
-    org.apache.geode.internal.FileUtil.delete(diskDir);
+    FileUtils.deleteDirectory(diskDir);
     postTearDownPersistentReplicatedTestBase();
   }
 
@@ -216,16 +216,16 @@ public abstract class PersistentReplicatedTestBase extends JUnit4CacheTestCase {
   protected void backupDir(VM vm) throws IOException {
     File dirForVM = getDiskDirForVM(vm);
     File backFile = new File(dirForVM.getParent(), dirForVM.getName() + ".bk");
-    FileUtil.copy(dirForVM, backFile);
+    FileUtils.copyDirectory(dirForVM, backFile);
   }
 
   protected void restoreBackup(VM vm) throws IOException {
     File dirForVM = getDiskDirForVM(vm);
     File backFile = new File(dirForVM.getParent(), dirForVM.getName() + ".bk");
     if (!backFile.renameTo(dirForVM)) {
-      FileUtil.delete(dirForVM);
-      FileUtil.copy(backFile, dirForVM);
-      FileUtil.delete(backFile);
+      FileUtils.deleteDirectory(dirForVM);
+      FileUtils.copyDirectory(backFile, dirForVM);
+      FileUtils.deleteDirectory(backFile);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgrade2DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgrade2DUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgrade2DUnitTest.java
index 5106935..54c6d94 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgrade2DUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgrade2DUnitTest.java
@@ -19,6 +19,7 @@ import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
 import static org.apache.geode.test.dunit.Assert.fail;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.DataPolicy;
@@ -48,7 +49,6 @@ import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.DiskInitFile;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
@@ -149,7 +149,7 @@ public class RollingUpgrade2DUnitTest extends JUnit4DistributedTestCase {
     File pwd = new File(".");
     for (File entry : pwd.listFiles()) {
       try {
-        FileUtil.delete(entry);
+        FileUtils.deleteDirectory(entry);
       } catch (Exception e) {
         System.out.println("Could not delete " + entry + ": " + e.getMessage());
       }
@@ -1527,7 +1527,7 @@ public class RollingUpgrade2DUnitTest extends JUnit4DistributedTestCase {
 
   public void deleteDiskStores() throws Exception {
     try {
-      FileUtil.delete(new File(diskDir).getAbsoluteFile());
+      FileUtils.deleteDirectory(new File(diskDir).getAbsoluteFile());
     } catch (IOException e) {
       throw new Error("Error deleting files", e);
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
index 54b51de..0940ea6 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeDUnitTest.java
@@ -14,11 +14,11 @@
  */
 package org.apache.geode.internal.cache.rollingupgrade;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.FileUtil;
 import org.apache.geode.internal.Version;
 import org.apache.geode.test.dunit.DistributedTestUtils;
 import org.apache.geode.test.dunit.Host;
@@ -28,7 +28,6 @@ import org.apache.geode.test.dunit.LogWriterUtils;
 import org.apache.geode.test.dunit.NetworkUtils;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.dunit.standalone.DUnitLauncher;
 import org.apache.geode.test.dunit.standalone.VersionManager;
 import org.apache.geode.test.junit.categories.BackwardCompatibilityTest;
 import org.apache.geode.test.junit.categories.DistributedTest;
@@ -98,7 +97,7 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase {
     File pwd = new File(".");
     for (File entry : pwd.listFiles()) {
       try {
-        FileUtil.delete(entry);
+        FileUtils.deleteDirectory(entry);
       } catch (Exception e) {
         System.out.println("Could not delete " + entry + ": " + e.getMessage());
       }
@@ -688,7 +687,7 @@ public class RollingUpgradeDUnitTest extends JUnit4DistributedTestCase {
 
   public void deleteDiskStores() throws Exception {
     try {
-      FileUtil.delete(new File(diskDir).getAbsoluteFile());
+      FileUtils.deleteDirectory(new File(diskDir).getAbsoluteFile());
     } catch (IOException e) {
       throw new Error("Error deleting files", e);
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/Log4J2PerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/Log4J2PerformanceTest.java b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/Log4J2PerformanceTest.java
index 0bd50ab..24cb6d8 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/Log4J2PerformanceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/Log4J2PerformanceTest.java
@@ -14,16 +14,13 @@
  */
 package org.apache.geode.internal.logging.log4j;
 
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URL;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.logging.LoggingPerformanceTestCase;
+import org.apache.geode.internal.util.IOUtils;
+import org.apache.geode.test.junit.categories.PerformanceTest;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -32,11 +29,12 @@ import org.junit.After;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.internal.logging.LoggingPerformanceTestCase;
-import org.apache.geode.internal.util.IOUtils;
-import org.apache.geode.test.junit.categories.PerformanceTest;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
 
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
@@ -101,7 +99,8 @@ public class Log4J2PerformanceTest extends LoggingPerformanceTestCase {
 
     this.logFile = new File(this.configDirectory, DistributionConfig.GEMFIRE_PREFIX + "log");
     final String logFilePath = IOUtils.tryGetCanonicalPathElseGetAbsolutePath(logFile);
-    final String logFileName = FileUtil.stripOffExtension(logFilePath);
+    final String logFileName =
+        logFilePath.substring(0, logFilePath.lastIndexOf(File.separatorChar));
     setPropertySubstitutionValues(logFileName, DEFAULT_LOG_FILE_SIZE_LIMIT,
         DEFAULT_LOG_FILE_COUNT_LIMIT);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogWriterLoggerPerformanceTest.java b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
index d4f36d3..31bdd95 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/logging/log4j/LogWriterLoggerPerformanceTest.java
@@ -14,16 +14,13 @@
  */
 package org.apache.geode.internal.logging.log4j;
 
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URL;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.internal.logging.LoggingPerformanceTestCase;
+import org.apache.geode.internal.util.IOUtils;
+import org.apache.geode.test.junit.categories.PerformanceTest;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
@@ -31,11 +28,12 @@ import org.junit.After;
 import org.junit.Ignore;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.internal.logging.LoggingPerformanceTestCase;
-import org.apache.geode.internal.util.IOUtils;
-import org.apache.geode.test.junit.categories.PerformanceTest;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
 
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
@@ -100,7 +98,8 @@ public class LogWriterLoggerPerformanceTest extends LoggingPerformanceTestCase {
 
     this.logFile = new File(this.configDirectory, DistributionConfig.GEMFIRE_PREFIX + "log");
     final String logFilePath = IOUtils.tryGetCanonicalPathElseGetAbsolutePath(logFile);
-    final String logFileName = FileUtil.stripOffExtension(logFilePath);
+    final String logFileName =
+        logFilePath.substring(0, logFilePath.lastIndexOf(File.separatorChar));
     setPropertySubstitutionValues(logFileName, DEFAULT_LOG_FILE_SIZE_LIMIT,
         DEFAULT_LOG_FILE_COUNT_LIMIT);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/29246ab7/geode-core/src/test/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
index d98c5d2..a9bcab1 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/net/SSLSocketIntegrationTest.java
@@ -14,13 +14,31 @@
  */
 package org.apache.geode.internal.net;
 
-import static org.awaitility.Awaitility.*;
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.internal.security.SecurableCommunicationChannel.*;
-import static org.assertj.core.api.Assertions.*;
-
+import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_CIPHERS;
+import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_PROTOCOLS;
+import static org.apache.geode.distributed.ConfigurationProperties.CLUSTER_SSL_REQUIRE_AUTHENTICATION;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.internal.security.SecurableCommunicationChannel.CLUSTER;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionConfigImpl;
+import org.apache.geode.internal.security.SecurableCommunicationChannel;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.MembershipTest;
 import org.awaitility.Awaitility;
-import com.sun.tools.hat.internal.model.StackTrace;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ErrorCollector;
+import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestName;
 
 import java.io.File;
 import java.io.IOException;
@@ -37,23 +55,6 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.apache.geode.internal.security.SecurableCommunicationChannel;
-import org.apache.geode.test.junit.categories.MembershipTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.contrib.java.lang.system.RestoreSystemProperties;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.ErrorCollector;
-import org.junit.rules.TemporaryFolder;
-import org.junit.rules.TestName;
-
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionConfigImpl;
-import org.apache.geode.internal.FileUtil;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-
 /**
  * Integration tests for SocketCreatorFactory with SSL.
  * <p>
@@ -226,7 +227,7 @@ public class SSLSocketIntegrationTest {
     assertThat(resource).isNotNull();
 
     File file = this.temporaryFolder.newFile(name.replaceFirst(".*/", ""));
-    FileUtil.copy(resource, file);
+    FileUtils.copyFile(new File(resource.getFile()), file);
     return file;
   }
 


Mime
View raw message