- private static ActorSystem system;
-
- @BeforeClass
- public static void setUp(){
- system = ActorSystem.create("test");
- }
-
- @AfterClass
- public static void tearDown(){
- JavaTestKit.shutdownActorSystem(system);
- system = null;
- }
-
- protected ActorSystem getSystem(){
- return system;
- }
+ private static ActorSystem system;
+
+ @BeforeClass
+ public static void setUpClass() throws IOException {
+
+ System.setProperty("shard.persistent", "false");
+ system = ActorSystem.create("test");
+
+ deletePersistenceFiles();
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws IOException {
+ 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() {
+ return system;
+ }