james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1147371 - /james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
Date Sat, 16 Jul 2011 07:33:13 GMT
Author: eric
Date: Sat Jul 16 07:33:12 2011
New Revision: 1147371

URL: http://svn.apache.org/viewvc?rev=1147371&view=rev
Log:
Add needed guards for maildir mailboxmanager tests (MAILBOX-73)

Modified:
    james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java

Modified: james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java?rev=1147371&r1=1147370&r2=1147371&view=diff
==============================================================================
--- james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
(original)
+++ james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/maildir/MaildirMailboxManagerTest.java
Sat Jul 16 07:33:12 2011
@@ -29,6 +29,7 @@ import java.util.Date;
 import javax.mail.Flags;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.james.mailbox.BadCredentialsException;
 import org.apache.james.mailbox.MailboxConstants;
 import org.apache.james.mailbox.MailboxException;
 import org.apache.james.mailbox.MailboxExistsException;
@@ -78,9 +79,10 @@ public class MaildirMailboxManagerTest e
     }
 
     /* (non-Javadoc)
-     * @see org.apache.james.mailbox.MailboxManagerTest#testList()
+     * @see org.apache.james.mailbox.AbastractMailboxManagerTest#testList()
      */
     @Test
+    @Override
     public void testList() throws MailboxException, UnsupportedEncodingException {
         
         if (OsDetector.isWindows()) {
@@ -103,6 +105,37 @@ public class MaildirMailboxManagerTest e
             
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.james.mailbox.AbastractMailboxManagerTest#testBasicOperations()
+     */
+    @Test
+    @Override
+    public void testBasicOperations() throws BadCredentialsException, MailboxException, UnsupportedEncodingException
{
+        
+        if (OsDetector.isWindows()) {
+            System.out.println("Maildir tests work only on non-windows systems. So skip the
test");
+        } else {
+
+            MaildirStore store = new MaildirStore(MAILDIR_HOME + "/%domain/%user", new JVMMailboxPathLocker());
+            MaildirMailboxSessionMapperFactory mf = new MaildirMailboxSessionMapperFactory(store);
+            StoreMailboxManager<Integer> manager = new StoreMailboxManager<Integer>(mf,
null, new JVMMailboxPathLocker());
+            manager.init();
+            setMailboxManager(manager);
+            try {
+                super.testBasicOperations();
+            } finally {
+                try {
+                    deleteMaildirTestDirectory();
+                } catch (IOException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+       
+        }
+
+    }
+
     // See MAILBOX-31
     @Test
     public void testCreateSubFolder() throws MailboxException {



---------------------------------------------------------------------
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