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 er...@apache.org on 2010/12/26 14:06:57 UTC

svn commit: r1052885 - in /james/mailbox/trunk/memory: pom.xml src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java

Author: eric
Date: Sun Dec 26 13:06:57 2010
New Revision: 1052885

URL: http://svn.apache.org/viewvc?rev=1052885&view=rev
Log:
Add InMemoryMailboxManagerTest for new list() API.

Added:
    james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
Modified:
    james/mailbox/trunk/memory/pom.xml

Modified: james/mailbox/trunk/memory/pom.xml
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/memory/pom.xml?rev=1052885&r1=1052884&r2=1052885&view=diff
==============================================================================
--- james/mailbox/trunk/memory/pom.xml (original)
+++ james/mailbox/trunk/memory/pom.xml Sun Dec 26 13:06:57 2010
@@ -61,5 +61,11 @@
       <artifactId>apache-james-imap-message</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-james-mailbox-api</artifactId>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
   </dependencies>
 </project>

Added: james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java?rev=1052885&view=auto
==============================================================================
--- james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java (added)
+++ james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java Sun Dec 26 13:06:57 2010
@@ -0,0 +1,75 @@
+/****************************************************************
+ * 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.inmemory;
+
+import org.apache.commons.logging.impl.SimpleLog;
+import org.apache.james.imap.functional.InMemoryUserManager;
+import org.apache.james.mailbox.BadCredentialsException;
+import org.apache.james.mailbox.MailboxException;
+import org.apache.james.mailbox.MailboxManagerTest;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.inmemory.mail.InMemoryCachingUidProvider;
+import org.junit.After;
+import org.junit.Before;
+
+/**
+ * InMemoryMailboxManagerTest that extends the MailboxManagerTest.
+ */
+public class InMemoryMailboxManagerTest extends MailboxManagerTest {
+    
+    /**
+     * Setup the mailboxManager.
+     * 
+     * @throws Exception
+     */
+    @Before
+    public void setup() throws Exception {
+        createMailboxManager();
+    }
+    
+    /**
+     * Close the system session and entityManagerFactory
+     * 
+     * @throws MailboxException 
+     * @throws BadCredentialsException 
+     */
+    @After
+    public void tearDown() throws BadCredentialsException, MailboxException {
+        MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test"));
+        session.close();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.james.mailbox.MailboxManagerTest#createMailboxManager()
+     */
+    @Override
+    protected void createMailboxManager() throws MailboxException {
+        
+        InMemoryUserManager userManager = new InMemoryUserManager();
+        InMemoryMailboxSessionMapperFactory factory = new InMemoryMailboxSessionMapperFactory();
+        InMemoryCachingUidProvider uidProvider = new InMemoryCachingUidProvider();
+        InMemoryMailboxManager mailboxManager = new InMemoryMailboxManager(factory, userManager, uidProvider);
+        mailboxManager.init();
+        
+        setMailboxManager(mailboxManager);
+
+    }
+    
+}
+    
\ No newline at end of file



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