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 rd...@apache.org on 2008/03/30 21:32:09 UTC

svn commit: r642804 - in /james/server/trunk/experimental-seda-imap-function/src/test: java/org/apache/james/test/functional/ resources/org/apache/james/test/functional/imap/scripts/

Author: rdonkin
Date: Sun Mar 30 12:32:07 2008
New Revision: 642804

URL: http://svn.apache.org/viewvc?rev=642804&view=rev
Log:
Test for renaming mailboxes in a heirarchy

Added:
    james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/RenameHierarchy.test
Modified:
    james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
    james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java

Modified: james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
URL: http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java?rev=642804&r1=642803&r2=642804&view=diff
==============================================================================
--- james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java (original)
+++ james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java Sun Mar 30 12:32:07 2008
@@ -35,7 +35,31 @@
 
     public static final void main(String[] args) throws Exception {
         ScriptBuilder builder = ScriptBuilder.open("localhost", 143);
-        rename(builder);
+        renameHierarchy(builder);
+    }
+    
+    public static void renameHierarchy(ScriptBuilder builder) throws Exception {
+        builder.login();
+        builder.setMailbox("one").create();
+        builder.setMailbox("one.two").create();
+        builder.setMailbox("one.two.three").create();
+        builder.setMailbox("one.two.three.four").create();
+        builder.list();
+        builder.rename("one.two", "alpha.beta");
+        builder.list();
+        builder.rename("alpha.beta.three.four", "alpha.beta.gamma.delta");
+        builder.list();
+        builder.rename("alpha.beta.three", "aleph");
+        builder.list();
+        builder.rename("aleph", "alpha.beta.gamma.delta.epsilon");
+        builder.list();
+        builder.rename("alpha.beta.gamma", "one");
+        builder.list();
+        builder.setMailbox("one").delete();
+        builder.setMailbox("alpha").delete();
+        builder.setMailbox("aleph");
+        builder.list();
+        builder.quit();
     }
     
     public static void rename(ScriptBuilder builder) throws Exception {

Modified: james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
URL: http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java?rev=642804&r1=642803&r2=642804&view=diff
==============================================================================
--- james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java (original)
+++ james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java Sun Mar 30 12:32:07 2008
@@ -430,6 +430,11 @@
         command(command);
     }
     
+    public ScriptBuilder list() throws Exception {
+        command("LIST \"\" \"*\"");
+        return this;
+    }
+    
     public void fetch() throws Exception {
         final String command = fetch.command(messageNumber);
         command(command);
@@ -1266,6 +1271,9 @@
                     line = StringUtils.replace(line, "OK Fetch completed", "OK FETCH completed");
                     line = StringUtils.replace(line, "OK Append completed", "OK APPEND completed");
                     line = StringUtils.replace(line, "OK Delete completed", "OK DELETE completed");
+                    line = StringUtils.replace(line, "OK Store completed", "OK STORE completed");
+                    line = StringUtils.replace(line, "OK Rename completed", "OK RENAME completed");
+                    line = StringUtils.replace(line, "OK Expunge completed", "OK EXPUNGE completed");
                     line = StringUtils.replace(line, "Select completed", "SELECT completed");
                     line = StringUtils.replace(line, "\\\\Seen \\\\Draft", "\\\\Draft \\\\Seen");
                     line = StringUtils.replace(line, "\\\\Flagged \\\\Deleted", "\\\\Deleted \\\\Flagged");

Added: james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/RenameHierarchy.test
URL: http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/RenameHierarchy.test?rev=642804&view=auto
==============================================================================
--- james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/RenameHierarchy.test (added)
+++ james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/RenameHierarchy.test Sun Mar 30 12:32:07 2008
@@ -0,0 +1,90 @@
+################################################################
+# 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.                                           #
+################################################################
+C: A2 CREATE one
+S: A2 OK CREATE completed\.
+C: A3 CREATE one.two
+S: A3 OK CREATE completed\.
+C: A4 CREATE one.two.three
+S: A4 OK CREATE completed\.
+C: A5 CREATE one.two.three.four
+S: A5 OK CREATE completed\.
+C: A6 LIST "" "*"
+S: \* LIST  "\." "one"
+S: \* LIST "\." "INBOX"
+S: \* LIST  "\." "one\.two"
+S: \* LIST  "\." "one\.two\.three"
+S: \* LIST "\." "one\.two\.three\.four"
+S: A6 OK List completed\.
+C: A7 RENAME one.two alpha.beta
+S: A7 OK RENAME completed\.
+C: A8 LIST "" "*"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST  "\." "alpha\.beta\.three"
+S: \* LIST "\." "alpha\.beta\.three\.four"
+S: \* LIST "\." "one"
+S: \* LIST "\." "INBOX"
+S: A8 OK List completed\.
+C: A9 RENAME alpha.beta.three.four alpha.beta.gamma.delta
+S: A9 OK RENAME completed\.
+C: A10 LIST "" "*"
+S: \* LIST "\." "one"
+S: \* LIST "\." "INBOX"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST "\." "alpha\.beta\.gamma\.delta"
+S: \* LIST "\." "alpha\.beta\.three"
+S: A10 OK List completed\.
+C: A11 RENAME alpha.beta.three aleph
+S: A11 OK RENAME completed\.
+C: A12 LIST "" "*"
+S: \* LIST "\." "one"
+S: \* LIST "\." "aleph"
+S: \* LIST "\." "INBOX"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST "\." "alpha\.beta\.gamma\.delta"
+S: A12 OK List completed\.
+C: A13 RENAME aleph alpha.beta.gamma.delta.epsilon
+S: A13 OK RENAME completed\.
+C: A14 LIST "" "*"
+S: \* LIST "\." "one"
+S: \* LIST "\." "INBOX"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST  "\." "alpha\.beta\.gamma\.delta"
+S: \* LIST "\." "alpha\.beta\.gamma\.delta\.epsilon"
+S: A14 OK List completed\.
+C: A15 RENAME alpha.beta.gamma one
+S: A15 NO Mailbox exists\.
+C: A16 LIST "" "*"
+S: \* LIST "\." "one"
+S: \* LIST "\." "INBOX"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST  "\." "alpha\.beta\.gamma\.delta"
+S: \* LIST "\." "alpha\.beta\.gamma\.delta\.epsilon"
+S: A16 OK List completed\.
+C: A17 DELETE one
+S: A17 OK DELETE completed\.
+C: A18 DELETE alpha
+S: A18 NO Mailbox doesn't exist: alpha
+C: A19 LIST "" "*"
+S: \* LIST  "\." "alpha\.beta"
+S: \* LIST  "\." "alpha\.beta\.gamma\.delta"
+S: \* LIST "\." "alpha\.beta\.gamma\.delta\.epsilon"
+S: \* LIST "\." "INBOX"
+S: A19 OK List completed\.
+C: A20 DELETE aleph
+S: A20 NO Mailbox doesn't exist: aleph



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