Implement creating and applying of snapshot for a shard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / AbstractActorTest.java
index e23a76b0b223ee2b8ee0d5398da878cd520caf65..4c550a768cce258e3a151139f753751281b439d6 100644 (file)
@@ -22,11 +22,6 @@ 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");
@@ -36,12 +31,21 @@ public abstract class AbstractActorTest {
     public static void tearDownClass() throws IOException {
         JavaTestKit.shutdownActorSystem(system);
         system = null;
+    }
 
+    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() {