james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1687805 - in /james/mpt/trunk/impl/imap-mailbox: core/src/main/java/org/apache/james/mpt/imapmailbox/ core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ cyrus/sr...
Date Fri, 26 Jun 2015 16:23:26 GMT
Author: btellier
Date: Fri Jun 26 16:23:25 2015
New Revision: 1687805

URL: http://svn.apache.org/r1687805
Log:
MPT-14 ACL integration tests : APPEND

Added:
    james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/MailboxMessageAppender.java
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightI.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIS.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIT.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIW.test
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightI.test
    james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/MailboxMessageAppenderOnCyrusHost.java
Modified:
    james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
    james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusMailboxTestModule.java

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/MailboxMessageAppender.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/MailboxMessageAppender.java?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/MailboxMessageAppender.java
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/MailboxMessageAppender.java
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,28 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.mailbox.model.MailboxPath;
+
+public interface MailboxMessageAppender {
+
+    void fillMailbox(MailboxPath mailbox);
+
+}

Modified: james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java?rev=1687805&r1=1687804&r2=1687805&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
(original)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ACLIntegration.java
Fri Jun 26 16:23:25 2015
@@ -128,4 +128,34 @@ public class ACLIntegration extends Base
         scriptTest("aclIntegration/ACLIntegrationWithoutRightE", Locale.US);
     }
 
+    @Test
+    public void rightIShouldBeSufficientToPerformAppendUS() throws Exception {
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("ri"));
+        scriptTest("aclIntegration/ACLIntegrationRightI", Locale.US);
+    }
+
+    @Test
+    public void rightIShouldBeNeededToPerformAppendUS() throws Exception {
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("rswepxtcdlak"));
+        scriptTest("aclIntegration/ACLIntegrationWithoutRightI", Locale.US);
+    }
+
+    @Test
+    public void rightISShouldBeSufficientToPerformAppendOfSeenMessageUS() throws Exception
{
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("ris"));
+        scriptTest("aclIntegration/ACLIntegrationRightIS", Locale.US);
+    }
+
+    @Test
+    public void rightITShouldBeSufficientToPerformAppendOfDeletedMessageUS() throws Exception
{
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("rit"));
+        scriptTest("aclIntegration/ACLIntegrationRightIT", Locale.US);
+    }
+
+    @Test
+    public void rightIWShouldBeSufficientToPerformAppendOfDeletedMessageUS() throws Exception
{
+        grantRightsOnHost.grantRights(OTHER_USER_MAILBOX, USER, new SimpleMailboxACL.Rfc4314Rights("riw"));
+        scriptTest("aclIntegration/ACLIntegrationRightIW", Locale.US);
+    }
+
 }

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightI.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightI.test?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightI.test
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightI.test
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,113 @@
+################################################################
+# 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: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby ri
+S: a001 OK Completed
+
+C: a002 SELECT user.Boby
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* FLAGS \(\\Answered \\Flagged \\Draft \\Deleted \\Seen\)
+S: \* OK \[PERMANENTFLAGS \(\)\] Ok
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UIDNEXT 1\] Ok
+S: \* OK \[HIGHESTMODSEQ 2\] Ok
+S: \* OK \[URLMECH INTERNAL\] Ok
+S: a002 OK \[READ-WRITE\] Completed
+
+C: a003 APPEND user.Boby {310}
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: a003 OK \[APPENDUID .* 1\] Completed
+
+C: a004 APPEND user.Boby (\Seen) {310}
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 2 EXISTS
+S: \* 2 RECENT
+S: a004 OK \[APPENDUID .* 2\] Completed
+
+C: a005 APPEND user.Boby (\Flagged) {310}
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 3 EXISTS
+S: \* 3 RECENT
+S: a005 OK \[APPENDUID .* 3\] Completed
+
+C: a006 APPEND user.Boby (\Deleted) {310}
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 4 EXISTS
+S: \* 4 RECENT
+S: a006 OK \[APPENDUID .* 4\] Completed
+
+# Seen flag behaviour is not RFC compliant
+C: a007 FETCH 1:4 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 2 FETCH \(FLAGS \(\\Recent \\Seen\)\)
+S: \* 3 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 4 FETCH \(FLAGS \(\\Recent\)\)
+S: a007 OK Completed.*
+
+C: a008 CLOSE
+S: a008 OK Completed
+

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIS.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIS.test?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIS.test
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIS.test
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,116 @@
+################################################################
+# 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: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby rsi
+S: a001 OK Completed
+
+C: a002 SELECT user.Boby
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* FLAGS \(\\Answered \\Flagged \\Draft \\Deleted \\Seen\)
+S: \* OK \[PERMANENTFLAGS \(\\Seen\)\] Ok
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UIDNEXT 1\] Ok
+S: \* OK \[HIGHESTMODSEQ 2\] Ok
+S: \* OK \[URLMECH INTERNAL\] Ok
+S: a002 OK \[READ-WRITE\] Completed
+
+C: a003 APPEND user.Boby {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: a003 OK \[APPENDUID .* 1\] Completed
+
+C: a004 APPEND user.Boby (\Seen) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 2 EXISTS
+S: \* 2 RECENT
+S: a004 OK \[APPENDUID .* 2\] Completed
+
+C: a005 APPEND user.Boby (\Flagged) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 3 EXISTS
+S: \* 3 RECENT
+S: a005 OK \[APPENDUID .* 3\] Completed
+
+C: a006 APPEND user.Boby (\Deleted) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 4 EXISTS
+S: \* 4 RECENT
+S: a006 OK \[APPENDUID .* 4\] Completed
+
+C: a007 FETCH 1:4 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 2 FETCH \(FLAGS \(\\Recent \\Seen\)\)
+S: \* 3 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 4 FETCH \(FLAGS \(\\Recent\)\)
+S: a007 OK Completed.*
+
+C: a008 CLOSE
+S: a008 OK Completed
+

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIT.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIT.test?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIT.test
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIT.test
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,117 @@
+################################################################
+# 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: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby ritd
+S: a001 OK Completed
+
+C: a002 SELECT user.Boby
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* FLAGS \(\\Answered \\Flagged \\Draft \\Deleted \\Seen\)
+S: \* OK \[PERMANENTFLAGS \(\\Deleted\)\] Ok
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UIDNEXT 1\] Ok
+S: \* OK \[HIGHESTMODSEQ 2\] Ok
+S: \* OK \[URLMECH INTERNAL\] Ok
+S: a002 OK \[READ-WRITE\] Completed
+
+C: a003 APPEND user.Boby {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: a003 OK \[APPENDUID .* 1\] Completed
+
+C: a004 APPEND user.Boby (\Seen) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 2 EXISTS
+S: \* 2 RECENT
+S: a004 OK \[APPENDUID .* 2\] Completed
+
+C: a005 APPEND user.Boby (\Flagged) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 3 EXISTS
+S: \* 3 RECENT
+S: a005 OK \[APPENDUID .* 3\] Completed
+
+C: a006 APPEND user.Boby (\Deleted) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 4 EXISTS
+S: \* 4 RECENT
+S: a006 OK \[APPENDUID .* 4\] Completed
+
+# Warning, the behaviour of right "t" combined with \Seen flags is not RFC compliant
+C: a007 FETCH 1:4 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 2 FETCH \(FLAGS \(\\Recent \\Seen\)\)
+S: \* 3 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 4 FETCH \(FLAGS \(\\Recent \\Deleted\)\)
+S: a007 OK Completed.*
+
+C: a008 CLOSE
+S: a008 OK Completed
+

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIW.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIW.test?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIW.test
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationRightIW.test
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,117 @@
+################################################################
+# 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: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby rwi
+S: a001 OK Completed
+
+C: a002 SELECT user.Boby
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* FLAGS \(\\Answered \\Flagged \\Draft \\Deleted \\Seen\)
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Draft \\\*\)\] Ok
+S: \* OK \[UIDVALIDITY .*
+S: \* OK \[UIDNEXT 1\] Ok
+S: \* OK \[HIGHESTMODSEQ 2\] Ok
+S: \* OK \[URLMECH INTERNAL\] Ok
+S: a002 OK \[READ-WRITE\] Completed
+
+C: a003 APPEND user.Boby {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: a003 OK \[APPENDUID .* 1\] Completed
+
+C: a004 APPEND user.Boby (\Seen) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 2 EXISTS
+S: \* 2 RECENT
+S: a004 OK \[APPENDUID .* 2\] Completed
+
+C: a005 APPEND user.Boby (\Flagged) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 3 EXISTS
+S: \* 3 RECENT
+S: a005 OK \[APPENDUID .* 3\] Completed
+
+C: a006 APPEND user.Boby (\Deleted) {310}
+# Use command continuation request
+S: \+ go ahead
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <foobar@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B27397-0100000@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 4 EXISTS
+S: \* 4 RECENT
+S: a006 OK \[APPENDUID .* 4\] Completed
+
+# Warning, the behaviour of right "t" combined with \Seen flags is not RFC compliant
+C: a007 FETCH 1:4 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: \* 2 FETCH \(FLAGS \(\\Recent \\Seen\)\)
+S: \* 3 FETCH \(FLAGS \(\\Recent \\Flagged\)\)
+S: \* 4 FETCH \(FLAGS \(\\Recent\)\)
+S: a007 OK Completed.*
+
+C: a008 CLOSE
+S: a008 OK Completed
+

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightI.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightI.test?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightI.test
(added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/aclIntegration/ACLIntegrationWithoutRightI.test
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,29 @@
+################################################################
+# 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: a000 LOGIN imapuser password
+S: \* OK IMAP4rev1 Server ready
+S: a000 OK .*
+
+C: a001 MYRIGHTS user.Boby
+S: \* MYRIGHTS user.Boby lrswpkxtecda
+S: a001 OK Completed
+
+C: a002 APPEND user.Boby {310}
+S: a002 NO Permission denied
\ No newline at end of file

Modified: james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusMailboxTestModule.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusMailboxTestModule.java?rev=1687805&r1=1687804&r2=1687805&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusMailboxTestModule.java
(original)
+++ james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/CyrusMailboxTestModule.java
Fri Jun 26 16:23:25 2015
@@ -5,6 +5,7 @@ import org.apache.james.mpt.api.ImapHost
 import org.apache.james.mpt.api.UserAdder;
 import org.apache.james.mpt.host.ExternalHostSystem;
 import org.apache.james.mpt.imapmailbox.GrantRightsOnHost;
+import org.apache.james.mpt.imapmailbox.MailboxMessageAppender;
 import org.apache.james.mpt.imapmailbox.cyrus.host.CyrusHostSystem;
 import org.apache.james.mpt.imapmailbox.cyrus.host.CyrusUserAdder;
 import org.apache.james.mpt.imapmailbox.cyrus.host.Docker;
@@ -12,6 +13,7 @@ import org.apache.james.mpt.imapmailbox.
 import com.google.inject.AbstractModule;
 import com.spotify.docker.client.messages.ContainerCreation;
 import org.apache.james.mpt.imapmailbox.cyrus.host.GrantRightsOnCyrusHost;
+import org.apache.james.mpt.imapmailbox.cyrus.host.MailboxMessageAppenderOnCyrusHost;
 
 public class CyrusMailboxTestModule extends AbstractModule {
 
@@ -24,5 +26,6 @@ public class CyrusMailboxTestModule exte
         bind(ExternalHostSystem.class).to(CyrusHostSystem.class);
         bind(UserAdder.class).to(CyrusUserAdder.class);
         bind(GrantRightsOnHost.class).to(GrantRightsOnCyrusHost.class);
+        bind(MailboxMessageAppender.class).to(MailboxMessageAppenderOnCyrusHost.class);
     }
 }

Added: james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/MailboxMessageAppenderOnCyrusHost.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/MailboxMessageAppenderOnCyrusHost.java?rev=1687805&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/MailboxMessageAppenderOnCyrusHost.java
(added)
+++ james/mpt/trunk/impl/imap-mailbox/cyrus/src/test/java/org/apache/james/mpt/imapmailbox/cyrus/host/MailboxMessageAppenderOnCyrusHost.java
Fri Jun 26 16:23:25 2015
@@ -0,0 +1,65 @@
+/****************************************************************
+ * 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.cyrus.host;
+
+import com.google.inject.Inject;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mpt.imapmailbox.MailboxMessageAppender;
+import org.apache.james.mpt.protocol.ProtocolSession;
+
+public class MailboxMessageAppenderOnCyrusHost implements MailboxMessageAppender {
+    private static String LOCATION = "cyrus.MailboxMessageProviderOnCyrusHost";
+
+    private CyrusHostSystem hostSystem;
+
+    @Inject
+    private MailboxMessageAppenderOnCyrusHost(CyrusHostSystem hostSystem) {
+        this.hostSystem = hostSystem;
+    }
+
+    public void fillMailbox(MailboxPath mailboxPath) {
+        String mailboxName = hostSystem.createMailboxStringFromMailboxPath(mailboxPath);
+        ProtocolSession protocolSession = hostSystem.logAndGetAdminProtocolSession(new ProtocolSession());
+        protocolSession.CL(String.format("a001 SETACL %s %s %s", mailboxName, "cyrus", "lrswipkxtecda"));
+        protocolSession.SL("a001 OK .*", LOCATION);
+        appendMessage(protocolSession, "a002", mailboxName, "");
+        appendMessage(protocolSession, "a003", mailboxName, "\\Seen");
+        appendMessage(protocolSession, "a004", mailboxName, "\\Flagged");
+        appendMessage(protocolSession, "a005", mailboxName, "\\Deleted");
+        hostSystem.executeProtocolSession(hostSystem.logoutAndGetProtocolSession(protocolSession));
+    }
+
+    private void appendMessage(ProtocolSession protocolSession, String commandId, String
mailbox,  String flagString) {
+        protocolSession.CL(String.format("%s APPEND %s (%s) {310}", commandId, mailbox, flagString));
+        protocolSession.SL("\\+ go ahead", LOCATION);
+        protocolSession.CL("Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)");
+        protocolSession.CL("From: Fred Foobar <foobar@Blurdybloop.COM>");
+        protocolSession.CL("Subject: afternoon meeting 2");
+        protocolSession.CL("To: mooch@owatagu.siam.edu");
+        protocolSession.CL("Message-Id: <B27397-0100000@Blurdybloop.COM>");
+        protocolSession.CL("MIME-Version: 1.0");
+        protocolSession.CL("Content-Type: TEXT/PLAIN; CHARSET=US-ASCII");
+        protocolSession.CL("");
+        protocolSession.CL("Hello Joe, could we change that to 4:00pm tomorrow?");
+        protocolSession.CL("");
+        protocolSession.SL(String.format("%s OK.*", commandId), LOCATION);
+    }
+
+}



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