Author: bago
Date: Mon Apr 30 09:57:17 2007
New Revision: 533803

URL: http://svn.apache.org/viewvc?view=rev&rev=533803
Log:
Refactored the AbstractYamlTest so that most behaviour is configurable:
1) Ability to switch from mocked dnsservice to local "fake dnsservice".
2) Ability to swtich from SynchronousExecutor to the StagedAsynchronous 
resolver and to use the single threaded dnsjava lookup, the multithreaded 
dnsjava lookup or the SEDA 2-threads dnsjnio lookup.
3) Ability to run "test groups" (a group is a sequence of tests sharing the 
same "fake" dns zone) as a single test (to be able to run all of them and check 
results at the end, asynchronously if the executor was asynchronous)

Reconfigured the default testsuite as follow:
1) run all tests as before via mocked dns server and synchronous executor
2) run the full mailzone tests asynchronously via fake dnsserver and 
staged_dnsjnio_resolver
3) run the full rfc4408 tests asynchronously (each block separately because 
they define different dns zones) via fake dnsserver and 
staged_dnsjava_multithread_resolver.
It takes 50 seconds on my laptop to complete...

Added:
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
Modified:
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/LoggingDNSService.java
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
    
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/SPF1ParserTest.java

Modified: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/AbstractYamlTest.java?view=diff&rev=533803&r1=533802&r2=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
 (original)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
 Mon Apr 30 09:57:17 2007
@@ -21,13 +21,15 @@
 
 import org.apache.james.jspf.core.DNSRequest;
 import org.apache.james.jspf.core.DNSService;
-import org.apache.james.jspf.core.IResponseQueue;
 import org.apache.james.jspf.core.Logger;
-import org.apache.james.jspf.core.IResponseImpl;
 import org.apache.james.jspf.core.SPFExecutor;
 import org.apache.james.jspf.core.SPFRecordParser;
 import org.apache.james.jspf.core.StagedMultipleSPFExecutor;
+import org.apache.james.jspf.core.SynchronousSPFExecutor;
+import org.apache.james.jspf.dnsserver.DNSTestingServer;
+import org.apache.james.jspf.impl.DNSJnioAsynchService;
 import org.apache.james.jspf.impl.DNSServiceAsynchSimulator;
+import org.apache.james.jspf.impl.DNSServiceXBillImpl;
 import org.apache.james.jspf.macro.MacroExpand;
 import org.apache.james.jspf.parser.DefaultSPF1Parser;
 import org.apache.james.jspf.parser.DefaultTermsFactory;
@@ -39,31 +41,52 @@
 import org.jvyaml.Constructor;
 import org.jvyaml.DefaultYAMLFactory;
 import org.jvyaml.YAMLFactory;
+import org.xbill.DNS.DClass;
+import org.xbill.DNS.Lookup;
+import org.xbill.DNS.Name;
+import org.xbill.DNS.Resolver;
+import org.xbill.DNS.SimpleResolver;
+import org.xbill.DNS.TextParseException;
 
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Set;
 
 import junit.framework.TestCase;
 
 public abstract class AbstractYamlTest extends TestCase {
 
+    protected static final int TIMEOUT = 10;
+    protected static final int MOCK_SERVICE = 2;
+    protected static final int FAKE_SERVER = 1;
+    private int dnsServiceMockStyle = MOCK_SERVICE;
+
+    protected static final int SYNCHRONOUS_EXECUTOR = 1;
+    protected static final int STAGED_EXECUTOR = 2;
+    protected static final int STAGED_EXECUTOR_MULTITHREADED = 3;
+    protected static final int STAGED_EXECUTOR_DNSJNIO = 4;
+    private int spfExecutorType = SYNCHRONOUS_EXECUTOR;
+
     SPFYamlTestSuite data;
     String test;
     protected Logger log;
     private SPFExecutor executor;
     protected static MacroExpand macroExpand;
     protected static SPF spf;
+    protected static SPFYamlTestSuite prevData;
     protected static SPFRecordParser parser;
     private static DNSService dns;
+    protected static DNSTestingServer dnsTestServer;
 
     protected AbstractYamlTest(SPFYamlTestSuite def, String test) {
         super(def.getComment()+" #"+test);
@@ -71,6 +94,12 @@
         this.test = test;
     }
 
+    protected AbstractYamlTest(SPFYamlTestSuite def) {
+        super(def.getComment()+" #COMPLETE!");
+        this.data = def;
+        this.test = null;
+    }
+
     protected abstract String getFilename();
 
     protected List internalLoadTests(String filename) throws IOException {
@@ -83,17 +112,22 @@
         Iterator i = tests.iterator();
         while (i.hasNext() && data == null) {
             SPFYamlTestSuite def = (SPFYamlTestSuite) i.next();
-            Iterator j = def.getTests().keySet().iterator();
-            while (j.hasNext() && data == null) {
-                String test = (String) j.next();
-                if (name.equals(def.getComment()+ " #"+test)) {
-                    data = def;
-                    this.test = test;
+            if (name.equals(def.getComment()+" #COMPLETE!")) {
+                data = def;
+                this.test = null;
+            } else {
+                Iterator j = def.getTests().keySet().iterator();
+                while (j.hasNext() && data == null) {
+                    String test = (String) j.next();
+                    if (name.equals(def.getComment()+ " #"+test)) {
+                        data = def;
+                        this.test = test;
+                    }
                 }
             }
         }
         assertNotNull(data);
-        assertNotNull(test);
+        // assertNotNull(test);
     }
 
     public static List loadTests(String filename) throws IOException {
@@ -133,16 +167,11 @@
     }
 
     protected void runTest() throws Throwable {
-        String next = test;
-        HashMap currentTest = (HashMap) data.getTests().get(next);
 
         if (log == null) {
-                log = new ConsoleLogger();
+                log = new ConsoleLogger(ConsoleLogger.LEVEL_DEBUG, "root");
         }
 
-        Logger testLogger = log.getChildLogger("test");
-        testLogger.info("TESTING "+next+": "+currentTest.get("description"));
-    
         if (parser == null) {
             /* PREVIOUS SLOW WAY 
             enabledServices = new WiringServiceTable();
@@ -168,17 +197,47 @@
                 
             }));
         }
-        dns = new LoggingDNSService(getDNSService(), 
log.getChildLogger("dns"));
+        if (this.data != AbstractYamlTest.prevData) {
+            dns = new LoggingDNSService(getDNSService(), 
log.getChildLogger("dns"));
+            AbstractYamlTest.prevData = this.data;
+        }
         macroExpand = new MacroExpand(log.getChildLogger("macroExpand"), dns);
-        executor = new StagedMultipleSPFExecutor(log, new 
DNSServiceAsynchSimulator(dns)); 
+        if (getSpfExecutorType() == SYNCHRONOUS_EXECUTOR) {  // synchronous
+            executor = new SynchronousSPFExecutor(log, dns);
+        } else if (getSpfExecutorType() == STAGED_EXECUTOR || 
getSpfExecutorType() == STAGED_EXECUTOR_MULTITHREADED){
+            executor = new StagedMultipleSPFExecutor(log, new 
DNSServiceAsynchSimulator(dns, getSpfExecutorType() == 
STAGED_EXECUTOR_MULTITHREADED));
+        } else if (getSpfExecutorType() == STAGED_EXECUTOR_DNSJNIO) {
+            DNSJnioAsynchService jnioAsynchService = new 
DNSJnioAsynchService();
+            jnioAsynchService.setTimeout(TIMEOUT);
+            executor = new StagedMultipleSPFExecutor(log, jnioAsynchService);
+        } else {
+            throw new UnsupportedOperationException("Unknown executor type");
+        }
         spf = new SPF(dns, parser, log.getChildLogger("spf"), macroExpand, 
executor);
-        /* PREVIOUS SLOW WAY 
-        // we add this after the creation because it is a loop reference
-        enabledServices.remove(DNSServiceEnabled.class);
-        enabledServices.put(DNSServiceEnabled.class, getDNSService());
-        enabledServices.remove(SPFCheckEnabled.class);
-        enabledServices.put(SPFCheckEnabled.class, spf);
-        */
+
+        if (test != null) {
+            String next = test;
+            SPFResult res = runSingleTest(next);
+            verifyResult(next, res);
+        } else {
+            Map queries = new HashMap();
+            for (Iterator i = data.getTests().keySet().iterator(); 
i.hasNext(); ) {
+                String next = (String) i.next();
+                SPFResult res = runSingleTest(next);
+                queries.put(next, res);
+            }
+            for (Iterator i = queries.keySet().iterator(); i.hasNext(); ) {
+                String next = (String) i.next();
+                verifyResult(next, (SPFResult) queries.get(next));
+            }
+        }
+        
+    }
+
+    private SPFResult runSingleTest(String testName) {
+        HashMap currentTest = (HashMap) data.getTests().get(testName);
+        Logger testLogger = log.getChildLogger(testName);
+        testLogger.info("TESTING "+testName+": 
"+currentTest.get("description"));
 
         String ip = null;
         String sender = null;
@@ -197,10 +256,15 @@
         }
     
         SPFResult res = spf.checkSPF(ip, sender, helo);
+        return res;
+    }
+
+    private void verifyResult(String testName, SPFResult res) {
         String resultSPF = res.getResult();
-        
+        HashMap currentTest = (HashMap) data.getTests().get(testName);
+        Logger testLogger = log.getChildLogger(testName+"-verify");
         if (currentTest.get("result") instanceof String) {
-            assertEquals("Test "+next+" ("+currentTest.get("description")+") 
failed. Returned: "+res.getResult()+" Expected: "+currentTest.get("result")+" 
[["+res.getResult()+"||"+res.getHeaderText()+"]]", currentTest.get("result"), 
res.getResult());
+            assertEquals("Test "+testName+" 
("+currentTest.get("description")+") failed. Returned: "+res.getResult()+" 
Expected: "+currentTest.get("result")+" 
[["+res.getResult()+"||"+res.getHeaderText()+"]]", currentTest.get("result"), 
res.getResult());
         } else {
             ArrayList results = (ArrayList) currentTest.get("result");
             boolean match = false;
@@ -228,17 +292,76 @@
         }
     
         testLogger.info("PASSED. Result="+res.getResult()+" 
Explanation="+res.getExplanation()+" Header="+res.getHeaderText());
-        
     }
 
     /**
      * @return
      */
-    protected DNSService getDNSService() {
+    protected DNSService getDNSServiceMockedDNSService() {
         SPFYamlDNSService yamlDNSService = new 
SPFYamlDNSService(data.getZonedata());
         return yamlDNSService;
     }
 
+    /**
+     * @return
+     */
+    protected DNSService getDNSService() {
+        switch (getDnsServiceMockStyle()) {
+            case MOCK_SERVICE: return getDNSServiceMockedDNSService();
+            case FAKE_SERVER: return getDNSServiceFakeServer();
+            default: 
+                throw new UnsupportedOperationException("Unsupported mock 
style");
+        }
+    }
+
+    protected int getDnsServiceMockStyle() {
+        return dnsServiceMockStyle;
+    }
+
+    /**
+     * @return
+     */
+    protected DNSService getDNSServiceFakeServer() {
+        Resolver resolver = null;
+        try {
+            resolver = new SimpleResolver("127.0.0.1");
+        } catch (UnknownHostException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        resolver.setPort(35347);
+        Lookup.setDefaultResolver(resolver);
+        Lookup.setDefaultCache(null, DClass.IN);
+        Lookup.setDefaultSearchPath(new Name[] {});
+
+        if (dnsTestServer == null) {
+            try {
+                dnsTestServer = new DNSTestingServer("0.0.0.0", "35347");
+            } catch (TextParseException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+        
+        dnsTestServer.setData(data.getZonedata());
+        
+        DNSServiceXBillImpl serviceXBillImpl = new DNSServiceXBillImpl(log) {
+
+            public List getLocalDomainNames() {
+                List l = new ArrayList();
+                l.add("localdomain.foo.bar");
+                return l; 
+            }
+
+        };
+        // TIMEOUT 2 seconds
+        serviceXBillImpl.setTimeOut(TIMEOUT);
+        return serviceXBillImpl;
+    }
+
     public AbstractYamlTest() {
         super();
     }
@@ -341,14 +464,6 @@
             return null;
         }
         
-        public void getRecordsAsynch(DNSRequest request, Object id,
-                IResponseQueue responsePool) {
-            try {
-                responsePool.insertResponse(new IResponseImpl(id, 
getRecords(request)));
-            } catch (TimeoutException e) {
-                responsePool.insertResponse(new IResponseImpl(id, e));
-            }
-        }
     }
 
     
@@ -368,6 +483,10 @@
             case DNSRequest.SPF: return "SPF";
             default: return null;
         }
+    }
+
+    protected int getSpfExecutorType() {
+        return spfExecutorType;
     }
 
     protected static class SPFYamlTestSuite {

Modified: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/LoggingDNSService.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/LoggingDNSService.java?view=diff&rev=533803&r1=533802&r2=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/LoggingDNSService.java
 (original)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/LoggingDNSService.java
 Mon Apr 30 09:57:17 2007
@@ -65,7 +65,7 @@
     }
 
     public void setTimeOut(int timeOut) {
-        // MOCK
+        dnsService.setTimeOut(timeOut);
     }
 
     public List getRecords(DNSRequest request) throws TimeoutException {

Added: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java?view=auto&rev=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
 (added)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
 Mon Apr 30 09:57:17 2007
@@ -0,0 +1,93 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.jspf;
+
+import org.apache.james.jspf.core.DNSService;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class MailZoneAsynchronousYamlTest extends MailZoneYamlTest {
+
+    private static final String YAMLFILE2 = "mailzone-tests.yml";
+
+    /**
+     * @param name
+     * @throws IOException
+     */
+    public MailZoneAsynchronousYamlTest(String name) throws IOException {
+        super(name);
+    }
+
+    protected MailZoneAsynchronousYamlTest(SPFYamlTestSuite def, String test) {
+        super(def, test);
+    }
+
+    protected MailZoneAsynchronousYamlTest(SPFYamlTestSuite def) {
+        super(def);
+    }
+
+    protected String getFilename() {
+        return YAMLFILE2;
+    }
+
+    public static Test suite() throws IOException {
+        return new MailZoneAsynchronousSuite();
+    }
+
+    protected List internalLoadTests(String filename) throws IOException {
+        return loadTests(filename);
+    }
+
+    protected DNSService getDNSService() {
+        DNSService dns = super.getDNSService();
+        // Remove record limits for this test
+        dns.setRecordLimit(0);
+        return dns;
+    }
+    
+    
+    protected int getDnsServiceMockStyle() {
+        return FAKE_SERVER;
+    }
+
+    protected int getSpfExecutorType() {
+        return STAGED_EXECUTOR_DNSJNIO;
+    }
+
+    static class MailZoneAsynchronousSuite extends TestSuite {
+
+        public MailZoneAsynchronousSuite() throws IOException {
+            super();
+            List tests = loadTests(YAMLFILE2);
+            Iterator i = tests.iterator();
+            while (i.hasNext()) {
+                SPFYamlTestSuite o = (SPFYamlTestSuite) i.next();
+                addTest(new MailZoneAsynchronousYamlTest(o));
+            }
+        }
+
+    }
+
+}

Modified: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java?view=diff&rev=533803&r1=533802&r2=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
 (original)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
 Mon Apr 30 09:57:17 2007
@@ -44,6 +44,10 @@
         super(def, test);
     }
 
+    protected MailZoneYamlTest(SPFYamlTestSuite def) {
+        super(def);
+    }
+
     protected String getFilename() {
         return YAMLFILE2;
     }

Added: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java?view=auto&rev=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
 (added)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
 Mon Apr 30 09:57:17 2007
@@ -0,0 +1,123 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.jspf;
+
+import org.apache.james.jspf.core.Logger;
+import org.apache.james.jspf.impl.Log4JLogger;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+public class RFC4408AsynchronousYamlTest extends RFC4408YamlTest {
+
+    private static final String YAMLFILE2 = "rfc4408-tests.yml";
+    /**
+     * @param name
+     * @throws IOException
+     */
+    public RFC4408AsynchronousYamlTest(String name) throws IOException {
+        super(name);
+    }
+
+    protected RFC4408AsynchronousYamlTest(SPFYamlTestSuite def) {
+        super(def);
+    }
+
+    protected RFC4408AsynchronousYamlTest(SPFYamlTestSuite def, String test) {
+        super(def, test);
+    }
+
+    protected String getFilename() {
+        return YAMLFILE2;
+    }
+
+    public static Test suite() throws IOException {
+        return new RFC4408AsynchronousSuite();
+    }
+
+    protected List internalLoadTests(String filename) throws IOException {
+        return loadTests(filename);
+    }
+
+    protected int getDnsServiceMockStyle() {
+        return FAKE_SERVER;
+    }
+
+    protected int getSpfExecutorType() {
+        return STAGED_EXECUTOR_MULTITHREADED;
+    }
+
+    static class RFC4408AsynchronousSuite extends TestSuite {
+
+        public RFC4408AsynchronousSuite() throws IOException {
+            super();
+            try {
+                List tests = loadTests(YAMLFILE2);
+                Iterator i = tests.iterator();
+                while (i.hasNext()) {
+                    SPFYamlTestSuite o = (SPFYamlTestSuite) i.next();
+                    addTest(new RFC4408AsynchronousYamlTest(o));
+                }
+            } catch (RuntimeException e) {
+                if ("Unable to load the file".equals(e.getMessage())) {
+                    System.err.println("WARNING: RFC4408 tests disabled.");
+                    System.err.println("The RFC4408 test-suite is not bundled 
with jspf due to licensing issues.");
+                    System.err.println("You can download the yaml testsuite at 
the following url:");
+                    System.err.println("  
http://www.openspf.org/source/project/test-suite/";);
+                    System.err.println("and place an rfc4408-tests.yml file in 
the /src/test/resources/org/apache/james/jspf folder.");
+                }
+            }
+        }
+
+    }
+    
+    protected void setLogger(Logger logger) {
+        this.log = logger;
+    }
+    
+    /**
+     * This method has been created for spf spec people to let them better 
read the
+     * output of our tests against their yaml file
+     * 
+     * @param args
+     * @throws Throwable 
+     */
+    public static void main(String[] args) throws Throwable {
+        Logger l = new Log4JLogger(org.apache.log4j.Logger.getLogger("ROOT"));
+
+        List tests = loadTests(YAMLFILE2);
+        Iterator i = tests.iterator();
+        while (i.hasNext()) {
+            SPFYamlTestSuite o = (SPFYamlTestSuite) i.next();
+            Iterator ttt = o.getTests().keySet().iterator();
+            while (ttt.hasNext()) {
+                RFC4408AsynchronousYamlTest t = new 
RFC4408AsynchronousYamlTest(o,(String) ttt.next());
+                t.setLogger(l);
+                TestRunner.run(t);
+            }
+        }
+    }
+
+}

Modified: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java?view=diff&rev=533803&r1=533802&r2=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
 (original)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
 Mon Apr 30 09:57:17 2007
@@ -42,6 +42,10 @@
         super(name);
     }
 
+    protected RFC4408YamlTest(SPFYamlTestSuite def) {
+        super(def);
+    }
+
     protected RFC4408YamlTest(SPFYamlTestSuite def, String test) {
         super(def, test);
     }

Modified: 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/SPF1ParserTest.java
URL: 
http://svn.apache.org/viewvc/james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/SPF1ParserTest.java?view=diff&rev=533803&r1=533802&r2=533803
==============================================================================
--- 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/SPF1ParserTest.java
 (original)
+++ 
james/jspf/branches/asynch-jspf/src/test/java/org/apache/james/jspf/SPF1ParserTest.java
 Mon Apr 30 09:57:17 2007
@@ -146,14 +146,7 @@
                                 if (def.recOutAuto == null)
                                     def.recOutAuto = "";
                             }
-//                        } else {
-//                            // System.err.println("Unknown token: " + 
tokens[0]);
                         }
-
-//                    } else {
-//                        System.err
-//                                .println("Ignored line for different 
implementation: "
-//                                        + tokens[1]);
                     }
 
                 } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to