geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject incubator-geode git commit: GEODE-1142: Modified the cleanUpVM function to clear all directories.
Date Thu, 31 Mar 2016 21:23:40 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop 859b4f6c8 -> 295db7b0c


GEODE-1142: Modified the cleanUpVM function to clear all directories.

* Fixed cleanDiskDir function to delete BACKUPDiskStore files.
* Removed System.property("vmid") in cleanDiskDir as this property was never set in the project.
* Replaced removePDXDirs with cleanDiskDirs function to clean up all the directories.

This closes #119


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/295db7b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/295db7b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/295db7b0

Branch: refs/heads/develop
Commit: 295db7b0ca2cdf635284e57891e1c7edc74333ac
Parents: 859b4f6
Author: nabarun <nnag@pivotal.io>
Authored: Tue Mar 29 15:27:31 2016 -0700
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Thu Mar 31 14:17:19 2016 -0700

----------------------------------------------------------------------
 .../cache/internal/JUnit4CacheTestCase.java      | 19 +++++++++++--------
 .../gemfire/internal/cache/wan/WANTestBase.java  |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/295db7b0/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
index d3988ef..b5bd5f7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -21,6 +21,7 @@ import java.io.FileWriter;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Arrays;
 import java.util.Map;
 import java.util.Properties;
 
@@ -537,15 +538,17 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements
Ca
 
   public static final void cleanDiskDirs() throws IOException {
     FileUtil.delete(getDiskDir());
-    File[] defaultStoreFiles = new File(".").listFiles(new FilenameFilter() {
-      @Override
-      public boolean accept(File dir, String name) {
-        return name.startsWith("BACKUPDiskStore-" + System.getProperty("vmid"));
-      }
-    });
+    Arrays.stream(new File(".").listFiles()).forEach(file -> deleteBACKUPDiskStoreFile(file));
+  }
 
-    for(File file: defaultStoreFiles) {
-      FileUtil.delete(file);
+  private static void deleteBACKUPDiskStoreFile(final File file) {
+    if(file.getName().startsWith("BACKUPDiskStore-")){
+      try {
+        FileUtil.delete(file);
+      }
+      catch (IOException e) {
+        throw new RuntimeException("Unable to delete BACKUPDiskStore file", e);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/295db7b0/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
index bfcb910..d73084b 100644
--- a/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/test/java/com/gemstone/gemfire/internal/cache/wan/WANTestBase.java
@@ -5069,7 +5069,7 @@ public class WANTestBase extends DistributedTestCase{
       Locator.getLocator().stop();
     }
     closeCache();
-    deletePDXDir();
+    CacheTestCase.cleanDiskDirs();
   }
 
   public static void closeCache() throws IOException {


Mime
View raw message