james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r802431 - in /james/jspf/trunk: resolver/src/test/java/org/apache/james/jspf/ tester/src/main/java/org/apache/james/jspf/tester/
Date Sat, 08 Aug 2009 18:30:06 GMT
Author: norman
Date: Sat Aug  8 18:30:05 2009
New Revision: 802431

URL: http://svn.apache.org/viewvc?rev=802431&view=rev
Log:
more generify again (JSPF-78)

Modified:
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/LoggingDNSService.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPF1ParserTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPFYamlTest.java
    james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/YamlTest.java
    james/jspf/trunk/tester/src/main/java/org/apache/james/jspf/tester/SPFYamlTestDescriptor.java

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/AbstractYamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/AbstractYamlTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/AbstractYamlTest.java Sat
Aug  8 18:30:05 2009
@@ -108,17 +108,17 @@
 
     protected AbstractYamlTest(String name) throws IOException {
         super(name);
-        List tests = SPFYamlTestDescriptor.loadTests(getFilename());
-        Iterator i = tests.iterator();
+        List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(getFilename());
+        Iterator<SPFYamlTestDescriptor> i = tests.iterator();
         while (i.hasNext() && data == null) {
-            SPFYamlTestDescriptor def = (SPFYamlTestDescriptor) i.next();
+            SPFYamlTestDescriptor def = i.next();
             if (name.equals(def.getComment()+" #COMPLETE!")) {
                 data = def;
                 this.test = null;
             } else {
-                Iterator j = def.getTests().keySet().iterator();
+                Iterator<String> j = def.getTests().keySet().iterator();
                 while (j.hasNext() && data == null) {
-                    String test = (String) j.next();
+                    String test = j.next();
                     if (name.equals(def.getComment()+ " #"+test)) {
                         data = def;
                         this.test = test;
@@ -216,17 +216,17 @@
             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();
+            Map<String,SPFResult> queries = new HashMap<String,SPFResult>();
+            for (Iterator<String> i = data.getTests().keySet().iterator(); i.hasNext();
) {
+                String next = i.next();
                 SPFResult res = runSingleTest(next);
                 queries.put(next, res);
             }
             AssertionFailedError firstError = null; 
-            for (Iterator i = queries.keySet().iterator(); i.hasNext(); ) {
-                String next = (String) i.next();
+            for (Iterator<String> i = queries.keySet().iterator(); i.hasNext(); ) {
+                String next = i.next();
                 try {
-                    verifyResult(next, (SPFResult) queries.get(next));
+                    verifyResult(next, queries.get(next));
                 } catch (AssertionFailedError e) {
                     log.getChildLogger(next).info("FAILED. "+e.getMessage()+" ("+getName()+")",
e.getMessage()==null ? e : null);
                     if (firstError == null) firstError = e;
@@ -264,12 +264,12 @@
 
     private void verifyResult(String testName, SPFResult res) {
         String resultSPF = res.getResult();
-        HashMap currentTest = (HashMap) data.getTests().get(testName);
+        HashMap<String,Object> currentTest = data.getTests().get(testName);
         Logger testLogger = log.getChildLogger(testName+"-verify");
         if (currentTest.get("result") instanceof String) {
             assertEquals("Test "+testName+" ("+currentTest.get("description")+") failed.
Returned: "+resultSPF+" Expected: "+currentTest.get("result")+" [["+resultSPF+"||"+res.getHeaderText()+"]]",
currentTest.get("result"), resultSPF);
         } else {
-            ArrayList results = (ArrayList) currentTest.get("result");
+            ArrayList<String> results = (ArrayList<String>) currentTest.get("result");
             boolean match = false;
             for (int i = 0; i < results.size(); i++) {
                 if (results.get(i).equals(resultSPF)) match = true;
@@ -352,8 +352,8 @@
         
         DNSServiceXBillImpl serviceXBillImpl = new DNSServiceXBillImpl(log) {
 
-            public List getLocalDomainNames() {
-                List l = new ArrayList();
+            public List<String> getLocalDomainNames() {
+                List<String> l = new ArrayList<String>();
                 l.add("localdomain.foo.bar");
                 return l; 
             }
@@ -380,16 +380,16 @@
 
     final class SPFYamlDNSService implements DNSService {
 
-        private HashMap zonedata;
+        private HashMap<String,Object> zonedata;
         private int recordLimit;
 
-        public SPFYamlDNSService(HashMap zonedata) {
+        public SPFYamlDNSService(HashMap<String,Object> zonedata) {
             this.zonedata = zonedata;
             this.recordLimit = 10;
         }
 
-        public List getLocalDomainNames() {
-            List l = new ArrayList();
+        public List<String> getLocalDomainNames() {
+            List<String> l = new ArrayList<String>();
             l.add("localdomain.foo.bar");
             return l; 
         }
@@ -411,14 +411,14 @@
             this.recordLimit = recordLimit;
         }
 
-        public List getRecords(DNSRequest request) throws TimeoutException {
+        public List<String> getRecords(DNSRequest request) throws TimeoutException
{
             return getRecords(request.getHostname(), request.getRecordType(), 6);
         }
 
-        public List getRecords(String hostname, int recordType, int depth) throws TimeoutException
{
+        public List<String> getRecords(String hostname, int recordType, int depth)
throws TimeoutException {
             String type = getRecordTypeDescription(recordType);
 
-            List res;
+            List<String> res;
             
             // remove trailing dot before running the search.
             if (hostname.endsWith(".")) hostname = hostname.substring(0, hostname.length()-1);
@@ -427,32 +427,32 @@
             hostname = hostname.toLowerCase(Locale.US);
             
             if (zonedata.get(hostname) != null) {
-                List l = (List) zonedata.get(hostname);
-                Iterator i = l.iterator();
-                res = new ArrayList();
+                List<Object> l = (List<Object>) zonedata.get(hostname);
+                Iterator<Object> i = l.iterator();
+                res = new ArrayList<String>();
                 while (i.hasNext()) {
                     Object o = i.next();
                     if (o instanceof HashMap) {
-                        HashMap hm = (HashMap) o;
+                        HashMap<String,Object> hm = (HashMap<String,Object>)
o;
                         if (hm.get(type) != null) {
                             if (recordType == DNSRequest.MX) {
-                                List mxList = (List) hm.get(type);
+                                List<String> mxList = (List<String>) hm.get(type);
     
                                 // For MX records we overwrite the result ignoring the priority.
-                                Iterator mxs = mxList.iterator();
+                                Iterator<String> mxs = mxList.iterator();
                                 while (mxs.hasNext()) {
                                     // skip the MX priority
                                     mxs.next();
-                                    String cname = (String) mxs.next();
+                                    String cname = mxs.next();
                                     res.add(cname);
                                 }
                             } else {
                                 Object obj = hm.get(type);
                                 
                                 if (obj instanceof String) {
-                                    res.add(obj);
+                                    res.add((String)obj);
                                 } else if (obj instanceof ArrayList) {
-                                    ArrayList a = (ArrayList) obj;
+                                    ArrayList<String> a = (ArrayList<String>)
obj;
                                     StringBuffer sb = new StringBuffer();
                                     
                                     for (int i2 = 0; i2 < a.size(); i2++) {

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/LoggingDNSService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/LoggingDNSService.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/LoggingDNSService.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/LoggingDNSService.java Sat
Aug  8 18:30:05 2009
@@ -35,17 +35,29 @@
         this.dnsService = service;
         this.logger = logger;
     }
-    
+
+    /**
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.core.DNSService#getRecordLimit()
+     */
     public int getRecordLimit() {
         return dnsService.getRecordLimit();
     }
 
+    /**
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.core.DNSService#setRecordLimit(int)
+     */
     public void setRecordLimit(int recordLimit) {
         dnsService.setRecordLimit(recordLimit);
     }
 
-    public List getLocalDomainNames() {
-        List res = dnsService.getLocalDomainNames();
+    /**
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.core.DNSService#getLocalDomainNames()
+     */
+    public List<String> getLocalDomainNames() {
+        List<String> res = dnsService.getLocalDomainNames();
         StringBuffer logBuff = new StringBuffer();
         logBuff.append("getLocalDomainNames() = ");
         if (res != null) {
@@ -65,13 +77,21 @@
 
     }
 
+    /**
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.core.DNSService#setTimeOut(int)
+     */
     public void setTimeOut(int timeOut) {
         dnsService.setTimeOut(timeOut);
     }
 
-    public List getRecords(DNSRequest request) throws TimeoutException {
+    /**
+     * (non-Javadoc)
+     * @see org.apache.james.jspf.core.DNSService#getRecords(org.apache.james.jspf.core.DNSRequest)
+     */
+    public List<String> getRecords(DNSRequest request) throws TimeoutException {
         try {
-            List result = dnsService.getRecords(request);
+            List<String> result = dnsService.getRecords(request);
             StringBuffer logBuff = new StringBuffer();
             logBuff.append("getRecords(" + request.getHostname() + "," + request.getRecordType()
+ ") = ");
             if (result != null) {

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
(original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneAsynchronousYamlTest.java
Sat Aug  8 18:30:05 2009
@@ -77,10 +77,10 @@
 
         public MailZoneAsynchronousSuite() throws IOException {
             super();
-            List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-            Iterator i = tests.iterator();
+            List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+            Iterator<SPFYamlTestDescriptor> i = tests.iterator();
             while (i.hasNext()) {
-                SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
+                SPFYamlTestDescriptor o = i.next();
                 addTest(new MailZoneAsynchronousYamlTest(o));
             }
         }

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/MailZoneYamlTest.java Sat
Aug  8 18:30:05 2009
@@ -68,13 +68,13 @@
 
         public MailZoneSuite() throws IOException {
             super();
-            List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-            Iterator i = tests.iterator();
+            List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+            Iterator<SPFYamlTestDescriptor> i = tests.iterator();
             while (i.hasNext()) {
-                SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-                Iterator ttt = o.getTests().keySet().iterator();
+                SPFYamlTestDescriptor o = i.next();
+                Iterator<String> ttt = o.getTests().keySet().iterator();
                 while (ttt.hasNext()) {
-                    addTest(new MailZoneYamlTest(o,(String) ttt.next()));
+                    addTest(new MailZoneYamlTest(o,ttt.next()));
                 }
             }
         }

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
(original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408AsynchronousYamlTest.java
Sat Aug  8 18:30:05 2009
@@ -70,10 +70,10 @@
 
         public RFC4408AsynchronousSuite() throws IOException {
             super();
-            List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-            Iterator i = tests.iterator();
+            List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+            Iterator<SPFYamlTestDescriptor> i = tests.iterator();
             while (i.hasNext()) {
-                SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
+                SPFYamlTestDescriptor o = i.next();
                 addTest(new RFC4408AsynchronousYamlTest(o));
             }
         }
@@ -94,13 +94,13 @@
     public static void main(String[] args) throws Throwable {
         Logger l = new Log4JLogger(org.apache.log4j.Logger.getLogger("ROOT"));
 
-        List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-        Iterator i = tests.iterator();
+        List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+        Iterator<SPFYamlTestDescriptor> i = tests.iterator();
         while (i.hasNext()) {
             SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-            Iterator ttt = o.getTests().keySet().iterator();
+            Iterator<String> ttt = o.getTests().keySet().iterator();
             while (ttt.hasNext()) {
-                RFC4408AsynchronousYamlTest t = new RFC4408AsynchronousYamlTest(o,(String)
ttt.next());
+                RFC4408AsynchronousYamlTest t = new RFC4408AsynchronousYamlTest(o, ttt.next());
                 t.setLogger(l);
                 TestRunner.run(t);
             }

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/RFC4408YamlTest.java Sat
Aug  8 18:30:05 2009
@@ -64,13 +64,13 @@
         public RFC4408Suite() throws IOException {
             super();
             try {
-                List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-                Iterator i = tests.iterator();
+                List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+                Iterator<SPFYamlTestDescriptor> i = tests.iterator();
                 while (i.hasNext()) {
-                    SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-                    Iterator ttt = o.getTests().keySet().iterator();
+                    SPFYamlTestDescriptor o = i.next();
+                    Iterator<String> ttt = o.getTests().keySet().iterator();
                     while (ttt.hasNext()) {
-                        addTest(new RFC4408YamlTest(o,(String) ttt.next()));
+                        addTest(new RFC4408YamlTest(o, ttt.next()));
                     }
                 }
             } catch (RuntimeException e) {
@@ -100,11 +100,11 @@
     public static void main(String[] args) throws Throwable {
         Logger l = new Log4JLogger(org.apache.log4j.Logger.getLogger("ROOT"));
 
-        List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-        Iterator i = tests.iterator();
+        List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+        Iterator<SPFYamlTestDescriptor> i = tests.iterator();
         while (i.hasNext()) {
             SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-            Iterator ttt = o.getTests().keySet().iterator();
+            Iterator<String> ttt = o.getTests().keySet().iterator();
             while (ttt.hasNext()) {
                 RFC4408YamlTest t = new RFC4408YamlTest(o,(String) ttt.next());
                 t.setLogger(l);

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPF1ParserTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPF1ParserTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPF1ParserTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPF1ParserTest.java Sat
Aug  8 18:30:05 2009
@@ -42,10 +42,10 @@
 
     public SPF1ParserTest(String name) throws IOException {
         super(name);
-        List tests = loadTests();
-        Iterator i = tests.iterator();
+        List<SPF1RecordTestDef> tests = loadTests();
+        Iterator<SPF1RecordTestDef> i = tests.iterator();
         while (i.hasNext()) {
-            SPF1RecordTestDef def = (SPF1RecordTestDef) i.next();
+            SPF1RecordTestDef def = i.next();
             if (name.equals(def.recIn)) {
                 data = def;
                 break;
@@ -98,8 +98,8 @@
 
     }
 
-    public static List loadTests() throws IOException {
-        List tests = new ArrayList();
+    public static List<SPF1RecordTestDef> loadTests() throws IOException {
+        List<SPF1RecordTestDef> tests = new ArrayList<SPF1RecordTestDef>();
 
         BufferedReader br = new BufferedReader(new InputStreamReader(Thread
                 .currentThread().getContextClassLoader().getResourceAsStream(
@@ -169,8 +169,8 @@
 
         public SPF1RecordTestSuite() throws IOException {
             super();
-            List tests = loadTests();
-            Iterator i = tests.iterator();
+            List<SPF1RecordTestDef> tests = loadTests();
+            Iterator<SPF1RecordTestDef> i = tests.iterator();
             SPFRecordParser parser = new RFC4408SPF1Parser(new ConsoleLogger(), new DefaultTermsFactory(new
ConsoleLogger()));
             while (i.hasNext()) {
                 addTest(new SPF1ParserTest((SPF1RecordTestDef) i.next(), parser));

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPFYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPFYamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPFYamlTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/SPFYamlTest.java Sat Aug
 8 18:30:05 2009
@@ -53,13 +53,13 @@
 
         public SPFSuite() throws IOException {
             super();
-            List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE);
-            Iterator i = tests.iterator();
+            List<SPFYamlTestDescriptor> tests = SPFYamlTestDescriptor.loadTests(YAMLFILE);
+            Iterator<SPFYamlTestDescriptor> i = tests.iterator();
             while (i.hasNext()) {
-                SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-                Iterator ttt = o.getTests().keySet().iterator();
+                SPFYamlTestDescriptor o = i.next();
+                Iterator<String> ttt = o.getTests().keySet().iterator();
                 while (ttt.hasNext()) {
-                    addTest(new SPFYamlTest(o,(String) ttt.next()));
+                    addTest(new SPFYamlTest(o, ttt.next()));
                 }
             }
         }

Modified: james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/YamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/YamlTest.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/YamlTest.java (original)
+++ james/jspf/trunk/resolver/src/test/java/org/apache/james/jspf/YamlTest.java Sat Aug  8
18:30:05 2009
@@ -56,13 +56,13 @@
 
         public BasicSuite() throws IOException {
             super();
-            List tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
-            Iterator i = tests.iterator();
+            List <SPFYamlTestDescriptor>tests = SPFYamlTestDescriptor.loadTests(YAMLFILE2);
+            Iterator<SPFYamlTestDescriptor> i = tests.iterator();
             while (i.hasNext()) {
-                SPFYamlTestDescriptor o = (SPFYamlTestDescriptor) i.next();
-                Iterator ttt = o.getTests().keySet().iterator();
+                SPFYamlTestDescriptor o = i.next();
+                Iterator<String> ttt = o.getTests().keySet().iterator();
                 while (ttt.hasNext()) {
-                    addTest(new YamlTest(o,(String) ttt.next()));
+                    addTest(new YamlTest(o, ttt.next()));
                 }
             }
         }

Modified: james/jspf/trunk/tester/src/main/java/org/apache/james/jspf/tester/SPFYamlTestDescriptor.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/tester/src/main/java/org/apache/james/jspf/tester/SPFYamlTestDescriptor.java?rev=802431&r1=802430&r2=802431&view=diff
==============================================================================
--- james/jspf/trunk/tester/src/main/java/org/apache/james/jspf/tester/SPFYamlTestDescriptor.java
(original)
+++ james/jspf/trunk/tester/src/main/java/org/apache/james/jspf/tester/SPFYamlTestDescriptor.java
Sat Aug  8 18:30:05 2009
@@ -42,7 +42,7 @@
  */
 public class SPFYamlTestDescriptor {
     private String comment;
-    private HashMap tests;
+    private HashMap<String,HashMap<String,Object>> tests;
     private HashMap zonedata;
     
     public SPFYamlTestDescriptor(HashMap source, int i) {
@@ -60,10 +60,10 @@
     public void setComment(String comment) {
         this.comment = comment;
     }
-    public HashMap getTests() {
+    public HashMap<String,HashMap<String,Object>> getTests() {
         return tests;
     }
-    public void setTests(HashMap tests) {
+    public void setTests(HashMap<String, HashMap<String,Object>> tests) {
         this.tests = tests;
     }
     public HashMap getZonedata() {
@@ -79,8 +79,8 @@
         }
     }
     
-    public static List loadTests(String filename) throws IOException {
-        List tests = new ArrayList();
+    public static List<SPFYamlTestDescriptor> loadTests(String filename) throws IOException
{
+        List<SPFYamlTestDescriptor> tests = new ArrayList<SPFYamlTestDescriptor>();
     
         InputStream is = SPFYamlTestDescriptor.class.getResourceAsStream(filename);
         



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