Package org.apache.james.mime4j.dom.address

Examples of org.apache.james.mime4j.dom.address.MailboxList


        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());
        Group group = parser.parseGroup(raw, cursor);
        assertEquals("group", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(2, mailboxes.size());

        Mailbox mailbox1 = mailboxes.get(0);
        assertNull(mailbox1.getName());
        assertEquals("john.doe@acme.org", mailbox1.getAddress());

        Mailbox mailbox2 = mailboxes.get(1);
        assertEquals("Mary Smith", mailbox2.getName());
        assertEquals("mary@example.net", mailbox2.getAddress());
    }
View Full Code Here


    public void testParseInvalidGroup() throws Exception {
        Group group = parser.parseGroup("john.doe@acme.org");
        assertEquals("john.doe@acme.org", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }
View Full Code Here

        address = parser.parseAddress("group: Mary Smith <mary@example.net>;");
        assertTrue(address instanceof Group);
        Group group = (Group) address;
        assertEquals("group", group.getName());
        MailboxList mailboxes = group.getMailboxes();
        assertEquals(1, mailboxes.size());
        mbox = mailboxes.get(0);
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
    }
View Full Code Here

        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());
        Group group = parser.parseGroup(raw, cursor);
        assertEquals("group", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(2, mailboxes.size());

        Mailbox mailbox1 = mailboxes.get(0);
        assertNull(mailbox1.getName());
        assertEquals("john.doe@acme.org", mailbox1.getAddress());

        Mailbox mailbox2 = mailboxes.get(1);
        assertEquals("Mary Smith", mailbox2.getName());
        assertEquals("mary@example.net", mailbox2.getAddress());
    }
View Full Code Here

    public void testParseInvalidGroup() throws Exception {
        Group group = parser.parseGroup("john.doe@acme.org");
        assertEquals("john.doe@acme.org", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }
View Full Code Here

        address = parser.parseAddress("group: Mary Smith <mary@example.net>;");
        assertTrue(address instanceof Group);
        Group group = (Group) address;
        assertEquals("group", group.getName());
        MailboxList mailboxes = group.getMailboxes();
        assertEquals(1, mailboxes.size());
        mbox = mailboxes.get(0);
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
    }
View Full Code Here

    public void testParseGroup() throws Exception {
        Group group = parser.parseGroup(
                "group: john.doe@acme.org, Mary Smith <mary@example.net>;");
        assertEquals("group", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(2, mailboxes.size());

        Mailbox mailbox1 = mailboxes.get(0);
        assertNull(mailbox1.getName());
        assertEquals("john.doe@acme.org", mailbox1.getAddress());

        Mailbox mailbox2 = mailboxes.get(1);
        assertEquals("Mary Smith", mailbox2.getName());
        assertEquals("mary@example.net", mailbox2.getAddress());
    }
View Full Code Here

        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());
        Group group = parser.parseGroup(raw, cursor);
        assertEquals("group", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(2, mailboxes.size());

        Mailbox mailbox1 = mailboxes.get(0);
        assertNull(mailbox1.getName());
        assertEquals("john.doe@acme.org", mailbox1.getAddress());

        Mailbox mailbox2 = mailboxes.get(1);
        assertEquals("Mary Smith", mailbox2.getName());
        assertEquals("mary@example.net", mailbox2.getAddress());
    }
View Full Code Here

    public void testParseInvalidGroup() throws Exception {
        Group group = parser.parseGroup("john.doe@acme.org");
        assertEquals("john.doe@acme.org", group.getName());

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }
View Full Code Here

        address = parser.parseAddress("group: Mary Smith <mary@example.net>;");
        assertTrue(address instanceof Group);
        Group group = (Group) address;
        assertEquals("group", group.getName());
        MailboxList mailboxes = group.getMailboxes();
        assertEquals(1, mailboxes.size());
        mbox = mailboxes.get(0);
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.dom.address.MailboxList

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.