Author: norman
Date: Mon Nov 27 11:25:17 2006
New Revision: 479730
URL: http://svn.apache.org/viewvc?view=rev&rev=479730
Log:
Add new Version of rfc4408 test file. The tests now the same as the official
released testsuite on new.openspf.org
Fix a bug in junit tests
Modified:
james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
james/jspf/trunk/src/test/resources/org/apache/james/jspf/rfc4408-tests.yml
Modified:
james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java?view=diff&rev=479730&r1=479729&r2=479730
==============================================================================
--- james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
(original)
+++ james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
Mon Nov 27 11:25:17 2006
@@ -286,7 +286,19 @@
res.add(cname);
}
} else {
- res.add((String) hm.get(type));
+ Object obj = hm.get(type);
+
+ if (obj instanceof String) {
+ res.add((String) obj);
+ } else if (obj instanceof ArrayList) {
+ ArrayList a = (ArrayList) obj;
+ StringBuffer sb = new StringBuffer();
+
+ for (int i2 = 0; i2 < a.size(); i2++) {
+ sb.append(a.get(i2));
+ }
+ res.add(sb.toString());
+ }
}
}
if (hm.get("CNAME") != null && depth > 0) {
Modified:
james/jspf/trunk/src/test/resources/org/apache/james/jspf/rfc4408-tests.yml
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/src/test/resources/org/apache/james/jspf/rfc4408-tests.yml?view=diff&rev=479730&r1=479729&r2=479730
==============================================================================
--- james/jspf/trunk/src/test/resources/org/apache/james/jspf/rfc4408-tests.yml
(original)
+++ james/jspf/trunk/src/test/resources/org/apache/james/jspf/rfc4408-tests.yml
Mon Nov 27 11:25:17 2006
@@ -4,6 +4,7 @@
#
# Contributors:
# Stuart D Gathman everything so far
+# Julian Mehnle proofread YAML syntax, spelling, formal schema
# Informal contributors (suggestions but no code):
# Craig Whitmore
# Frank Ellermann
@@ -11,7 +12,6 @@
# Scott Kitterman
# Norman Maurer
# Mark Shewmaker
-# Julian Mehnle
#
---
description: Initial processing
@@ -130,7 +130,9 @@
description: Selecting records
tests:
nospace1:
- description: Version must be terminated by space or end of record.
+ description: >-
+ Version must be terminated by space or end of record. TXT pieces
+ are joined without intervening spaces.
spec: 4.5/4
helo: mail.example1.com
host: 1.2.3.4
@@ -216,7 +218,7 @@
example1.com:
- SPF: v=spf1
example2.com:
- - SPF: v=spf1mx
+ - SPF: [ 'v=spf1', 'mx' ]
mail.example1.com:
- A: 1.2.3.4
example4.com:
@@ -1131,20 +1133,34 @@
cidr6-0-ip4:
description: >-
IP4 connections do not match ip6.
+ comment: >-
+ There is controversy over ip4 mapped connections. RFC4408 clearly
+ requires such connections to be considered as ip4. However,
+ some interpret the RFC to mean that such connections should *also*
+ match appropriate ip6 mechanisms (but not, inexplicably, A or MX
+ mechanisms). Until there is consensus, both
+ results are acceptable.
spec: 5/9/2
helo: mail.example.com
host: 1.2.3.4
mailfrom: [EMAIL PROTECTED]
- result: neutral
+ result: [neutral, pass]
cidr6-ip4:
description: >-
Even if the SMTP connection is via IPv6, an IPv4-mapped IPv6 IP address
(see RFC 3513, Section 2.5.5) MUST still be considered an IPv4 address.
+ comment: >-
+ There is controversy over ip4 mapped connections. RFC4408 clearly
+ requires such connections to be considered as ip4. However,
+ some interpret the RFC to mean that such connections should *also*
+ match appropriate ip6 mechanisms (but not, inexplicably, A or MX
+ mechanisms). Until there is consensus, both
+ results are acceptable.
spec: 5/9/2
helo: mail.example.com
host: ::FFFF:1.2.3.4
mailfrom: [EMAIL PROTECTED]
- result: neutral
+ result: [neutral, pass]
cidr6-0:
description: >-
Match any IP6
@@ -1239,7 +1255,7 @@
explanation: DEFAULT
include-ignores-exp:
description: >-
- when executing "incde", exp= from the target domain MUST NOT be used.
+ when executing "include", exp= from the target domain MUST NOT be used.
spec: 6.2/13
helo: mail.example.com
host: 1.2.3.4
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]