Package org.apache.james.mailbox.model.SimpleMailboxACL

Examples of org.apache.james.mailbox.model.SimpleMailboxACL.SimpleMailboxACLEntryKey


    @Test
    public void testExceptACLFull() throws UnsupportedRightException {

        Map<MailboxACLEntryKey, MailboxACLRights> expectedEntries = new HashMap<MailboxACL.MailboxACLEntryKey, MailboxACL.MailboxACLRights>(u1u2g1g2ACL.getEntries());
        expectedEntries.remove(new SimpleMailboxACLEntryKey(USER_1));

        MailboxACL toRemove = new SimpleMailboxACL(new SimpleMailboxACL.SimpleMailboxACLEntry[] { new SimpleMailboxACL.SimpleMailboxACLEntry(USER_1, SimpleMailboxACL.FULL_RIGHTS.serialize()) });
        MailboxACL result = u1u2g1g2ACL.except(toRemove);

        Map<MailboxACLEntryKey, MailboxACLRights> foundEntries = result.getEntries();
View Full Code Here


    @Test
    public void testExceptEntryFull() throws UnsupportedRightException {

        Map<MailboxACLEntryKey, MailboxACLRights> expectedEntries = new HashMap<MailboxACL.MailboxACLEntryKey, MailboxACL.MailboxACLRights>(u1u2g1g2ACL.getEntries());
        expectedEntries.remove(new SimpleMailboxACLEntryKey(USER_1));

        MailboxACL result = u1u2g1g2ACL.except(new SimpleMailboxACLEntryKey(USER_1), SimpleMailboxACL.FULL_RIGHTS);

        Map<MailboxACLEntryKey, MailboxACLRights> foundEntries = result.getEntries();

        assertEquals(expectedEntries, foundEntries);
    }
View Full Code Here

    private static final String USER_1 = "user1";
   
    @Test
    public void testUser() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(USER_1);
        assertEquals(k.isNegative(), false);
        assertEquals(k.getNameType(), NameType.user);
        assertEquals(k.getName(), USER_1);
       
    }
View Full Code Here

    }
   
    @Test
    public void testNegativeUser() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(MailboxACL.DEFAULT_NEGATIVE_MARKER + USER_1);
        assertEquals(k.isNegative(), true);
        assertEquals(k.getNameType(), NameType.user);
        assertEquals(k.getName(), USER_1);
       
    }
View Full Code Here

   

    @Test
    public void testGroup() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(MailboxACL.DEFAULT_GROUP_MARKER + GROUP_1);
        assertEquals(k.isNegative(), false);
        assertEquals(k.getNameType(), NameType.group);
        assertEquals(k.getName(), GROUP_1);
       
    }
View Full Code Here

    }
   
    @Test
    public void testNegativeGroup() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey("" + MailboxACL.DEFAULT_NEGATIVE_MARKER + MailboxACL.DEFAULT_GROUP_MARKER + GROUP_1);
        assertEquals(k.isNegative(), true);
        assertEquals(k.getNameType(), NameType.group);
        assertEquals(k.getName(), GROUP_1);
       
    }
View Full Code Here

   

    @Test
    public void testOwner() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(SpecialName.owner.toString());
        assertEquals(k.isNegative(), false);
        assertEquals(k.getNameType(), NameType.special);
        assertEquals(k.getName(), SpecialName.owner.toString());
       
    }
View Full Code Here

    }
   
    @Test
    public void testNegativeOwner() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(MailboxACL.DEFAULT_NEGATIVE_MARKER + SpecialName.owner.toString());
        assertEquals(k.isNegative(), true);
        assertEquals(k.getNameType(), NameType.special);
        assertEquals(k.getName(), SpecialName.owner.toString());
       
    }
View Full Code Here

    }

    @Test
    public void testAnybody() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(SpecialName.anybody.toString());
        assertEquals(k.isNegative(), false);
        assertEquals(k.getNameType(), NameType.special);
        assertEquals(k.getName(), SpecialName.anybody.toString());
       
    }
View Full Code Here

    }
   
    @Test
    public void testNegativeAnybody() throws UnsupportedRightException {
       
        MailboxACLEntryKey k = new SimpleMailboxACLEntryKey(MailboxACL.DEFAULT_NEGATIVE_MARKER + SpecialName.anybody.toString());
        assertEquals(k.isNegative(), true);
        assertEquals(k.getNameType(), NameType.special);
        assertEquals(k.getName(), SpecialName.anybody.toString());
       
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.model.SimpleMailboxACL.SimpleMailboxACLEntryKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.