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 13:42:10 UTC

svn commit: r1052882 - /james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java

Author: eric
Date: Sun Dec 26 12:42:09 2010
New Revision: 1052882

URL: http://svn.apache.org/viewvc?rev=1052882&view=rev
Log:
Add utility private method and javadoc.

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

Modified: 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=1052882&r1=1052881&r2=1052882&view=diff
==============================================================================
--- james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java (original)
+++ james/mailbox/trunk/maildir/src/test/java/org/apache/james/mailbox/functional/maildir/MaildirMailboxManagerTest.java Sun Dec 26 12:42:09 2010
@@ -48,7 +48,7 @@ public class MaildirMailboxManagerTest e
      */
     @Before
     public void setup() throws Exception {
-        FileUtils.deleteDirectory(new File(MAILDIR_HOME));
+        deleteMaildirTestDirectory();
     }
     
     /**
@@ -58,7 +58,7 @@ public class MaildirMailboxManagerTest e
      */
     @After
     public void tearDown() throws IOException {
-        FileUtils.deleteDirectory(new File(MAILDIR_HOME));
+        deleteMaildirTestDirectory();
     }
 
     /* (non-Javadoc)
@@ -73,14 +73,24 @@ public class MaildirMailboxManagerTest e
 
             doTestListWithMaildirStoreConfiguration("/%domain/%user");
             
-            // TODO Tests fail with /%user and /%fulluser configuration
-//            doTestListWithMaildirStoreConfiguration("/%user");
-//            doTestListWithMaildirStoreConfiguration("/%fulluser");
+            // TODO Tests fail with /%user configuration
+            // doTestListWithMaildirStoreConfiguration("/%user");
+
+            // TODO Tests fail with /%fulluser configuration
+            // doTestListWithMaildirStoreConfiguration("/%fulluser");
 
         }
             
     }
     
+    /**
+     * Create the maildirStore with the provided configuration and executes the list() tests.
+     * Cleans the generated artifacts.
+     * 
+     * @param maildirStoreConfiguration
+     * @throws MailboxException
+     * @throws UnsupportedEncodingException
+     */
     private void doTestListWithMaildirStoreConfiguration(String maildirStoreConfiguration) throws MailboxException, UnsupportedEncodingException {
         MaildirStore store = new MaildirStore(MAILDIR_HOME + maildirStoreConfiguration);
         MaildirMailboxSessionMapperFactory mf = new MaildirMailboxSessionMapperFactory(store);
@@ -89,16 +99,28 @@ public class MaildirMailboxManagerTest e
         setMailboxManager(manager);
         super.testList();
         try {
-            tearDown();
+            deleteMaildirTestDirectory();
         } catch (IOException e) {
             Assert.fail();
             e.printStackTrace();
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.james.mailbox.MailboxManagerTest#createMailboxManager()
+     */
     @Override
     protected void createMailboxManager() {
         // Do nothing, the maildir mailboxManager is created in the test method.
     }
+   
+    /**
+     * Utility method to delete the test Maildir Directory.
+     * 
+     * @throws IOException
+     */
+    private void deleteMaildirTestDirectory() throws IOException {
+        FileUtils.deleteDirectory(new File(MAILDIR_HOME));
+    }
 
 }



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