BUG 1853 : Clustered Data Store causes Out of Memory
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / AbstractActorTest.java
index e23a76b0b223ee2b8ee0d5398da878cd520caf65..022ef9bbafef949921ec24041357cff64013ea12 100644 (file)
@@ -22,14 +22,11 @@ public abstract class AbstractActorTest {
 
     @BeforeClass
     public static void setUpClass() throws IOException {
-        File journal = new File("journal");
-
-        if(journal.exists()) {
-            FileUtils.deleteDirectory(journal);
-        }
 
         System.setProperty("shard.persistent", "false");
         system = ActorSystem.create("test");
+
+        deletePersistenceFiles();
     }
 
     @AfterClass
@@ -37,11 +34,22 @@ public abstract class AbstractActorTest {
         JavaTestKit.shutdownActorSystem(system);
         system = null;
 
+        deletePersistenceFiles();
+    }
+
+    protected static void deletePersistenceFiles() throws IOException {
         File journal = new File("journal");
 
         if(journal.exists()) {
             FileUtils.deleteDirectory(journal);
         }
+
+        File snapshots = new File("snapshots");
+
+        if(snapshots.exists()){
+            FileUtils.deleteDirectory(snapshots);
+        }
+
     }
 
     protected ActorSystem getSystem() {