IMAP-370 Add MPT checks for MOVE command

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/7958d56f
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/7958d56f
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/7958d56f

Branch: refs/heads/master
Commit: 7958d56f2eab83795fb9367fe1019f6d05ea9e3c
Parents: 53755c7
Author: Benoit Tellier <btell...@linagora.com>
Authored: Thu Feb 25 10:26:29 2016 +0700
Committer: Benoit Tellier <btell...@linagora.com>
Committed: Fri Mar 4 19:35:24 2016 +0700

----------------------------------------------------------------------
 .../cassandra/CassandraMailboxTest.java         |  4 +-
 .../james/mpt/imapmailbox/suite/Move.java       | 44 +++++++++++++
 .../org/apache/james/imap/scripts/Move.test     | 69 ++++++++++++++++++++
 3 files changed, 116 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/7958d56f/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
 
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
index da7ce09..643c9c6 100644
--- 
a/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
+++ 
b/mpt/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
@@ -28,6 +28,7 @@ import 
org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
 import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
 import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
 import org.apache.james.mpt.imapmailbox.suite.Listing;
+import org.apache.james.mpt.imapmailbox.suite.Move;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
 import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
@@ -65,7 +66,8 @@ import org.junit.runners.Suite;
     SelectedState.class,
     UidSearch.class,
     UserFlagsSupport.class,
-    QuotaTest.class
+    QuotaTest.class,
+    Move.class
 })
 @GuiceModules({ CassandraMailboxTestModule.class })
 public class CassandraMailboxTest {

http://git-wip-us.apache.org/repos/asf/james-project/blob/7958d56f/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
 
b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
new file mode 100644
index 0000000..489b148
--- /dev/null
+++ 
b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Move.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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.mpt.imapmailbox.suite;
+
+import java.util.Locale;
+
+import javax.inject.Inject;
+
+import org.apache.james.mpt.api.HostSystem;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
+import org.junit.Test;
+
+public class Move  extends BaseSelectedState {
+
+    @Inject
+    private static HostSystem system;
+
+    public Move() throws Exception {
+        super(system);
+    }
+
+    @Test
+    public void moveShouldWork() throws Exception {
+        scriptTest("Move", Locale.US);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/7958d56f/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
----------------------------------------------------------------------
diff --git 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
new file mode 100644
index 0000000..ade2415
--- /dev/null
+++ 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Move.test
@@ -0,0 +1,69 @@
+################################################################
+# 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: a1 CREATE moved
+S: a1 OK CREATE completed.
+
+C: a2 STATUS moved (MESSAGES)
+S: \* STATUS "moved" \(MESSAGES 0\)
+S: a2 OK STATUS completed.
+
+# mark one message as deleted before moving it (to check that flags are moved)
+C: a3 STORE 3 FLAGS (\Deleted)
+S: \* 3 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: a3 OK STORE completed.
+
+# Check there's 4 messages in the selected mailbox
+C: a5 STATUS selected (MESSAGES)
+S: \* STATUS "selected" \(MESSAGES 4\)
+S: a5 OK STATUS completed.
+
+# move messages 2-3
+C: a4 MOVE 2:3 moved
+S: \* 2 EXPUNGE
+S: \* 2 EXPUNGE
+S: a4 OK (\[.+\] )?MOVE completed.
+
+# Check there's 2 messages in the moved mailbox
+C: a5 STATUS moved (MESSAGES)
+S: \* STATUS "moved" \(MESSAGES 2\)
+S: a5 OK STATUS completed.
+
+# Check there's 2 messages in the selected mailbox
+C: a5 STATUS selected (MESSAGES)
+S: \* STATUS "selected" \(MESSAGES 2\)
+S: a5 OK STATUS completed.
+
+C: a7 SELECT moved
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 2 EXISTS
+S: \* \d+ RECENT
+S: \* OK \[UIDVALIDITY \d+\].*
+S: \* OK \[UNSEEN \d+\].*
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\\Seen( 
\\\*)?\)\].*
+S: \* OK \[HIGHESTMODSEQ \d+\].*
+S: \* OK \[UIDNEXT \d+\].*
+S: a7 OK \[READ-WRITE\] SELECT completed.
+
+C: a8 FETCH 1:2 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 2 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: a8 OK FETCH completed.
+
+C: a9 DELETE moved
+S: a9 OK DELETE completed.


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

Reply via email to