http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java index 48bae00..93b0600 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/DeleteACLProcessorTest.java @@ -39,10 +39,8 @@ import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.exception.MailboxNotFoundException; import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxACL.EditMode; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey; +import org.apache.james.mailbox.model.MailboxACL.EntryKey; import org.apache.james.mailbox.model.MailboxPath; -import org.apache.james.mailbox.model.SimpleMailboxACL; -import org.apache.james.mailbox.model.SimpleMailboxACL.SimpleMailboxACLEntryKey; import org.apache.james.metrics.api.NoopMetricFactory; import org.jmock.Expectations; import org.jmock.Mockery; @@ -70,7 +68,7 @@ public class DeleteACLProcessorTest { UnpooledStatusResponseFactory statusResponseFactory; DeleteACLProcessor subject; User user1Stub; - MailboxACLEntryKey user1Key; + EntryKey user1Key; MailboxPath path; private Expectations prepareRightsExpectations() throws MailboxException { @@ -113,7 +111,7 @@ public class DeleteACLProcessorTest { deleteACLRequest = new DeleteACLRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME, USER_1); - user1Key = SimpleMailboxACLEntryKey.deserialize(USER_1); + user1Key = EntryKey.deserialize(USER_1); } @Test @@ -121,7 +119,7 @@ public class DeleteACLProcessorTest { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -144,10 +142,10 @@ public class DeleteACLProcessorTest { public void testNoAdminRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -188,20 +186,20 @@ public class DeleteACLProcessorTest { @Test public void testDelete() throws MailboxException { - final MailboxACL acl = SimpleMailboxACL.OWNER_FULL_ACL; + final MailboxACL acl = MailboxACL.OWNER_FULL_ACL; Expectations expectations = prepareRightsExpectations(); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); expectations.will(Expectations.returnValue(messageManagerStub)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).setRights(expectations.with(path), expectations.with(new SimpleMailboxACL.SimpleMailboxACLCommand(user1Key, EditMode.REPLACE, null)), expectations.with(mailboxSessionStub)); + expectations.allowing(mailboxManagerStub).setRights(expectations.with(path), expectations.with(new MailboxACL.ACLCommand(user1Key, EditMode.REPLACE, null)), expectations.with(mailboxSessionStub)); expectations.allowing(metaDataStub).getACL(); expectations.will(Expectations.returnValue(acl));
http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java index 8a9391f..bf75f0d 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetACLProcessorTest.java @@ -40,7 +40,6 @@ import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.exception.MailboxNotFoundException; import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxPath; -import org.apache.james.mailbox.model.SimpleMailboxACL; import org.apache.james.metrics.api.NoopMetricFactory; import org.jmock.Expectations; import org.jmock.Mockery; @@ -115,7 +114,7 @@ public class GetACLProcessorTest { public void testNoListRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -138,10 +137,10 @@ public class GetACLProcessorTest { public void testNoAdminRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -182,17 +181,17 @@ public class GetACLProcessorTest { @Test public void testSufficientRights() throws Exception { - final MailboxACL acl = SimpleMailboxACL.OWNER_FULL_ACL; + final MailboxACL acl = MailboxACL.OWNER_FULL_ACL; Expectations expectations = prepareRightsExpectations(); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); expectations.will(Expectations.returnValue(messageManagerStub)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java index 8b23543..fadbc3b 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaProcessorTest.java @@ -39,10 +39,10 @@ import org.apache.james.mailbox.MailboxManager; import org.apache.james.mailbox.MailboxSession; import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.mock.MockMailboxSession; +import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxPath; import org.apache.james.mailbox.model.Quota; import org.apache.james.mailbox.model.QuotaRoot; -import org.apache.james.mailbox.model.SimpleMailboxACL; import org.apache.james.mailbox.quota.QuotaManager; import org.apache.james.mailbox.quota.QuotaRootResolver; import org.apache.james.mailbox.store.quota.QuotaImpl; @@ -93,7 +93,7 @@ public class GetQuotaProcessorTest { .thenReturn(QUOTA_ROOT); when(mockedQuotaRootResolver.retrieveAssociatedMailboxes(QUOTA_ROOT, mailboxSession)) .thenReturn(ImmutableList.of(MAILBOX_PATH)); - when(mockedMailboxManager.hasRight(MAILBOX_PATH, SimpleMailboxACL.Right.Read, mailboxSession)) + when(mockedMailboxManager.hasRight(MAILBOX_PATH, MailboxACL.Right.Read, mailboxSession)) .thenReturn(true); when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn(MESSAGE_QUOTA); when(mockedQuotaManager.getStorageQuota(QUOTA_ROOT)).thenReturn(STORAGE_QUOTA); @@ -125,7 +125,7 @@ public class GetQuotaProcessorTest { .thenReturn(QUOTA_ROOT); when(mockedQuotaRootResolver.retrieveAssociatedMailboxes(QUOTA_ROOT, mailboxSession)) .thenReturn(ImmutableList.of(MAILBOX_PATH)); - when(mockedMailboxManager.hasRight(MAILBOX_PATH, SimpleMailboxACL.Right.Read, mailboxSession)) + when(mockedMailboxManager.hasRight(MAILBOX_PATH, MailboxACL.Right.Read, mailboxSession)) .thenReturn(true); when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenThrow(new MailboxException()); when(mockedQuotaManager.getStorageQuota(QUOTA_ROOT)).thenReturn(STORAGE_QUOTA); @@ -152,7 +152,7 @@ public class GetQuotaProcessorTest { .thenReturn(QUOTA_ROOT); when(mockedQuotaRootResolver.retrieveAssociatedMailboxes(QUOTA_ROOT, mailboxSession)) .thenReturn(ImmutableList.of(MAILBOX_PATH)); - when(mockedMailboxManager.hasRight(MAILBOX_PATH, SimpleMailboxACL.Right.Read, mailboxSession)) + when(mockedMailboxManager.hasRight(MAILBOX_PATH, MailboxACL.Right.Read, mailboxSession)) .thenReturn(false); testee.doProcess(getQuotaRequest, mockedResponder, mockedImapSession); http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaRootProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaRootProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaRootProcessorTest.java index ddac3dc..ae7f260 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaRootProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/GetQuotaRootProcessorTest.java @@ -37,7 +37,6 @@ import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxPath; import org.apache.james.mailbox.model.Quota; import org.apache.james.mailbox.model.QuotaRoot; -import org.apache.james.mailbox.model.SimpleMailboxACL; import org.apache.james.mailbox.quota.QuotaManager; import org.apache.james.mailbox.quota.QuotaRootResolver; import org.apache.james.mailbox.store.quota.QuotaImpl; @@ -94,7 +93,7 @@ public class GetQuotaRootProcessorTest { expectations.will(Expectations.returnValue(QUOTA_ROOT)); expectations.allowing(mockedMailboxManager).hasRight(expectations.with(MAILBOX_PATH), - expectations.with((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Read), expectations.with(mailboxSession)); + expectations.with(MailboxACL.Right.Read), expectations.with(mailboxSession)); expectations.will(Expectations.returnValue(true)); expectations.allowing(mockedQuotaManager).getMessageQuota(expectations.with(QUOTA_ROOT)); @@ -137,7 +136,7 @@ public class GetQuotaRootProcessorTest { expectations.will(Expectations.returnValue(mailboxSession)); expectations.allowing(mockedMailboxManager).hasRight(expectations.with(MAILBOX_PATH), - expectations.with((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Read), expectations.with(mailboxSession)); + expectations.with(MailboxACL.Right.Read), expectations.with(mailboxSession)); expectations.will(Expectations.throwException(new MailboxException())); expectations.allowing(mockedMailboxManager).startProcessingRequest(expectations.with(mailboxSession)); @@ -168,7 +167,7 @@ public class GetQuotaRootProcessorTest { expectations.will(Expectations.returnValue(mailboxSession)); expectations.allowing(mockedMailboxManager).hasRight(expectations.with(MAILBOX_PATH), - expectations.with((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Read), expectations.with(mailboxSession)); + expectations.with(MailboxACL.Right.Read), expectations.with(mailboxSession)); expectations.will(Expectations.returnValue(false)); expectations.allowing(mockedMailboxManager).startProcessingRequest(expectations.with(mailboxSession)); http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java index 6b72545..bcbb707 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/ListRightsProcessorTest.java @@ -39,12 +39,9 @@ import org.apache.james.mailbox.MessageManager.MetaData.FetchGroup; import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.exception.MailboxNotFoundException; import org.apache.james.mailbox.model.MailboxACL; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRights; +import org.apache.james.mailbox.model.MailboxACL.EntryKey; +import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights; import org.apache.james.mailbox.model.MailboxPath; -import org.apache.james.mailbox.model.SimpleMailboxACL; -import org.apache.james.mailbox.model.SimpleMailboxACL.Rfc4314Rights; -import org.apache.james.mailbox.model.SimpleMailboxACL.SimpleMailboxACLEntryKey; import org.apache.james.metrics.api.NoopMetricFactory; import org.jmock.Expectations; import org.jmock.Mockery; @@ -72,8 +69,8 @@ public class ListRightsProcessorTest { UnpooledStatusResponseFactory statusResponseFactory; ListRightsProcessor subject; User user1Stub; - MailboxACLEntryKey user1Key; - MailboxACLRights[] listRights; + EntryKey user1Key; + Rfc4314Rights[] listRights; MailboxPath path; private Expectations prepareRightsExpectations() throws MailboxException { @@ -116,15 +113,15 @@ public class ListRightsProcessorTest { listRightsRequest = new ListRightsRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME, USER_1); - user1Key = SimpleMailboxACLEntryKey.deserialize(USER_1); - listRights = new MailboxACLRights[] {new Rfc4314Rights("ae"), new Rfc4314Rights("i"), new Rfc4314Rights("k")}; + user1Key = EntryKey.deserialize(USER_1); + listRights = new Rfc4314Rights[] {new Rfc4314Rights("ae"), new Rfc4314Rights("i"), new Rfc4314Rights("k")}; } @Test public void testNoListRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -147,10 +144,10 @@ public class ListRightsProcessorTest { public void testNoAdminRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -191,17 +188,17 @@ public class ListRightsProcessorTest { @Test public void testListRights() throws MailboxException { - final MailboxACL acl = SimpleMailboxACL.OWNER_FULL_ACL; + final MailboxACL acl = MailboxACL.OWNER_FULL_ACL; Expectations expectations = prepareRightsExpectations(); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); expectations.will(Expectations.returnValue(messageManagerStub)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); expectations.allowing(mailboxManagerStub).listRigths(expectations.with(path), expectations.with(Expectations.equal(user1Key)), expectations.with(Expectations.same(mailboxSessionStub))); http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java index 0c18456..02a9c25 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/SetACLProcessorTest.java @@ -39,12 +39,9 @@ import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.exception.MailboxNotFoundException; import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxACL.EditMode; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRights; +import org.apache.james.mailbox.model.MailboxACL.EntryKey; +import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights; import org.apache.james.mailbox.model.MailboxPath; -import org.apache.james.mailbox.model.SimpleMailboxACL; -import org.apache.james.mailbox.model.SimpleMailboxACL.Rfc4314Rights; -import org.apache.james.mailbox.model.SimpleMailboxACL.SimpleMailboxACLEntryKey; import org.apache.james.metrics.api.NoopMetricFactory; import org.jmock.Expectations; import org.jmock.Mockery; @@ -74,8 +71,8 @@ public class SetACLProcessorTest { UnpooledStatusResponseFactory statusResponseFactory; SetACLProcessor subject; User user1Stub; - MailboxACLEntryKey user1Key; - MailboxACLRights setRights; + EntryKey user1Key; + Rfc4314Rights setRights; MailboxPath path; private Expectations prepareRightsExpectations() throws MailboxException { @@ -118,7 +115,7 @@ public class SetACLProcessorTest { replaceACLRequest = new SetACLRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME, USER_1, SET_RIGHTS); - user1Key = SimpleMailboxACLEntryKey.deserialize(USER_1); + user1Key = EntryKey.deserialize(USER_1); setRights = new Rfc4314Rights(SET_RIGHTS); } @@ -126,7 +123,7 @@ public class SetACLProcessorTest { public void testUnsupportedRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -149,7 +146,7 @@ public class SetACLProcessorTest { public void testNoListRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -172,10 +169,10 @@ public class SetACLProcessorTest { public void testNoAdminRight() throws Exception { Expectations expectations = prepareRightsExpectations(); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(false)); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); @@ -219,20 +216,20 @@ public class SetACLProcessorTest { } private void testOp(String prefix, EditMode editMode) throws MailboxException { - final MailboxACL acl = SimpleMailboxACL.OWNER_FULL_ACL; + final MailboxACL acl = MailboxACL.OWNER_FULL_ACL; Expectations expectations = prepareRightsExpectations(); expectations.allowing(mailboxManagerStub).getMailbox(expectations.with(Expectations.any(MailboxPath.class)), expectations.with(Expectations.any(MailboxSession.class))); expectations.will(Expectations.returnValue(messageManagerStub)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Lookup)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal((MailboxACL.MailboxACLRight) SimpleMailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); + expectations.allowing(mailboxManagerStub).hasRight(expectations.with(path), expectations.with(Expectations.equal(MailboxACL.Right.Administer)), expectations.with(Expectations.same(mailboxSessionStub))); expectations.will(Expectations.returnValue(true)); - expectations.allowing(mailboxManagerStub).setRights(expectations.with(path), expectations.with(Expectations.equal(new SimpleMailboxACL.SimpleMailboxACLCommand(user1Key, editMode, setRights))), expectations.with(mailboxSessionStub)); + expectations.allowing(mailboxManagerStub).setRights(expectations.with(path), expectations.with(Expectations.equal(new MailboxACL.ACLCommand(user1Key, editMode, setRights))), expectations.with(mailboxSessionStub)); expectations.allowing(metaDataStub).getACL(); expectations.will(Expectations.returnValue(acl)); http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java index 1894ce4..0826418 100644 --- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java +++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java @@ -54,10 +54,10 @@ import org.apache.james.mailbox.model.ComposedMessageId; import org.apache.james.mailbox.model.Content; import org.apache.james.mailbox.model.Headers; import org.apache.james.mailbox.model.MailboxACL; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLCommand; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRight; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRights; +import org.apache.james.mailbox.model.MailboxACL.ACLCommand; +import org.apache.james.mailbox.model.MailboxACL.EntryKey; +import org.apache.james.mailbox.model.MailboxACL.Rfc4314Rights; +import org.apache.james.mailbox.model.MailboxACL.Right; import org.apache.james.mailbox.model.MailboxAnnotation; import org.apache.james.mailbox.model.MailboxAnnotationKey; import org.apache.james.mailbox.model.MailboxCounters; @@ -363,20 +363,20 @@ public class MailboxEventAnalyserTest { throw new UnsupportedOperationException("Not implemented"); } - public boolean hasRight(MailboxPath mailboxPath, MailboxACLRight mailboxACLRight, MailboxSession mailboxSession) throws MailboxException { + public boolean hasRight(MailboxPath mailboxPath, Right mailboxACLRight, MailboxSession mailboxSession) throws MailboxException { throw new NotImplementedException("Not implemented"); } - public MailboxACLRights myRights(MailboxPath mailboxPath, MailboxSession mailboxSession) throws MailboxException { + public Rfc4314Rights myRights(MailboxPath mailboxPath, MailboxSession mailboxSession) throws MailboxException { throw new NotImplementedException("Not implemented"); } - public MailboxACLRights[] listRigths(MailboxPath mailboxPath, MailboxACLEntryKey mailboxACLEntryKey, MailboxSession mailboxSession) throws MailboxException { + public Rfc4314Rights[] listRigths(MailboxPath mailboxPath, EntryKey mailboxACLEntryKey, MailboxSession mailboxSession) throws MailboxException { throw new NotImplementedException("Not implemented"); } public void setRights(MailboxPath mailboxPath, - MailboxACLCommand mailboxACLCommand, MailboxSession session) + ACLCommand mailboxACLCommand, MailboxSession session) throws MailboxException { throw new NotImplementedException("Not implemented"); } http://git-wip-us.apache.org/repos/asf/james-project/blob/4e10f10b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java index 2f0dd8b..c046746 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java @@ -30,10 +30,7 @@ import org.apache.james.mailbox.MessageManager; import org.apache.james.mailbox.exception.BadCredentialsException; import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.mock.MockMailboxSession; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLCommand; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLEntryKey; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRight; -import org.apache.james.mailbox.model.MailboxACL.MailboxACLRights; +import org.apache.james.mailbox.model.MailboxACL; import org.apache.james.mailbox.model.MailboxAnnotation; import org.apache.james.mailbox.model.MailboxAnnotationKey; import org.apache.james.mailbox.model.MailboxId; @@ -192,22 +189,26 @@ public class DefaultMailboxesProvisioningFilterThreadTest { } @Override - public boolean hasRight(MailboxPath mailboxPath, MailboxACLRight right, MailboxSession session) throws MailboxException { + public boolean hasRight(MailboxPath mailboxPath, MailboxACL.Right right, MailboxSession session) throws MailboxException { return false; } @Override - public MailboxACLRights myRights(MailboxPath mailboxPath, MailboxSession session) throws MailboxException { + public MailboxACL.Rfc4314Rights myRights(MailboxPath mailboxPath, MailboxSession session) throws MailboxException { return null; } @Override - public MailboxACLRights[] listRigths(MailboxPath mailboxPath, MailboxACLEntryKey identifier, MailboxSession session) throws MailboxException { + public MailboxACL.Rfc4314Rights[] listRigths(MailboxPath mailboxPath, MailboxACL.EntryKey identifier, MailboxSession session) throws MailboxException { return null; } @Override - public void setRights(MailboxPath mailboxPath, MailboxACLCommand mailboxACLCommand, MailboxSession session) throws MailboxException { + public void setRights(MailboxPath mailboxPath, MailboxACL.ACLCommand mailboxACLCommand, MailboxSession session) throws MailboxException { + } + + @Override + public void resetRights(MailboxPath mailboxPath, MailboxACL mailboxACL, MailboxSession session) throws MailboxException { } @Override --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org