You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/01/15 03:22:02 UTC

[27/30] james-project git commit: JAMES-2641 Correct spring logic

JAMES-2641 Correct spring logic

We need to register listeners that was previously registered


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/367c5aca
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/367c5aca
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/367c5aca

Branch: refs/heads/master
Commit: 367c5aca3f6724f5efb80c638cbcf74f359bff5d
Parents: d86e8b7
Author: Benoit Tellier <bt...@linagora.com>
Authored: Wed Jan 9 13:11:24 2019 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Jan 15 10:10:05 2019 +0700

----------------------------------------------------------------------
 .../resources/META-INF/spring/mailbox-jpa.xml   | 20 +++---
 .../META-INF/spring/mailbox-index-lucene.xml    |  2 +-
 .../META-INF/spring/mailbox-maildir.xml         | 26 +++----
 .../META-INF/spring/mailbox-memory.xml          | 23 +++----
 .../mailbox/spring/MailboxInitializer.java      | 71 ++++++++++++++++++++
 .../james/mailbox/spring/SpringMailbox.java     |  3 +-
 .../resources/META-INF/spring/event-system.xml  |  2 +-
 .../main/resources/META-INF/spring/quota.xml    | 11 ++-
 .../META-INF/spring/spring-mailbox.xml          | 14 +++-
 .../spring/mailbox-index-lucene-test.xml        | 44 ++++++++++++
 .../META-INF/spring/mailbox-index-lucene.xml    | 48 -------------
 .../store/MailboxManagerConfiguration.java      |  8 +++
 .../app/spring/JamesSpringContextTest.java      |  1 -
 13 files changed, 181 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml b/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
index 6c0901f..9e60f9d 100644
--- a/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
+++ b/mailbox/jpa/src/main/resources/META-INF/spring/mailbox-jpa.xml
@@ -32,18 +32,16 @@
     <bean id="jpa-mailboxIdFactory" class="org.apache.james.mailbox.jpa.JPAId.Factory" />
 
 
-    <bean id="jpa-mailboxmanager" class="org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager" init-method="init">
+    <bean id="jpa-mailboxmanager" class="org.apache.james.mailbox.jpa.openjpa.OpenJPAMailboxManager">
         <constructor-arg index="0" ref="jpa-sessionMapperFactory"/>
-        <constructor-arg index="1" ref="authenticator"/>
-        <constructor-arg index="2" ref="authorizator"/>
-        <constructor-arg index="3" ref="messageParser"/>
-        <constructor-arg index="4" ref="messageIdFactory"/>
-        <constructor-arg index="5" ref="delegating-listener"/>
-        <constructor-arg index="6" ref="storeMailboxAnnotationManager"/>
-        <constructor-arg index="7" ref="storeRightManager" />
-        <property name="quotaManager" ref="quotaManager"/>
-        <property name="quotaRootResolver" ref="quotaRootResolver"/>
-        <property name="quotaUpdater" ref="quotaUpdater"/>
+        <constructor-arg index="1" ref="sessionProvider"/>
+        <constructor-arg index="2" ref="messageParser"/>
+        <constructor-arg index="3" ref="messageIdFactory" />
+        <constructor-arg index="4" ref="delegating-listener" />
+        <constructor-arg index="5" ref="storeMailboxAnnotationManager" />
+        <constructor-arg index="6" ref="storeRightManager" />
+        <constructor-arg index="7" ref="quotaComponents" />
+        <constructor-arg index="8" ref="indexer" />
     </bean>
     
     <bean id ="jpa-subscriptionManager" class="org.apache.james.mailbox.jpa.JPASubscriptionManager">

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml b/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
index e44882b..5896181 100644
--- a/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
+++ b/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
@@ -30,7 +30,7 @@
     <bean id="lazyIndex" class="org.apache.james.mailbox.store.search.LazyMessageSearchIndex">
         <constructor-arg index="0" ref="luceneIndex"/>
         <constructor-arg index="1" ref="messageMapperFactory"/>
-        <constructor-arg index="2" ref="mailboxmanager"/>
+        <constructor-arg index="2" ref="sessionProvider"/>
     </bean>
     <bean id="luceneIndex" class="org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex">
         <constructor-arg index="0" ref="messageMapperFactory"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml b/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
index eb364f3..6980f6d 100644
--- a/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
+++ b/mailbox/maildir/src/main/resources/META-INF/spring/mailbox-maildir.xml
@@ -34,21 +34,21 @@
         <property name ="location" value="classpath:mailbox-maildir.properties"/>
     </bean>
 
-    <bean id="maildir-mailboxmanager" class="org.apache.james.mailbox.store.StoreMailboxManager" init-method="init">
+    <bean id="maildir-mailboxmanager" class="org.apache.james.mailbox.store.StoreMailboxManager">
         <constructor-arg index="0" ref="maildir-sessionMapperFactory"/>
-        <constructor-arg index="1" ref="authenticator"/>
-        <constructor-arg index="2" ref="authorizator"/>
-        <constructor-arg index="3" ref="maildir-locker"/>
-        <constructor-arg index="4" ref="messageParser"/>
-        <constructor-arg index="5" ref="messageIdFactory" />
-        <constructor-arg index="6" ref="storeMailboxAnnotationManager" />
-        <constructor-arg index="7" ref="delegating-listener" />
-        <constructor-arg index="8" ref="storeRightManager" />
-<!--         <property name="messageSearchIndex" ref="lazyIndex"/> -->
-        <property name="quotaManager" ref="quotaManager"/>
-        <property name="quotaRootResolver" ref="quotaRootResolver"/>
-        <property name="quotaUpdater" ref="quotaUpdater"/>
+        <constructor-arg index="1" ref="sessionProvider"/>
+        <constructor-arg index="2" ref="memory-locker"/>
+        <constructor-arg index="3" ref="messageParser"/>
+        <constructor-arg index="4" ref="messageIdFactory" />
+        <constructor-arg index="5" ref="storeMailboxAnnotationManager" />
+        <constructor-arg index="6" ref="delegating-listener" />
+        <constructor-arg index="7" ref="storeRightManager" />
+        <constructor-arg index="8" ref="quotaComponents" />
+        <constructor-arg index="9" ref="indexer" />
+        <constructor-arg index="10" ref="no-mailbox-configuration" />
     </bean>
+
+    <bean id ="no-mailbox-configuration" class="org.apache.james.mailbox.store.MailboxManagerConfiguration.NoMailboxConfiguration"/>
     
     <bean id ="maildir-subscriptionManager" class="org.apache.james.mailbox.store.StoreSubscriptionManager">
         <constructor-arg index="0" ref="maildir-sessionMapperFactory"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml b/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
index db25210..c9b1147 100644
--- a/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
+++ b/mailbox/memory/src/main/resources/META-INF/spring/mailbox-memory.xml
@@ -31,20 +31,17 @@
     <!-- WARNING: Memory does not persist the mailbox. -->
     <!--          Information will be lost after jvm restart. -->
 
-    <bean id="memory-mailboxManager" class="org.apache.james.mailbox.inmemory.InMemoryMailboxManager" init-method="init">
+    <bean id="memory-mailboxManager" class="org.apache.james.mailbox.inmemory.InMemoryMailboxManager">
         <constructor-arg index="0" ref="memory-sessionMapperFactory"/>
-        <constructor-arg index="1" ref="authenticator"/>
-        <constructor-arg index="2" ref="authorizator"/>
-        <constructor-arg index="3" ref="memory-locker"/>
-        <constructor-arg index="4" ref="messageParser"/>
-        <constructor-arg index="5" ref="messageIdFactory" />
-        <constructor-arg index="6" ref="delegating-listener" />
-        <constructor-arg index="7" ref="storeMailboxAnnotationManager" />
-        <constructor-arg index="8" ref="storeRightManager" />
-<!--         <property name="messageSearchIndex" ref="lazyIndex"/> -->
-        <property name="quotaManager" ref="quotaManager"/>
-        <property name="quotaRootResolver" ref="quotaRootResolver"/>
-        <property name="quotaUpdater" ref="quotaUpdater"/>
+        <constructor-arg index="1" ref="sessionProvider"/>
+        <constructor-arg index="2" ref="memory-locker"/>
+        <constructor-arg index="3" ref="messageParser"/>
+        <constructor-arg index="4" ref="messageIdFactory" />
+        <constructor-arg index="5" ref="delegating-listener" />
+        <constructor-arg index="6" ref="storeMailboxAnnotationManager" />
+        <constructor-arg index="7" ref="storeRightManager" />
+        <constructor-arg index="8" ref="quotaComponents" />
+        <constructor-arg index="9" ref="indexer" />
     </bean>
 
     <bean id ="memory-subscriptionManager" class="org.apache.james.mailbox.store.StoreSubscriptionManager">

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/MailboxInitializer.java
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/MailboxInitializer.java b/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/MailboxInitializer.java
new file mode 100644
index 0000000..9527a4a
--- /dev/null
+++ b/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/MailboxInitializer.java
@@ -0,0 +1,71 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailbox.spring;
+
+import javax.inject.Inject;
+
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
+import org.apache.james.mailbox.store.SessionProvider;
+import org.apache.james.mailbox.store.event.DelegatingMailboxListener;
+import org.apache.james.mailbox.store.event.MailboxAnnotationListener;
+import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
+import org.apache.james.mailbox.store.quota.QuotaUpdater;
+import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
+import org.apache.james.mailbox.store.search.MessageSearchIndex;
+
+public class MailboxInitializer {
+    private final SessionProvider sessionProvider;
+    private final DelegatingMailboxListener delegatingMailboxListener;
+    private final MessageSearchIndex messageSearchIndex;
+    private final QuotaUpdater quotaUpdater;
+    private final MailboxManager mailboxManager;
+    private final MailboxSessionMapperFactory mapperFactory;
+
+    @Inject
+    public MailboxInitializer(SessionProvider sessionProvider, DelegatingMailboxListener delegatingMailboxListener, MessageSearchIndex messageSearchIndex, QuotaUpdater quotaUpdater, MailboxManager mailboxManager, MailboxSessionMapperFactory mapperFactory) {
+        this.sessionProvider = sessionProvider;
+        this.delegatingMailboxListener = delegatingMailboxListener;
+        this.messageSearchIndex = messageSearchIndex;
+        this.quotaUpdater = quotaUpdater;
+        this.mailboxManager = mailboxManager;
+        this.mapperFactory = mapperFactory;
+    }
+
+    public void init() throws MailboxException {
+        MailboxSession session = sessionProvider.createSystemSession("admin");
+
+        if (messageSearchIndex instanceof ListeningMessageSearchIndex) {
+            ListeningMessageSearchIndex index = (ListeningMessageSearchIndex) messageSearchIndex;
+            delegatingMailboxListener.addGlobalListener(index, session);
+        }
+
+        if (quotaUpdater instanceof ListeningCurrentQuotaUpdater) {
+            ListeningCurrentQuotaUpdater listeningCurrentQuotaUpdater = (ListeningCurrentQuotaUpdater) quotaUpdater;
+            delegatingMailboxListener.addGlobalListener(listeningCurrentQuotaUpdater, session);
+        }
+
+        if (mailboxManager.getSupportedMailboxCapabilities().contains(MailboxManager.MailboxCapabilities.Annotation)) {
+            delegatingMailboxListener.addGlobalListener(new MailboxAnnotationListener(mapperFactory, sessionProvider), session);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/SpringMailbox.java
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/SpringMailbox.java b/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/SpringMailbox.java
index f68871a..36c63b4 100644
--- a/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/SpringMailbox.java
+++ b/mailbox/spring/src/main/java/org/apache/james/mailbox/spring/SpringMailbox.java
@@ -28,7 +28,8 @@ public class SpringMailbox {
     public SpringMailbox() {
         applicationContext = new ClassPathXmlApplicationContext("META-INF/spring/spring-mailbox.xml",
             "META-INF/spring/mailbox-authenticator-anonymous.xml", "META-INF/spring/mailbox-no-authorizator.xml", "META-INF/spring/quota.xml",
-            "META-INF/spring/quota-alias.xml", "META-INF/spring/event-system.xml", "META-INF/spring/metrics.xml");
+            "META-INF/spring/quota-alias.xml","META-INF/spring/mailbox-index-lucene-test.xml", "META-INF/spring/event-system.xml",
+            "META-INF/spring/metrics.xml");
     }
     
     public Object getBean(String beanName) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/main/resources/META-INF/spring/event-system.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/resources/META-INF/spring/event-system.xml b/mailbox/spring/src/main/resources/META-INF/spring/event-system.xml
index 17661cb..f21a0b7 100644
--- a/mailbox/spring/src/main/resources/META-INF/spring/event-system.xml
+++ b/mailbox/spring/src/main/resources/META-INF/spring/event-system.xml
@@ -23,7 +23,7 @@
        xsi:schemaLocation="
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-    <bean id="default-delegating-listener" class="org.apache.james.mailbox.store.event.DefaultDelegatingMailboxListener" lazy-init="true">
+    <bean id="delegating-listener" class="org.apache.james.mailbox.store.event.DefaultDelegatingMailboxListener" lazy-init="true">
         <constructor-arg index="0" ref="event-delivery"/>
         <constructor-arg index="1" ref="event-registry"/>
     </bean>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/main/resources/META-INF/spring/quota.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/resources/META-INF/spring/quota.xml b/mailbox/spring/src/main/resources/META-INF/spring/quota.xml
index a284b14..9cb5a2c 100644
--- a/mailbox/spring/src/main/resources/META-INF/spring/quota.xml
+++ b/mailbox/spring/src/main/resources/META-INF/spring/quota.xml
@@ -26,7 +26,7 @@
         <constructor-arg index="0" ref="entityManagerFactory" />
     </bean>
     <bean id="defaultQuotaRootResolver" class="org.apache.james.mailbox.store.quota.DefaultUserQuotaRootResolver" lazy-init="true">
-        <constructor-arg index="0" ref="mailboxmanager"/>
+        <constructor-arg index="0" ref="sessionProvider"/>
         <constructor-arg index="1" ref="messageMapperFactory"/>
     </bean>
 
@@ -37,7 +37,7 @@
 
     <bean id="inMemoryCurrentQuotaManager" class="org.apache.james.mailbox.inmemory.quota.InMemoryCurrentQuotaManager" lazy-init="true">
         <constructor-arg index="0" ref="currentQuotaCalculator"/>
-        <constructor-arg index="1" ref="mailboxmanager"/>
+        <constructor-arg index="1" ref="sessionProvider"/>
     </bean>
 
     <bean id="noMaxQuotaManager" class="org.apache.james.mailbox.store.quota.NoMaxQuotaManager" lazy-init="true"/>
@@ -58,4 +58,11 @@
         <constructor-arg index="3" ref="storeQuotaManager"/>
     </bean>
 
+    <bean id="quotaComponents" class="org.apache.james.mailbox.store.quota.QuotaComponents">
+        <constructor-arg index="0" ref="maxQuotaManager"/>
+        <constructor-arg index="1" ref="quotaManager"/>
+        <constructor-arg index="2" ref="quotaRootResolver"/>
+        <constructor-arg index="3" ref="quotaUpdater"/>
+    </bean>
+
 </beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml b/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
index b7ae58a..bedb91a 100644
--- a/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
+++ b/mailbox/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
@@ -66,6 +66,18 @@
         <constructor-arg index="3" ref="delegating-listener" />
     </bean>
 
-    <alias name="default-delegating-listener" alias="delegating-listener"/>
+    <bean id="sessionProvider" class="org.apache.james.mailbox.store.SessionProvider" >
+        <constructor-arg index="0" ref="authenticator" />
+        <constructor-arg index="1" ref="authorizator" />
+    </bean>
+
+    <bean id="mailbox-init" class="org.apache.james.mailbox.spring.MailboxInitializer" init-method="init">
+        <constructor-arg index="0" ref="sessionProvider" />
+        <constructor-arg index="1" ref="delegating-listener" />
+        <constructor-arg index="2" ref="indexer" />
+        <constructor-arg index="3" ref="quotaUpdater" />
+        <constructor-arg index="4" ref="mailboxmanager" />
+        <constructor-arg index="5" ref="messageMapperFactory" />
+    </bean>
 
 </beans>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene-test.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene-test.xml b/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene-test.xml
new file mode 100644
index 0000000..bf7036e
--- /dev/null
+++ b/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene-test.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.    
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans" 
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <!-- 
+      Mailbox Lucene
+     -->
+
+    <bean id="luceneIndex" class="org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex">
+        <constructor-arg index="0" ref="messageMapperFactory"/>
+        <constructor-arg index="1" ref="mailboxIdFactory"/>
+        <constructor-arg index="2" type="org.apache.lucene.store.Directory" ref="fsDirectory"/>
+        <constructor-arg index="3" ref="messageIdFactory"/>
+        <constructor-arg index="4" ref="sessionProvider"/>
+        <property name="enableSuffixMatch" value="true"/>
+    </bean>
+    <bean id="fsDirectory"  class="org.apache.lucene.store.FSDirectory" factory-method="open">
+        <constructor-arg index="0" value="../var/store/lucene"/>
+    </bean>
+    <alias name="jpa-mailboxIdFactory" alias="mailboxIdFactory"/>
+    <alias name="jpa-mailboxmanager" alias="mailboxmanager"/>
+    <alias name="luceneIndex" alias="indexer"/>
+</beans>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml b/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
deleted file mode 100644
index 5cf7f8e..0000000
--- a/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.    
--->
-
-<beans xmlns="http://www.springframework.org/schema/beans" 
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-    <!-- 
-      Mailbox Lucene
-     -->
-
-    <bean id="lazyIndex" class="org.apache.james.mailbox.store.search.LazyMessageSearchIndex">
-        <constructor-arg index="0" ref="luceneIndex"/>
-        <constructor-arg index="1" ref="messageMapperFactory"/>
-        <constructor-arg index="2" ref="mailboxmanager"/>
-    </bean>
-    <bean id="luceneIndex" class="org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex">
-        <constructor-arg index="0" ref="messageMapperFactory"/>
-        <constructor-arg index="1" ref="mailboxIdFactory"/>
-        <constructor-arg index="2" type="org.apache.lucene.store.Directory" ref="fsDirectory"/>
-        <constructor-arg index="3" ref="messageIdFactory"/>
-        <constructor-arg index="4" ref="mailboxmanager"/>
-        <property name="enableSuffixMatch" value="true"/>
-    </bean>
-    <bean id="fsDirectory"  class="org.apache.lucene.store.FSDirectory" factory-method="open">
-        <constructor-arg index="0" value="../var/store/lucene"/>
-    </bean>
-    <alias name="jpa-mailboxIdFactory" alias="mailboxIdFactory"/>
-    <alias name="jpa-mailboxmanager" alias="mailboxmanager"/>
-</beans>

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxManagerConfiguration.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxManagerConfiguration.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxManagerConfiguration.java
index 2f12b06..5a7e5ba 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxManagerConfiguration.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MailboxManagerConfiguration.java
@@ -24,6 +24,14 @@ import javax.inject.Inject;
 public class MailboxManagerConfiguration {
     public static final MailboxManagerConfiguration DEFAULT = new MailboxManagerConfiguration(BatchSizes.defaultValues());
 
+    static class NoMailboxConfiguration extends MailboxManagerConfiguration {
+        // Spring hack
+
+        public NoMailboxConfiguration() {
+            super(BatchSizes.defaultValues());
+        }
+    }
+
     private final BatchSizes batchSizes;
 
     @Inject

http://git-wip-us.apache.org/repos/asf/james-project/blob/367c5aca/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
----------------------------------------------------------------------
diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 5ff4917..f060891 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
@@ -58,7 +58,6 @@ public class JamesSpringContextTest {
         DefaultDelegatingMailboxListener mailboxListener = context.getBean(DefaultDelegatingMailboxListener.class);
 
         assertThat(mailboxListener.getRegistry().getGlobalListeners())
-            .hasSize(2)
             .areExactly(ONCE, QUOTA_UPDATER_LISTENER);
     }
 


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