Package org.apache.james.dnsservice.api

Examples of org.apache.james.dnsservice.api.DNSService


    /**
     * Test case for JAMES-1251
     */
    @Test
    public void testIteratorContainMultipleMX() {
        DNSService dns = new DNSService() {

            @Override
            public InetAddress getLocalHost() throws UnknownHostException {
                throw new UnsupportedOperationException();
            }
View Full Code Here


        assertFalse(it.hasNext());
    }

    @Test
    public void testIteratorWithInvalidMX() {
        DNSService dns = new DNSService() {

            @Override
            public InetAddress getLocalHost() throws UnknownHostException {
                throw new UnsupportedOperationException();
            }
View Full Code Here

        }
        return configuration;
    }

    private DNSService setUpDNSServer(final String hostName) {
        DNSService dns = new MockDNSService() {

            @Override
            public String getHostName(InetAddress inet) {
                return hostName;
            }
View Full Code Here

    /**
     * Setup the mocked dnsserver
     *
     */
    private DNSService setupMockedDnsServer() {
        DNSService mockedDnsServer = new MockDNSService() {

            @Override
            public Collection findTXTRecords(String hostname) {
                List res = new ArrayList();
                if (hostname == null) {
View Full Code Here

        };
        return session;
    }

    private DNSService setupMockedDNSServer() {
        DNSService dns = new MockDNSService() {

            @Override
            public Collection findMXRecords(String hostname) {
                Collection mx = new ArrayList();
View Full Code Here

    @Test
    public void testRejectLoopbackMX() throws ParseException, MailAddressException {
        Collection bNetworks = new ArrayList();
        bNetworks.add("127.0.0.1");

        DNSService dns = setupMockedDNSServer();
        MailAddress mailAddress = new MailAddress("test@" + INVALID_HOST);
        SMTPSession session = setupMockedSMTPSession(mailAddress);
        ValidRcptMX handler = new ValidRcptMX();

        handler.setDNSService(dns);
View Full Code Here

TOP

Related Classes of org.apache.james.dnsservice.api.DNSService

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.