Browse Source

consistent copies of mocks

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@556 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
633c97ba00
  1. 3
      org.springframework.test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java
  2. 3
      org.springframework.test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java
  3. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java
  4. 3
      org.springframework.test/src/main/java/org/springframework/mock/web/MockBodyContent.java
  5. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java
  6. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockFilterChain.java
  7. 8
      org.springframework.test/src/main/java/org/springframework/mock/web/MockFilterConfig.java
  8. 11
      org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
  9. 4
      org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java
  10. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpSession.java
  11. 3
      org.springframework.test/src/main/java/org/springframework/mock/web/MockJspWriter.java
  12. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockMultipartFile.java
  13. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockMultipartHttpServletRequest.java
  14. 4
      org.springframework.test/src/main/java/org/springframework/mock/web/MockPageContext.java
  15. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockRequestDispatcher.java
  16. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockServletConfig.java
  17. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/MockServletContext.java
  18. 3
      org.springframework.test/src/main/java/org/springframework/mock/web/PassThroughFilterChain.java
  19. 7
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockActionResponse.java
  20. 1
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockClientDataRequest.java
  21. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockEventResponse.java
  22. 1
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockPortletPreferences.java
  23. 2
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java
  24. 4
      org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java

3
org.springframework.test/src/main/java/org/springframework/mock/web/DelegatingServletInputStream.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,7 +18,6 @@ package org.springframework.mock.web; @@ -18,7 +18,6 @@ package org.springframework.mock.web;
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletInputStream;
import org.springframework.util.Assert;

3
org.springframework.test/src/main/java/org/springframework/mock/web/DelegatingServletOutputStream.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,7 +18,6 @@ package org.springframework.mock.web; @@ -18,7 +18,6 @@ package org.springframework.mock.web;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.ServletOutputStream;
import org.springframework.util.Assert;

2
org.springframework.test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

3
org.springframework.test/src/main/java/org/springframework/mock/web/MockBodyContent.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,7 +20,6 @@ import java.io.IOException; @@ -20,7 +20,6 @@ import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyContent;

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockExpressionEvaluator.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockFilterChain.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

8
org.springframework.test/src/main/java/org/springframework/mock/web/MockFilterConfig.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,12 +16,10 @@ @@ -16,12 +16,10 @@
package org.springframework.mock.web;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Collections;
import java.util.Map;
import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;

11
org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,7 +28,6 @@ import java.util.Collections; @@ -28,7 +28,6 @@ import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@ -97,7 +96,7 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -97,7 +96,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
// ServletRequest properties
//---------------------------------------------------------------------
private final Hashtable attributes = new Hashtable();
private final Map<String, Object> attributes = new LinkedHashMap<String, Object>();
private String characterEncoding;
@ -146,7 +145,7 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -146,7 +145,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
/**
* The key is the lowercase header name; the value is a {@link HeaderValueHolder} object.
*/
private final Map<String, HeaderValueHolder> headers = new Hashtable<String, HeaderValueHolder>();
private final Map<String, HeaderValueHolder> headers = new LinkedHashMap<String, HeaderValueHolder>();
private String method;
@ -285,7 +284,7 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -285,7 +284,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
public Enumeration<String> getAttributeNames() {
checkActive();
return this.attributes.keys();
return Collections.enumeration(this.attributes.keySet());
}
public String getCharacterEncoding() {
@ -612,7 +611,7 @@ public class MockHttpServletRequest implements HttpServletRequest { @@ -612,7 +611,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
return this.authType;
}
public void setCookies(Cookie[] cookies) {
public void setCookies(Cookie... cookies) {
this.cookies = cookies;
}

4
org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,12 +26,10 @@ import java.io.Writer; @@ -26,12 +26,10 @@ import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
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 javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockHttpSession.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

3
org.springframework.test/src/main/java/org/springframework/mock/web/MockJspWriter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,7 +19,6 @@ package org.springframework.mock.web; @@ -19,7 +19,6 @@ package org.springframework.mock.web;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspWriter;

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockMultipartFile.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockMultipartHttpServletRequest.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

4
org.springframework.test/src/main/java/org/springframework/mock/web/MockPageContext.java

@ -19,7 +19,7 @@ package org.springframework.mock.web; @@ -19,7 +19,7 @@ package org.springframework.mock.web;
import java.io.IOException;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.el.ELContext;
import javax.servlet.Servlet;
@ -61,7 +61,7 @@ public class MockPageContext extends PageContext { @@ -61,7 +61,7 @@ public class MockPageContext extends PageContext {
private final ServletConfig servletConfig;
private final Map<String, Object> attributes = new HashMap<String, Object>();
private final Map<String, Object> attributes = new LinkedHashMap<String, Object>();
private JspWriter out;

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockRequestDispatcher.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockServletConfig.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
org.springframework.test/src/main/java/org/springframework/mock/web/MockServletContext.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

3
org.springframework.test/src/main/java/org/springframework/mock/web/PassThroughFilterChain.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.mock.web;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.Servlet;

7
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockActionResponse.java

@ -17,11 +17,6 @@ @@ -17,11 +17,6 @@
package org.springframework.mock.web.portlet;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.portlet.ActionResponse;
import javax.portlet.PortalContext;
@ -29,10 +24,8 @@ import javax.portlet.PortletMode; @@ -29,10 +24,8 @@ import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
import javax.xml.namespace.QName;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
/**
* Mock implementation of the {@link javax.portlet.ActionResponse} interface.

1
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockClientDataRequest.java

@ -26,7 +26,6 @@ import java.io.UnsupportedEncodingException; @@ -26,7 +26,6 @@ import java.io.UnsupportedEncodingException;
import javax.portlet.ClientDataRequest;
import javax.portlet.PortalContext;
import javax.portlet.PortletContext;
import javax.portlet.PortletMode;
/**
* Mock implementation of the {@link javax.portlet.ClientDataRequest} interface.

2
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockEventResponse.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.mock.web.portlet;
import javax.portlet.EventResponse;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
/**
* Mock implementation of the {@link javax.portlet.EventResponse} interface.

1
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockPortletPreferences.java

@ -23,7 +23,6 @@ import java.util.HashSet; @@ -23,7 +23,6 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import javax.portlet.PortletPreferences;
import javax.portlet.PreferencesValidator;
import javax.portlet.ReadOnlyException;

2
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java

@ -482,7 +482,7 @@ public class MockPortletRequest implements PortletRequest { @@ -482,7 +482,7 @@ public class MockPortletRequest implements PortletRequest {
return this.windowID;
}
public void setCookies(Cookie[] cookies) {
public void setCookies(Cookie... cookies) {
this.cookies = cookies;
}

4
org.springframework.test/src/main/java/org/springframework/mock/web/portlet/MockStateAwareResponse.java

@ -16,20 +16,18 @@ @@ -16,20 +16,18 @@
package org.springframework.mock.web.portlet;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.portlet.ActionResponse;
import javax.portlet.PortalContext;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.StateAwareResponse;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
import javax.portlet.StateAwareResponse;
import javax.xml.namespace.QName;
import org.springframework.util.Assert;

Loading…
Cancel
Save