public class MockMultipartRequestHandler extends Object implements MultipartRequestHandler
Mock MultipartRequestHandler object for unit tests.
ATTRIBUTE_MAX_LENGTH_EXCEEDED| Constructor and Description |
|---|
MockMultipartRequestHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Mock
finish() method does nothing. |
Hashtable |
getAllElements()
This method returns all elements of a multipart request.
|
Hashtable |
getFileElements()
This method is called on to retrieve all the FormFile
input elements of the request.
|
ActionMapping |
getMapping()
Get the ActionMapping instance for this mock request.
|
ActionServlet |
getServlet()
Get the mock ActionServlet instance.
|
Hashtable |
getTextElements()
This method is called on to retrieve all the text
input elements of the request.
|
void |
handleRequest(javax.servlet.http.HttpServletRequest request)
Mock parsing of the ServletInputStream.
|
void |
rollback()
Mock
rollback() method does nothing. |
void |
setMapping(ActionMapping mapping)
Convienience method to set a reference to a mock
ActionMapping instance.
|
void |
setServlet(ActionServlet servlet)
Convienience method to set a reference to a mock
ActionServlet instance.
|
public void setServlet(ActionServlet servlet)
setServlet in interface MultipartRequestHandlerservlet - Mock servlet instance.public void setMapping(ActionMapping mapping)
setMapping in interface MultipartRequestHandlermapping - Mock action mapping instance.public ActionServlet getServlet()
getServlet in interface MultipartRequestHandlerpublic ActionMapping getMapping()
getMapping in interface MultipartRequestHandlerpublic void handleRequest(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
Mock parsing of the ServletInputStream.
Constructs a Hashtable of elements
from the HttpServletRequest's parameters - no
FormFile elements are created.
handleRequest in interface MultipartRequestHandlerrequest - Mock request instance.javax.servlet.ServletException - If there is a problem with
processing the request.public Hashtable getTextElements()
getTextElements in interface MultipartRequestHandlerpublic Hashtable getFileElements()
This method is called on to retrieve all the FormFile input elements of the request.
getFileElements in interface MultipartRequestHandlerHashtableFormFilepublic Hashtable getAllElements()
getAllElements in interface MultipartRequestHandlerpublic void rollback()
rollback() method does nothing.rollback in interface MultipartRequestHandlerpublic void finish()
finish() method does nothing.finish in interface MultipartRequestHandlerCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.