JAMES-1838 Adding MPT tests
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/a06c9fa3 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/a06c9fa3 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/a06c9fa3 Branch: refs/heads/master Commit: a06c9fa3ca8a609d58659f8bb33f72ba736a5502 Parents: 0e1c37b Author: Benoit Tellier <[email protected]> Authored: Thu Oct 20 16:53:31 2016 +0200 Committer: Benoit Tellier <[email protected]> Committed: Fri Oct 21 17:01:16 2016 +0200 ---------------------------------------------------------------------- .../james/mpt/imapmailbox/suite/Security.java | 5 ++ .../james/imap/scripts/SharedMailbox.test | 50 ++++++++++++++++++++ 2 files changed, 55 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/a06c9fa3/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java ---------------------------------------------------------------------- diff --git a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java index a8c0a16..ae93fe6 100644 --- a/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java +++ b/mpt/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/Security.java @@ -37,6 +37,11 @@ public class Security extends BaseImapProtocol { } @Test + public void accessingOtherPeopleNamespaceShouldBeDenied() throws Exception { + scriptTest("SharedMailbox", Locale.US); + } + + @Test public void testLoginThreeStrikesUS() throws Exception { scriptTest("LoginThreeStrikes", Locale.US); } http://git-wip-us.apache.org/repos/asf/james-project/blob/a06c9fa3/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test ---------------------------------------------------------------------- diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test new file mode 100644 index 0000000..c86a900 --- /dev/null +++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SharedMailbox.test @@ -0,0 +1,50 @@ +################################################################ +# 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. # +################################################################ + +S: \* OK IMAP4rev1 Server ready + +C: a001 LOGIN imapuser password +S: a001 OK LOGIN completed. + +C: a002 CREATE test +S: a002 OK CREATE completed. + +C: a003 CREATE #private.test2 +S: a003 OK CREATE completed. + +C: a004 CREATE #private.other.test3 +S: a004 OK CREATE completed. + +C: a005 CREATE #any.hello +S: a005 NO CREATE You can not access a mailbox that does not belong to you + +C: a006 LIST "" % +SUB { +S: \* LIST \(\\HasNoChildren\) \".\" \"INBOX\" +S: \* LIST \(\\HasChildren\) \".\" \"other\" +S: \* LIST \(\\HasNoChildren\) \".\" \"test\" +S: \* LIST \(\\HasNoChildren\) \".\" \"test2\" +} +S: a006 OK LIST completed. + +C: a006 LIST "" other.% +SUB { +S: \* LIST \(\\HasNoChildren\) \".\" \"other.test3\" +} +S: a006 OK LIST completed. \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
