JAMES-1746 Removing redoundant test for in memory implementation
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/311d63a5 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/311d63a5 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/311d63a5 Branch: refs/heads/JAMES-1746 Commit: 311d63a546dd88f5bd3e772a478559c8f92d679f Parents: 8c08956 Author: Benoit Tellier <btell...@linagora.com> Authored: Tue Jun 7 11:25:44 2016 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Wed Jun 8 17:09:21 2016 +0700 ---------------------------------------------------------------------- .../inmemory/InMemoryMailboxMapperTest.java | 86 -------------------- 1 file changed, 86 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/311d63a5/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java ---------------------------------------------------------------------- diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java deleted file mode 100644 index 043a394..0000000 --- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************** - * 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.mailbox.inmemory; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.apache.james.mailbox.exception.MailboxException; -import org.apache.james.mailbox.mock.MockMailboxSession; -import org.apache.james.mailbox.model.MailboxPath; -import org.apache.james.mailbox.store.mail.MailboxMapper; -import org.apache.james.mailbox.store.mail.model.Mailbox; -import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox; -import org.junit.Before; -import org.junit.Test; - -public class InMemoryMailboxMapperTest { - - public static final int UID_VALIDITY = 10; - - private MailboxPath user1InboxPath; - private MailboxPath user1SubMailbox1Path; - private MailboxPath user1SubMailbox2Path; - private MailboxPath user2OtherBoxPath; - private MailboxPath user1OtherNamespacePath; - - private Mailbox user1Inbox; - private Mailbox user1SubMailbox1; - private Mailbox user1SubMailbox2; - - private MailboxMapper mapper; - - @Before - public void setUp() throws MailboxException { - user1InboxPath = new MailboxPath("#private", "user1", "INBOX"); - user1SubMailbox1Path = new MailboxPath("#private", "user1", "INBOX.sub1"); - user1SubMailbox2Path = new MailboxPath("#private", "user1", "INBOX.sub2"); - user2OtherBoxPath = new MailboxPath("#private", "user2", "other.user"); - user1OtherNamespacePath = new MailboxPath("#namspace", "user1", "other.namespace"); - user1Inbox = new SimpleMailbox(user1InboxPath, UID_VALIDITY); - user1SubMailbox1 = new SimpleMailbox(user1SubMailbox1Path, UID_VALIDITY); - user1SubMailbox2 = new SimpleMailbox(user1SubMailbox2Path, UID_VALIDITY); - mapper = new InMemoryMailboxSessionMapperFactory().createMailboxMapper(new MockMailboxSession("user")); - mapper.save(user1Inbox); - mapper.save(user1SubMailbox1); - mapper.save(user1SubMailbox2); - mapper.save(new SimpleMailbox(user2OtherBoxPath, UID_VALIDITY)); - mapper.save(new SimpleMailbox(user1OtherNamespacePath, UID_VALIDITY)); - } - - @Test - public void findMailboxWithPatchLikeOnAllMaillboxesShouldReturnMailboxesBelongingToThisNamespaceAndUser() throws MailboxException{ - assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "%"))) - .containsOnly(user1Inbox, user1SubMailbox1, user1SubMailbox2); - } - - @Test - public void findMailboxWithPatchLikeBasedOnInboxShouldReturnItsChildren() throws MailboxException{ - assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "INBOX.%"))) - .containsOnly(user1SubMailbox1, user1SubMailbox2); - } - - @Test - public void findMailboxWithPatchLikeBasedOnAStringShouldReturnMailboxesStartingWithThisString() throws MailboxException{ - assertThat(mapper.findMailboxWithPathLike(new MailboxPath("#private", "user1", "IN%"))) - .containsOnly(user1Inbox, user1SubMailbox1, user1SubMailbox2); - } - -} - --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org