Package mireka.transmission.immediate.dns

Source Code of mireka.transmission.immediate.dns.DnsJavaLookupTest

package mireka.transmission.immediate.dns;

import static org.junit.Assert.*;
import mireka.address.Domain;
import mireka.transmission.immediate.dns.MxLookup;
import mireka.transmission.immediate.dns.MxLookupException;

import org.junit.Test;

public class DnsJavaLookupTest {
    private static final String INVALID_EXAMPLE_DOMAIN_NAME =
            ". an invalid. example.net";

    @Test()
    public void testExceptionMessageContainsDomain() {
        MxLookup mxLookup =
                new MxLookup(new Domain(INVALID_EXAMPLE_DOMAIN_NAME));
        try {
            mxLookup.queryMxTargets();
        } catch (MxLookupException e) {
            assertTrue(e.getMessage().contains(INVALID_EXAMPLE_DOMAIN_NAME));
            return;
        }
        fail("An exception should have been thrown");
    }

}
TOP

Related Classes of mireka.transmission.immediate.dns.DnsJavaLookupTest

TOP
Copyright © 2018 www.massapi.com. 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.