spring-test

org.springframework.mock.web.portlet
Class MockMultipartActionRequest

java.lang.Object
  extended by org.springframework.mock.web.portlet.MockPortletRequest
      extended by org.springframework.mock.web.portlet.MockClientDataRequest
          extended by org.springframework.mock.web.portlet.MockActionRequest
              extended by org.springframework.mock.web.portlet.MockMultipartActionRequest
All Implemented Interfaces:
javax.portlet.ActionRequest, javax.portlet.ClientDataRequest, javax.portlet.PortletRequest, org.springframework.web.multipart.MultipartRequest, org.springframework.web.portlet.multipart.MultipartActionRequest

public class MockMultipartActionRequest
extends MockActionRequest
implements org.springframework.web.portlet.multipart.MultipartActionRequest

Mock implementation of the MultipartActionRequest interface.

Useful for testing application controllers that access multipart uploads. The MockMultipartFile can be used to populate these mock requests with files.

Since:
2.0
Author:
Juergen Hoeller, Arjen Poutsma
See Also:
MockMultipartFile

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.portlet.PortletRequest
javax.portlet.PortletRequest.P3PUserInfos
 
Field Summary
 
Fields inherited from interface javax.portlet.ActionRequest
ACTION_NAME
 
Fields inherited from interface javax.portlet.PortletRequest
ACTION_PHASE, ACTION_SCOPE_ID, BASIC_AUTH, CCPP_PROFILE, CLIENT_CERT_AUTH, DIGEST_AUTH, EVENT_PHASE, FORM_AUTH, LIFECYCLE_PHASE, RENDER_HEADERS, RENDER_MARKUP, RENDER_PART, RENDER_PHASE, RESOURCE_PHASE, USER_INFO
 
Constructor Summary
MockMultipartActionRequest()
           
 
Method Summary
 void addFile(org.springframework.web.multipart.MultipartFile file)
          Add a file to this request.
 org.springframework.web.multipart.MultipartFile getFile(java.lang.String name)
           
 java.util.Map<java.lang.String,org.springframework.web.multipart.MultipartFile> getFileMap()
           
 java.util.Iterator<java.lang.String> getFileNames()
           
 java.util.List<org.springframework.web.multipart.MultipartFile> getFiles(java.lang.String name)
           
 org.springframework.util.MultiValueMap<java.lang.String,org.springframework.web.multipart.MultipartFile> getMultiFileMap()
           
 java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
           
 
Methods inherited from class org.springframework.mock.web.portlet.MockActionRequest
getLifecyclePhase
 
Methods inherited from class org.springframework.mock.web.portlet.MockClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding, setContent, setContentType, setMethod
 
Methods inherited from class org.springframework.mock.web.portlet.MockPortletRequest
addLocale, addParameter, addParameter, addPreferredLocale, addPreferredResponseContentType, addProperty, addResponseContentType, addUserRole, checkActive, close, getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isActive, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, registerPublicParameter, removeAttribute, setAttribute, setAuthType, setContextPath, setCookies, setParameter, setParameter, setParameters, setPortletMode, setPreferences, setProperty, setRemoteUser, setRequestedSessionIdValid, setScheme, setSecure, setServerName, setServerPort, setSession, setUserPrincipal, setWindowID, setWindowState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.portlet.ClientDataRequest
getCharacterEncoding, getContentLength, getContentType, getMethod, getPortletInputStream, getReader, setCharacterEncoding
 
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getCookies, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getPrivateParameterMap, getProperties, getProperty, getPropertyNames, getPublicParameterMap, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowID, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
 

Constructor Detail

MockMultipartActionRequest

public MockMultipartActionRequest()
Method Detail

addFile

public void addFile(org.springframework.web.multipart.MultipartFile file)
Add a file to this request. The parameter name from the multipart form is taken from the MultipartFile.getName().

Parameters:
file - multipart file to be added

getFileNames

public java.util.Iterator<java.lang.String> getFileNames()
Specified by:
getFileNames in interface org.springframework.web.multipart.MultipartRequest

getFile

public org.springframework.web.multipart.MultipartFile getFile(java.lang.String name)
Specified by:
getFile in interface org.springframework.web.multipart.MultipartRequest

getFiles

public java.util.List<org.springframework.web.multipart.MultipartFile> getFiles(java.lang.String name)
Specified by:
getFiles in interface org.springframework.web.multipart.MultipartRequest

getFileMap

public java.util.Map<java.lang.String,org.springframework.web.multipart.MultipartFile> getFileMap()
Specified by:
getFileMap in interface org.springframework.web.multipart.MultipartRequest

getMultiFileMap

public org.springframework.util.MultiValueMap<java.lang.String,org.springframework.web.multipart.MultipartFile> getMultiFileMap()
Specified by:
getMultiFileMap in interface org.springframework.web.multipart.MultipartRequest

getMultipartContentType

public java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
Specified by:
getMultipartContentType in interface org.springframework.web.multipart.MultipartRequest

spring-test