james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r581033 - /james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java
Date Mon, 01 Oct 2007 18:40:41 GMT
Author: bago
Date: Mon Oct  1 11:40:40 2007
New Revision: 581033

URL: http://svn.apache.org/viewvc?rev=581033&view=rev
Log:
Upgrade SPFHandlerTest to jspf 0.9.5 interface.

Modified:
    james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java

Modified: james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java?rev=581033&r1=581032&r2=581033&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java
(original)
+++ james/server/trunk/phoenix-deployment/src/test/org/apache/james/smtpserver/SPFHandlerTest.java
Mon Oct  1 11:40:40 2007
@@ -26,7 +26,9 @@
 import java.util.Map;
 
 import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.james.jspf.core.DNSRequest;
 import org.apache.james.jspf.core.DNSService;
+import org.apache.james.jspf.core.exceptions.TimeoutException;
 import org.apache.james.smtpserver.core.filter.fastfail.SPFHandler;
 import org.apache.james.test.mock.avalon.MockLogger;
 import org.apache.james.test.mock.mailet.MockMail;
@@ -88,30 +90,30 @@
                 "Unimplemented mock service");
             }
 
-            public List getRecords(String host, int type) throws TimeoutException {
-                switch (type) {
-                    case DNSService.TXT:
-                    case DNSService.SPF:
+            public List getRecords(DNSRequest req) throws TimeoutException {
+                switch (req.getRecordType()) {
+                    case DNSRequest.TXT:
+                    case DNSRequest.SPF:
                         List l = new ArrayList();
-                        if (host.equals("spf1.james.apache.org")) {
+                        if (req.getHostname().equals("spf1.james.apache.org")) {
                             // pass
                             l.add("v=spf1 +all");
                             return l;
-                        } else if (host.equals("spf2.james.apache.org")) {
+                        } else if (req.getHostname().equals("spf2.james.apache.org")) {
                             // fail
                             l.add("v=spf1 -all");
                             return l;
-                        } else if (host.equals("spf3.james.apache.org")) {
+                        } else if (req.getHostname().equals("spf3.james.apache.org")) {
                             // softfail
                             l.add("v=spf1 ~all");
                             return l;
-                        } else if (host.equals("spf4.james.apache.org")) {
+                        } else if (req.getHostname().equals("spf4.james.apache.org")) {
                             // permerror
                             l.add("v=spf1 badcontent!");
                             return l;
-                        } else if (host.equals("spf5.james.apache.org")) {
+                        } else if (req.getHostname().equals("spf5.james.apache.org")) {
                             // temperror
-                            throw new TimeoutException();
+                            throw new TimeoutException("TIMEOUT");
                         } else {
                             return null;
                         }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message