Update MockHttpSession across the test suite

This commit is contained in:
Sam Brannen
2012-08-16 13:38:51 +02:00
parent 8059625670
commit 3b9833c538
5 changed files with 109 additions and 43 deletions

View File

@@ -17,12 +17,12 @@
package org.springframework.mock.web;
import java.io.Serializable;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Vector;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionBindingEvent;
@@ -36,6 +36,9 @@ import org.springframework.util.Assert;
*
* <p>Compatible with Servlet 2.5 as well as Servlet 3.0.
*
* <p>Used for testing the web framework; also useful for testing application
* controllers.
*
* @author Juergen Hoeller
* @author Rod Johnson
* @author Mark Fisher
@@ -45,6 +48,8 @@ import org.springframework.util.Assert;
@SuppressWarnings("deprecation")
public class MockHttpSession implements HttpSession {
public static final String SESSION_COOKIE_NAME = "JSESSION";
private static int nextId = 1;
private final String id;
@@ -136,7 +141,7 @@ public class MockHttpSession implements HttpSession {
}
public Enumeration<String> getAttributeNames() {
return new Vector<String>(this.attributes.keySet()).elements();
return Collections.enumeration(this.attributes.keySet());
}
public String[] getValueNames() {