wicket-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thran...@apache.org
Subject svn commit: r722035 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
Date Mon, 01 Dec 2008 11:06:45 GMT
Author: thrantal
Date: Mon Dec  1 03:06:43 2008
New Revision: 722035

URL: http://svn.apache.org/viewvc?rev=722035&view=rev
Log:
WICKET-1886: Added a convenience method for adding several cookies at once.

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=722035&r1=722034&r2=722035&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
(original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
Mon Dec  1 03:06:43 2008
@@ -16,6 +16,12 @@
  */
 package org.apache.wicket.protocol.http;
 
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -37,13 +43,6 @@
 import java.util.Locale;
 import java.util.Map;
 
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
 import org.apache.wicket.Application;
 import org.apache.wicket.Component;
 import org.apache.wicket.IPageMap;
@@ -214,6 +213,15 @@
 		cookies.add(cookie);
 	}
 
+	public void addCookies(Iterable<Cookie> cookies)
+	{
+		for (Cookie cookie : cookies)
+		{
+			addCookie(cookie);
+		}
+	}
+
+
 	/**
 	 * Add an uploaded file to the request. Use this to simulate a file that has been uploaded
to a
 	 * field.



Mime
View raw message