X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FAbstractActorTest.java;h=4c550a768cce258e3a151139f753751281b439d6;hp=ed928ec29c1e61b4be2daf1aa11db68c3b4bd512;hb=9f61e98b036119694dfef0759a7cafc56aae6e86;hpb=87142a0c2c300231ac49f017519d86d994569a32 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java index ed928ec29c..4c550a768c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractActorTest.java @@ -10,25 +10,46 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorSystem; import akka.testkit.JavaTestKit; +import org.apache.commons.io.FileUtils; import org.junit.AfterClass; import org.junit.BeforeClass; -public class AbstractActorTest { - private static ActorSystem system; +import java.io.File; +import java.io.IOException; - @BeforeClass - public static void setUp(){ - system = ActorSystem.create("test"); - } +public abstract class AbstractActorTest { + private static ActorSystem system; - @AfterClass - public static void tearDown(){ - JavaTestKit.shutdownActorSystem(system); - system = null; - } + @BeforeClass + public static void setUpClass() throws IOException { - protected ActorSystem getSystem(){ - return system; - } + System.setProperty("shard.persistent", "false"); + system = ActorSystem.create("test"); + } + + @AfterClass + 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() { + return system; + } }