assertEquals(0, group.getMailboxes().size());
assertEquals("undisclosed-recipients", group.getName());
}
public void testMessyGroupAndMailbox() throws Exception {
AddressList addrList = parser.parseAddressList(
"Marketing folks : Jane Smith < jane @ example . net >," +
" \" Jack \\\"Jackie\\\" Jones \" < jjones@example.com > (comment(comment)); ,, (comment) ," +
" <@example . net,@example(ignore\\)).com:(ignore)john@(ignore)example.net>");
assertEquals(2, addrList.size());
Group group = (Group)addrList.get(0);
assertEquals("Marketing folks", group.getName());
assertEquals(2, group.getMailboxes().size());
Mailbox mailbox1 = group.getMailboxes().get(0);
Mailbox mailbox2 = group.getMailboxes().get(1);
assertEquals("Jane Smith", mailbox1.getName());
assertEquals("jane", mailbox1.getLocalPart());
assertEquals("example.net", mailbox1.getDomain());
assertEquals(" Jack \"Jackie\" Jones ", mailbox2.getName());
assertEquals("jjones", mailbox2.getLocalPart());
assertEquals("example.com", mailbox2.getDomain());
Mailbox mailbox = (Mailbox)addrList.get(1);
assertEquals("john", mailbox.getLocalPart());
assertEquals("example.net", mailbox.getDomain());
assertEquals(2, mailbox.getRoute().size());
assertEquals("example.net", mailbox.getRoute().get(0));
assertEquals("example.com", mailbox.getRoute().get(1));