james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject [06/13] james-project git commit: JAMES-2133 Switch from cassandraunit to cassandra in docker
Date Sat, 02 Sep 2017 06:00:08 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedState.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedState.java
index 1f9f2ae..3439a99 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryNonAuthenticatedState.java
@@ -35,6 +35,7 @@ public class InMemoryNonAuthenticatedState extends NonAuthenticatedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetch.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetch.java
index 6e85ff1..339d404 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetch.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryPartialFetch.java
@@ -35,6 +35,7 @@ public class InMemoryPartialFetch extends PartialFetch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
index 193a0ed..1ee0a6d 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryQuotaTest.java
@@ -35,6 +35,7 @@ public class InMemoryQuotaTest extends QuotaTest {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRename.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRename.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRename.java
index 79f0b74..c07044b 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRename.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryRename.java
@@ -35,6 +35,7 @@ public class InMemoryRename extends Rename {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearch.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearch.java
index d5dda8c..c11ef24 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearch.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySearch.java
@@ -35,6 +35,7 @@ public class InMemorySearch extends Search {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurity.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurity.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurity.java
index e7db795..e251c0d 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurity.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySecurity.java
@@ -35,6 +35,7 @@ public class InMemorySecurity extends Security {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelect.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelect.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelect.java
index b24654e..bd3eed2 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelect.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelect.java
@@ -35,6 +35,7 @@ public class InMemorySelect extends Select {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInbox.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInbox.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInbox.java
index 593123d..652ac55 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInbox.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedInbox.java
@@ -35,6 +35,7 @@ public class InMemorySelectedInbox extends SelectedInbox {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedState.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedState.java
index 13635b6..88d55cb 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedState.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemorySelectedState.java
@@ -35,6 +35,7 @@ public class InMemorySelectedState extends SelectedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearch.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearch.java
index c484d91..1398151 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearch.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearch.java
@@ -35,6 +35,7 @@ public class InMemoryUidSearch extends UidSearch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndex.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndex.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndex.java
index 21bc647..0b3647f 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndex.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUidSearchOnIndex.java
@@ -35,6 +35,7 @@ public class InMemoryUidSearchOnIndex extends UidSearchOnIndex {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupport.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupport.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupport.java
index 94e4ceb..6382bc9 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupport.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryUserFlagsSupport.java
@@ -35,6 +35,7 @@ public class InMemoryUserFlagsSupport extends UserFlagsSupport {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new InMemoryMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
index 8cc1fd1..8dc8eff 100644
--- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
+++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
@@ -63,16 +63,9 @@ public class InMemoryHostSystem extends JamesImapHostSystem {
         return new InMemoryHostSystem();
     }
     
-    private InMemoryHostSystem() throws MailboxException {
-        initFields();
-    }
-
     @Override
-    protected void resetData() throws Exception {
-        initFields();
-    }
-    
-    private void initFields() throws MailboxException {
+    public void beforeTest() throws Exception {
+        super.beforeTest();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
         MessageParser messageParser = new MessageParser();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
index f46d0e8..12b6888 100644
--- a/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
+++ b/mpt/impl/imap-mailbox/jcr/src/test/java/org/apache/james/mpt/imapmailbox/jcr/host/JCRHostSystem.java
@@ -116,7 +116,8 @@ public class JCRHostSystem extends JamesImapHostSystem {
         }
     }
 
-    public void resetData() throws Exception {
+    @Override
+    public void afterTest() throws Exception {
         resetUserMetaData();
       
     }
@@ -129,8 +130,7 @@ public class JCRHostSystem extends JamesImapHostSystem {
         dir.mkdirs();
     }
 
-
-    @Override
+    //JCR tests are broken partly because of that method not being run 
     public void afterTests() throws Exception {
         shutdownRepository();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlain.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlain.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlain.java
index 9e9a11c..27b7227 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlain.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatePlain.java
@@ -35,6 +35,7 @@ public class JpaAuthenticatePlain extends AuthenticatePlain {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedState.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedState.java
index 23339e9..b20e3db 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaAuthenticatedState.java
@@ -35,6 +35,7 @@ public class JpaAuthenticatedState extends AuthenticatedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessions.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessions.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessions.java
index de75791..f815ccc 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessions.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaConcurrentSessions.java
@@ -35,6 +35,7 @@ public class JpaConcurrentSessions extends ConcurrentSessions {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstore.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstore.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstore.java
index 1d28c7c..ea0af5d 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstore.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCondstore.java
@@ -35,6 +35,7 @@ public class JpaCondstore extends Condstore {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(JamesImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopy.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopy.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopy.java
index a4154b4..2ee21ad 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopy.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaCopy.java
@@ -35,6 +35,7 @@ public class JpaCopy extends Copy {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEvents.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEvents.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEvents.java
index 0041632..9debc12 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEvents.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaEvents.java
@@ -35,6 +35,7 @@ public class JpaEvents extends Events {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpunge.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpunge.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpunge.java
index 44eeae1..6074709 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpunge.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaExpunge.java
@@ -35,6 +35,7 @@ public class JpaExpunge extends Expunge {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetch.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetch.java
index 6275ef4..16d2015 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetch.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetch.java
@@ -35,6 +35,7 @@ public class JpaFetch extends Fetch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySection.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySection.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySection.java
index c25b2d3..80a2982 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySection.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodySection.java
@@ -35,6 +35,7 @@ public class JpaFetchBodySection extends FetchBodySection {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructure.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructure.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructure.java
index 2c1789e..467e6cb 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructure.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchBodyStructure.java
@@ -35,6 +35,7 @@ public class JpaFetchBodyStructure extends FetchBodyStructure {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeaders.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeaders.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeaders.java
index 04a72b6..ce3d867 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeaders.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaFetchHeaders.java
@@ -35,6 +35,7 @@ public class JpaFetchHeaders extends FetchHeaders {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListing.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListing.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListing.java
index 2fb5544..23b20c2 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListing.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaListing.java
@@ -35,6 +35,7 @@ public class JpaListing extends Listing {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotation.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotation.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotation.java
index 95fc478..e638697 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotation.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaMailboxAnnotation.java
@@ -35,6 +35,7 @@ public class JpaMailboxAnnotation extends MailboxAnnotation {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedState.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedState.java
index fcc0f67..e02e440 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaNonAuthenticatedState.java
@@ -35,6 +35,7 @@ public class JpaNonAuthenticatedState extends NonAuthenticatedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetch.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetch.java
index be83b77..2e71729 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetch.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaPartialFetch.java
@@ -35,6 +35,7 @@ public class JpaPartialFetch extends PartialFetch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
index 79dea51..a942095 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaQuotaTest.java
@@ -35,6 +35,7 @@ public class JpaQuotaTest extends QuotaTest {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRename.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRename.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRename.java
index 1756f8d..4000b20 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRename.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaRename.java
@@ -35,6 +35,7 @@ public class JpaRename extends Rename {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearch.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearch.java
index e700bc5..11cc901 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearch.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSearch.java
@@ -35,6 +35,7 @@ public class JpaSearch extends Search {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurity.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurity.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurity.java
index b1b2378..6a1c07a 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurity.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSecurity.java
@@ -35,6 +35,7 @@ public class JpaSecurity extends Security {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelect.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelect.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelect.java
index 7c1fe54..9b01128 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelect.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelect.java
@@ -35,6 +35,7 @@ public class JpaSelect extends Select {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInbox.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInbox.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInbox.java
index 369e5e1..9766626 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInbox.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedInbox.java
@@ -35,6 +35,7 @@ public class JpaSelectedInbox extends SelectedInbox {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedState.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedState.java
index 4921fd2..1613068 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedState.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaSelectedState.java
@@ -35,6 +35,7 @@ public class JpaSelectedState extends SelectedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearch.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearch.java
index 189a5c4..463ca8c 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearch.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearch.java
@@ -35,6 +35,7 @@ public class JpaUidSearch extends UidSearch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndex.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndex.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndex.java
index ec991ae..1a7ed96 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndex.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUidSearchOnIndex.java
@@ -35,6 +35,7 @@ public class JpaUidSearchOnIndex extends UidSearchOnIndex {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupport.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupport.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupport.java
index 893708f..d546b88 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupport.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/JpaUserFlagsSupport.java
@@ -35,6 +35,7 @@ public class JpaUserFlagsSupport extends UserFlagsSupport {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new JpaMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
index 31b8571..d87e6a5 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
@@ -73,15 +73,17 @@ public class JPAHostSystem extends JamesImapHostSystem {
         Feature.USER_FLAGS_SUPPORT,
         Feature.ANNOTATION_SUPPORT,
         Feature.QUOTA_SUPPORT);
-    private final JPAPerUserMaxQuotaManager maxQuotaManager;
 
     public static JamesImapHostSystem build() throws Exception {
         return new JPAHostSystem();
     }
     
-    private final OpenJPAMailboxManager mailboxManager;
+    private JPAPerUserMaxQuotaManager maxQuotaManager;
+    private OpenJPAMailboxManager mailboxManager;
 
-    public JPAHostSystem() throws Exception {
+    @Override
+    public void beforeTest() throws Exception {
+        super.beforeTest();
         EntityManagerFactory entityManagerFactory = JPA_TEST_CLUSTER.getEntityManagerFactory();
         JVMMailboxPathLocker locker = new JVMMailboxPathLocker();
         JPAUidProvider uidProvider = new JPAUidProvider(locker, entityManagerFactory);
@@ -118,17 +120,18 @@ public class JPAHostSystem extends JamesImapHostSystem {
         configure(new DefaultImapDecoderFactory().buildImapDecoder(),
                 new DefaultImapEncoderFactory().buildImapEncoder(),
                 defaultImapProcessorFactory);
-
     }
 
-    public void resetData() throws Exception {
+    @Override
+    public void afterTest() throws Exception {
         resetUserMetaData();
-        MailboxSession session = mailboxManager.createSystemSession("test");
-        mailboxManager.startProcessingRequest(session);
-        mailboxManager.deleteEverything(session);
-        mailboxManager.endProcessingRequest(session);
-        mailboxManager.logout(session, false);
-        
+        if (mailboxManager != null) {
+            MailboxSession session = mailboxManager.createSystemSession("test");
+            mailboxManager.startProcessingRequest(session);
+            mailboxManager.deleteEverything(session);
+            mailboxManager.endProcessingRequest(session);
+            mailboxManager.logout(session, false);
+        }
     }
     
     public void resetUserMetaData() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
index 27f3ab0..6139462 100644
--- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
+++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java
@@ -76,12 +76,13 @@ public class LuceneSearchHostSystem extends JamesImapHostSystem {
 
     @Override
     public void beforeTest() throws Exception {
+        super.beforeTest();
         this.tempFile = Files.createTempDir();
         initFields();
     }
 
     @Override
-    public void resetData() throws Exception {
+    public void afterTest() throws Exception {
         tempFile.deleteOnExit();
 
         resetUserMetaData();
@@ -90,7 +91,6 @@ public class LuceneSearchHostSystem extends JamesImapHostSystem {
         mailboxManager.deleteEverything(session);
         mailboxManager.endProcessingRequest(session);
         mailboxManager.logout(session, false);
-        
     }
 
     public void resetUserMetaData() throws Exception {

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlain.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlain.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlain.java
index 3dcc89a..1c4880b 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlain.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatePlain.java
@@ -35,6 +35,7 @@ public class MaildirAuthenticatePlain extends AuthenticatePlain {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedState.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedState.java
index 7844082..a004f20 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirAuthenticatedState.java
@@ -35,6 +35,7 @@ public class MaildirAuthenticatedState extends AuthenticatedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessions.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessions.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessions.java
index 38d1196..46da204 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessions.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirConcurrentSessions.java
@@ -35,6 +35,7 @@ public class MaildirConcurrentSessions extends ConcurrentSessions {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstore.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstore.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstore.java
index ee51fcb..29b6e82 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstore.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCondstore.java
@@ -35,6 +35,7 @@ public class MaildirCondstore extends Condstore {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(JamesImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopy.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopy.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopy.java
index 2004bc8..3393d82 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopy.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirCopy.java
@@ -35,6 +35,7 @@ public class MaildirCopy extends Copy {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEvents.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEvents.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEvents.java
index eabedd4..1d74bed 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEvents.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirEvents.java
@@ -35,6 +35,7 @@ public class MaildirEvents extends Events {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpunge.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpunge.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpunge.java
index e224268..cdfe2ae 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpunge.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirExpunge.java
@@ -35,6 +35,7 @@ public class MaildirExpunge extends Expunge {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetch.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetch.java
index 4f6d64f..e7a787a 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetch.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetch.java
@@ -35,6 +35,7 @@ public class MaildirFetch extends Fetch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySection.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySection.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySection.java
index ce8a9c3..a73524a 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySection.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodySection.java
@@ -35,6 +35,7 @@ public class MaildirFetchBodySection extends FetchBodySection {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructure.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructure.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructure.java
index 70574ed..46b2027 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructure.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchBodyStructure.java
@@ -35,6 +35,7 @@ public class MaildirFetchBodyStructure extends FetchBodyStructure {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeaders.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeaders.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeaders.java
index 43c707a..d5e7419 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeaders.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirFetchHeaders.java
@@ -35,6 +35,7 @@ public class MaildirFetchHeaders extends FetchHeaders {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListing.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListing.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListing.java
index f04baf2..fce3fbc 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListing.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirListing.java
@@ -35,6 +35,7 @@ public class MaildirListing extends Listing {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedState.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedState.java
index 162e929..1956d13 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedState.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirNonAuthenticatedState.java
@@ -35,6 +35,7 @@ public class MaildirNonAuthenticatedState extends NonAuthenticatedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetch.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetch.java
index 168e0a6..a784a8c 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetch.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirPartialFetch.java
@@ -35,6 +35,7 @@ public class MaildirPartialFetch extends PartialFetch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRename.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRename.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRename.java
index df5b232..018b369 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRename.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirRename.java
@@ -35,6 +35,7 @@ public class MaildirRename extends Rename {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearch.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearch.java
index 40b7e41..51e17c3 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearch.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSearch.java
@@ -35,6 +35,7 @@ public class MaildirSearch extends Search {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurity.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurity.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurity.java
index 91a5d95..7bf4fe9 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurity.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSecurity.java
@@ -35,6 +35,7 @@ public class MaildirSecurity extends Security {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelect.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelect.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelect.java
index dda44a9..cdda4a9 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelect.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelect.java
@@ -35,6 +35,7 @@ public class MaildirSelect extends Select {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInbox.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInbox.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInbox.java
index 4c0d518..9f66709 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInbox.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedInbox.java
@@ -35,6 +35,7 @@ public class MaildirSelectedInbox extends SelectedInbox {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedState.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedState.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedState.java
index 87aea1b..b6652bc 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedState.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirSelectedState.java
@@ -35,6 +35,7 @@ public class MaildirSelectedState extends SelectedState {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearch.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearch.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearch.java
index 0c82593..6e0435a 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearch.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearch.java
@@ -35,6 +35,7 @@ public class MaildirUidSearch extends UidSearch {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndex.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndex.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndex.java
index 9927ec8..bd97389 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndex.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/MaildirUidSearchOnIndex.java
@@ -35,6 +35,7 @@ public class MaildirUidSearchOnIndex extends UidSearchOnIndex {
     public void setUp() throws Exception {
         Injector injector = Guice.createInjector(new MaildirMailboxTestModule());
         system = injector.getInstance(ImapHostSystem.class);
+        system.beforeTest();
         super.setUp();
     }
     

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
index f5d93cc..f03ad97 100644
--- a/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
+++ b/mpt/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
@@ -30,7 +30,6 @@ import org.apache.james.mailbox.acl.GroupMembershipResolver;
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
-import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.maildir.MaildirMailboxSessionMapperFactory;
 import org.apache.james.mailbox.maildir.MaildirStore;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -53,13 +52,15 @@ public class MaildirHostSystem extends JamesImapHostSystem {
     private static final String MAILDIR_HOME = "target/Maildir";
     private static final ImapFeatures SUPPORTED_FEATURES = ImapFeatures.of();
     
-    private final StoreMailboxManager mailboxManager;
+    private StoreMailboxManager mailboxManager;
 
     public static JamesImapHostSystem build() throws Exception {
         return new MaildirHostSystem();
     }
     
-    public MaildirHostSystem() throws MailboxException {
+    @Override
+    public void beforeTest() throws Exception {
+        super.beforeTest();
         JVMMailboxPathLocker locker = new JVMMailboxPathLocker();
         MaildirStore store = new MaildirStore(MAILDIR_HOME + "/%user", locker);
         MaildirMailboxSessionMapperFactory mailboxSessionMapperFactory = new MaildirMailboxSessionMapperFactory(store);
@@ -88,7 +89,7 @@ public class MaildirHostSystem extends JamesImapHostSystem {
 
 
     @Override
-    public void resetData() throws Exception {
+    public void afterTest() throws Exception {
         resetUserMetaData();
         try {
         	FileUtils.deleteDirectory(new File(MAILDIR_HOME));

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/pom.xml
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/pom.xml b/mpt/impl/managesieve/cassandra/pom.xml
index 7be717d..bdefdac 100644
--- a/mpt/impl/managesieve/cassandra/pom.xml
+++ b/mpt/impl/managesieve/cassandra/pom.xml
@@ -30,6 +30,7 @@
 
     <name>Apache James MPT ManageSieve Cassandra</name>
 
+
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
@@ -48,11 +49,6 @@
             <groupId>${project.groupId}</groupId>
             <artifactId>james-server-data-cassandra</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.cassandraunit</groupId>
-            <artifactId>cassandra-unit</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraAuthenticateTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraAuthenticateTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraAuthenticateTest.java
index 8232ecd..ae45946 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraAuthenticateTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraAuthenticateTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.AuthenticateTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraAuthenticateTest extends AuthenticateTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCapabilityTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCapabilityTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCapabilityTest.java
index f66278f..802e685 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCapabilityTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCapabilityTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.CapabilityTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraCapabilityTest extends CapabilityTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCheckScriptTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCheckScriptTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCheckScriptTest.java
index 2f883d3..a137f79 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCheckScriptTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraCheckScriptTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.CheckScriptTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraCheckScriptTest extends CheckScriptTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraDeleteScriptTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraDeleteScriptTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraDeleteScriptTest.java
index f2da260..24f02ee 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraDeleteScriptTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraDeleteScriptTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.DeleteScriptTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraDeleteScriptTest extends DeleteScriptTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraGetScriptTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraGetScriptTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraGetScriptTest.java
index 6aa0753..7b9caac 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraGetScriptTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraGetScriptTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.GetScriptTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraGetScriptTest extends GetScriptTest {
     
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraHaveSpaceTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraHaveSpaceTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraHaveSpaceTest.java
index 97f5ac0..0571979 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraHaveSpaceTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraHaveSpaceTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.HaveSpaceTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraHaveSpaceTest extends HaveSpaceTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraListScriptsTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraListScriptsTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraListScriptsTest.java
index 19d794b..92292a6 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraListScriptsTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraListScriptsTest.java
@@ -19,21 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.ListScriptsTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public abstract class CassandraListScriptsTest extends ListScriptsTest {
 
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraLogoutTest.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraLogoutTest.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraLogoutTest.java
index d63953d..c3b6512 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraLogoutTest.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraLogoutTest.java
@@ -19,20 +19,25 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.mpt.host.ManageSieveHostSystem;
 import org.apache.james.mpt.testsuite.LogoutTest;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.ClassRule;
 
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
 public class CassandraLogoutTest extends LogoutTest {
+    
+    @ClassRule public static DockerCassandraRule cassandraServer = new DockerCassandraRule();
+    
     private ManageSieveHostSystem system;
 
     @Before
     public void setUp() throws Exception {
-        Injector injector = Guice.createInjector(new CassandraModule());
+        Injector injector = Guice.createInjector(new CassandraModule(cassandraServer.getIp(), cassandraServer.getBindingPort()));
         system = injector.getInstance(ManageSieveHostSystem.class);
         system.beforeTest();
         super.setUp();

http://git-wip-us.apache.org/repos/asf/james-project/blob/a18a4488/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraModule.java
----------------------------------------------------------------------
diff --git a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraModule.java b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraModule.java
index 6c22f05..cd0018d 100644
--- a/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraModule.java
+++ b/mpt/impl/managesieve/cassandra/src/test/java/org/apache/james/mpt/managesieve/cassandra/CassandraModule.java
@@ -19,22 +19,30 @@
 
 package org.apache.james.mpt.managesieve.cassandra;
 
+import org.apache.james.mpt.host.ManageSieveHostSystem;
+import org.apache.james.mpt.managesieve.cassandra.host.CassandraHostSystem;
+
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
-import org.apache.james.mpt.host.ManageSieveHostSystem;
-import org.apache.james.mpt.managesieve.cassandra.host.CassandraHostSystem;
 
 public class CassandraModule extends AbstractModule {
 
+    private final String cassandraHost;
+    private final int cassandraPort;
+
+    public CassandraModule(String cassandraHost, int cassandraPort) {
+        this.cassandraHost = cassandraHost;
+        this.cassandraPort = cassandraPort;
+    }
+    
     @Override
     protected void configure() {
-
     }
 
     @Provides
     @Singleton
     public ManageSieveHostSystem provideHostSystem() throws Exception {
-        return new CassandraHostSystem();
+        return new CassandraHostSystem(cassandraHost, cassandraPort);
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message