Package org.apache.james.dnsservice.api

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


    /**
     * 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

    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

     *
     * @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

        };
        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

    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

        }
        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

        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

        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

    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

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.