velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1145140 - /velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java
Date Mon, 11 Jul 2011 12:31:21 GMT
Author: cbrisson
Date: Mon Jul 11 12:31:20 2011
New Revision: 1145140

URL: http://svn.apache.org/viewvc?rev=1145140&view=rev
Log:
remove a trivial dependency to commons-collections

Modified:
    velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java

Modified: velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java?rev=1145140&r1=1145139&r2=1145140&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java
(original)
+++ velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/test/blackbox/ServletAdaptor.java
Mon Jul 11 12:31:20 2011
@@ -22,10 +22,10 @@ package org.apache.velocity.tools.test.b
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.util.Collections;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import org.apache.commons.collections.iterators.IteratorEnumeration;
 import javax.servlet.ServletContext;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -39,6 +39,15 @@ import javax.servlet.http.HttpServletRes
  */
 public class ServletAdaptor implements InvocationHandler
 {
+    // helper class
+    public class IteratorEnumeration implements Enumeration
+    {
+        private Iterator iterator;
+        public IteratorEnumeration( Iterator iterator ) { this.iterator = iterator; }
+        public boolean hasMoreElements() { return iterator.hasNext(); }
+        public Object nextElement() { return iterator.next(); }
+    }
+
     // the params now also serve as a cookie jar for CookieToolTests
     private Map _params;
     private String _contextPath;



Mime
View raw message