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

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


    public void testParseNoRoute() throws Exception {
        String s = "stuff";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        DomainList route = parser.parseRoute(raw, cursor, null);
        assertNull(route);
    }
View Full Code Here


        Mailbox mailbox1 = parser.parseMailbox("< (route)(obsolete) " +
                "@host1.domain1 , @host2 . domain2:  foo@bar.org>");
        assertEquals(null, mailbox1.getName());
        assertEquals("foo", mailbox1.getLocalPart());
        assertEquals("bar.org", mailbox1.getDomain());
        DomainList domainList = mailbox1.getRoute();
        assertNotNull(domainList);
        assertEquals(2, domainList.size());
        assertEquals("host1.domain1", domainList.get(0));
        assertEquals("host2.domain2", domainList.get(1));
    }
View Full Code Here

    public void testGroupSerialization() {
        List<Mailbox> al = new ArrayList<Mailbox>();
        al.add(new Mailbox("test", "example.com"));
        al.add(new Mailbox("Foo!", "foo", "example.com"));
        DomainList dl = new DomainList(new ArrayList<String>(
                Arrays.asList(new String[] {"foo.example.com"})), true);
        Mailbox mailbox = new Mailbox("Foo Bar", dl, "foo2", "example.com");
        assertSame(dl, mailbox.getRoute());
        al.add(mailbox);
        Group g = new Group("group", new MailboxList(al, false));
View Full Code Here

    public void testParseRoute() throws Exception {
        String s = "  @a, @b, @c :me@home";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        DomainList route = parser.parseRoute(raw, cursor);
        assertNotNull(route);
        assertEquals(3, route.size());
        assertEquals("a", route.get(0));
        assertEquals("b", route.get(1));
        assertEquals("c", route.get(2));
        assertEquals('m', raw.byteAt(cursor.getPos()));
    }
View Full Code Here

    public void testParseNoRoute() throws Exception {
        String s = "stuff";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        DomainList route = parser.parseRoute(raw, cursor);
        assertNull(route);
    }
View Full Code Here

        Mailbox mailbox1 = parser.parseMailbox("< (route)(obsolete) " +
                "@host1.domain1 , @host2 . domain2:  foo@bar.org>");
        assertEquals(null, mailbox1.getName());
        assertEquals("foo", mailbox1.getLocalPart());
        assertEquals("bar.org", mailbox1.getDomain());
        DomainList domainList = mailbox1.getRoute();
        assertNotNull(domainList);
        assertEquals(2, domainList.size());
        assertEquals("host1.domain1", domainList.get(0));
        assertEquals("host2.domain2", domainList.get(1));
    }
View Full Code Here

        Mailbox mailbox1 = parser.parseMailbox("< (route)(obsolete) " +
                "@host1.domain1 , @host2 . domain2:  foo@bar.org>");
        assertEquals(null, mailbox1.getName());
        assertEquals("foo", mailbox1.getLocalPart());
        assertEquals("bar.org", mailbox1.getDomain());
        DomainList domainList = mailbox1.getRoute();
        assertNotNull(domainList);
        assertEquals(2, domainList.size());
        assertEquals("host1.domain1", domainList.get(0));
        assertEquals("host2.domain2", domainList.get(1));
    }
View Full Code Here

    public void testParseRoute() throws Exception {
        String s = "  @a, @b, @c :me@home";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        DomainList route = parser.parseRoute(raw, cursor);
        assertNotNull(route);
        assertEquals(3, route.size());
        assertEquals("a", route.get(0));
        assertEquals("b", route.get(1));
        assertEquals("c", route.get(2));
        assertEquals('m', raw.byteAt(cursor.getPos()));
    }
View Full Code Here

    public void testParseNoRoute() throws Exception {
        String s = "stuff";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        DomainList route = parser.parseRoute(raw, cursor);
        assertNull(route);
    }
View Full Code Here

        Mailbox mailbox1 = parser.parseMailbox("< (route)(obsolete) " +
                "@host1.domain1 , @host2 . domain2:  foo@bar.org>");
        assertEquals(null, mailbox1.getName());
        assertEquals("foo", mailbox1.getLocalPart());
        assertEquals("bar.org", mailbox1.getDomain());
        DomainList domainList = mailbox1.getRoute();
        assertNotNull(domainList);
        assertEquals(2, domainList.size());
        assertEquals("host1.domain1", domainList.get(0));
        assertEquals("host2.domain2", domainList.get(1));
    }
View Full Code Here

TOP

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

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.