Examples of DNSService


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

    serviceManager.put("mailStore", new MockMailStore());
 
  }

  private DNSService setUpDNSServer() {
    DNSService dns = new MockDNSService() {
      public String getHostName(InetAddress addr) {
        return "localhost";
      }

      public InetAddress getLocalHost() throws UnknownHostException {
View Full Code Here

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

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

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

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

    public InSpammerBlacklistTest(String arg0) throws UnsupportedEncodingException {
        super(arg0);
    }

    private DNSService setUpDNSServer() {
        DNSService dns = new MockDNSService() {
            public InetAddress getByName(String name) throws UnknownHostException {
                if (name.equals(LISTED_HOST.reverse() + "." + BLACKLIST)) {
                    return null;
                } else {
                    throw new UnknownHostException("Not listed");
View Full Code Here

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

     *
     * @param hostName
     * @return
     */
    private DNSService setUpDNSServer(final String hostName) {
        DNSService dns = new MockDNSService() {
            public String getHostName(InetAddress inet) {
                return hostName;
            }
            public InetAddress[] getAllByName(String name) throws UnknownHostException {
                return new InetAddress[] { InetAddress.getByName("127.0.0.1")};
View Full Code Here

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

        };
        return session;
    }

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

            public Collection findMXRecords(String hostname) {
                Collection mx = new ArrayList();

                if (hostname.equals(INVALID_HOST)) {
View Full Code Here

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

    public void testRejectLoopbackMX() throws ParseException {
        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

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

        }
        return configuration;
    }
   
    private DNSService setUpDNSServer(final String hostName) {
        DNSService dns = new MockDNSService() {
            public String getHostName(InetAddress inet) {
                return hostName;
            }
           
            public InetAddress[] getAllByName(String name) throws UnknownHostException {
View Full Code Here

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

        serviceManager.put("filesystem",fSystem);
     
    }

    private DNSService setUpDNSServer() {
        DNSService dns = new MockDNSService() {
            public String getHostName(InetAddress addr) {
                return "localhost";
            }
           
            public InetAddress getLocalHost() throws UnknownHostException {
View Full Code Here

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

        configuration.addProperty("sqlFile", "file://conf/sqlResources.xml");
        return configuration;
    }
   
    private DNSService setUpDNSServer(final String hostName) {
        DNSService dns = new MockDNSService() {
            public String getHostName(InetAddress inet) {
                return hostName;
            }
           
            public InetAddress[] getAllByName(String name) throws UnknownHostException {
View Full Code Here

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

    private InSpammerBlacklist matcher;
    private final static String BLACKLIST = "my.black.list.";
    private final static StringBuffer LISTED_HOST = new StringBuffer("111.222.111.222");

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

            @Override
            public InetAddress getByName(String name) throws UnknownHostException {
                if (name.equals(LISTED_HOST.reverse() + "." + BLACKLIST)) {
                    return null;
View Full Code Here
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.