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/24 11:58:54 UTC

svn commit: r1052483 - in /james/mailbox/trunk/maildir: pom.xml src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java

Author: eric
Date: Fri Dec 24 10:58:54 2010
New Revision: 1052483

URL: http://svn.apache.org/viewvc?rev=1052483&view=rev
Log:
Add maildir list() tests.

Added:
    james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java   (with props)
Modified:
    james/mailbox/trunk/maildir/pom.xml

Modified: james/mailbox/trunk/maildir/pom.xml
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/maildir/pom.xml?rev=1052483&r1=1052482&r2=1052483&view=diff
==============================================================================
--- james/mailbox/trunk/maildir/pom.xml (original)
+++ james/mailbox/trunk/maildir/pom.xml Fri Dec 24 10:58:54 2010
@@ -88,6 +88,12 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-james-mailbox-api</artifactId>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit-dep</artifactId>
       <scope>test</scope>

Added: james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java?rev=1052483&view=auto
==============================================================================
--- james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java (added)
+++ james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java Fri Dec 24 10:58:54 2010
@@ -0,0 +1,78 @@
+/****************************************************************
+ * 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.functional.maildir;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.james.mailbox.BadCredentialsException;
+import org.apache.james.mailbox.MailboxException;
+import org.apache.james.mailbox.MailboxManagerTest;
+import org.apache.james.mailbox.maildir.MaildirMailboxManager;
+import org.apache.james.mailbox.maildir.MaildirMailboxSessionMapperFactory;
+import org.apache.james.mailbox.maildir.MaildirStore;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * MaildirMailboxManagerTest that extends the StoreMailboxManagerTest.
+ */
+public class MaildirMailboxManagerTest extends MailboxManagerTest {
+    
+    private static final String MAILDIR_HOME = "target/Maildir";
+
+    /**
+     * Setup the mailboxManager.
+     * 
+     * @throws Exception
+     */
+    @BeforeClass
+    public static void setup() throws Exception {
+        FileUtils.deleteDirectory(new File(MAILDIR_HOME));
+        MaildirStore store = new MaildirStore(MAILDIR_HOME + "/%domain/%user");
+        MaildirMailboxSessionMapperFactory mf = new MaildirMailboxSessionMapperFactory(store);
+        setMailboxManager(new MaildirMailboxManager(mf, null, store));
+    }
+    
+    /**
+     * Close the system session and entityManagerFactory
+     * 
+     * @throws MailboxException 
+     * @throws BadCredentialsException 
+     */
+    @AfterClass
+    public static void tearDown() throws BadCredentialsException, MailboxException {
+//        FileUtils.deleteDirectory(new File(MAILDIR_HOME));
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.james.mailbox.MailboxManagerTest#testList()
+     */
+    @Test
+    public void testList() throws MailboxException, UnsupportedEncodingException {
+        if (OsDetector.isWindows()) {
+            System.out.println("Maildir tests work only on non-windows systems. So skip the test");
+        } else {
+            super.testList();
+        }
+    }
+    
+}

Propchange: james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



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