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 MultipartRequestHandler
servlet
- Mock servlet instance.public void setMapping(ActionMapping mapping)
setMapping
in interface MultipartRequestHandler
mapping
- Mock action mapping instance.public ActionServlet getServlet()
getServlet
in interface MultipartRequestHandler
public ActionMapping getMapping()
getMapping
in interface MultipartRequestHandler
public 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 MultipartRequestHandler
request
- Mock request instance.javax.servlet.ServletException
- If there is a problem with
processing the request.public Hashtable getTextElements()
getTextElements
in interface MultipartRequestHandler
public Hashtable getFileElements()
This method is called on to retrieve all the FormFile input elements of the request.
getFileElements
in interface MultipartRequestHandler
Hashtable
FormFile
public Hashtable getAllElements()
getAllElements
in interface MultipartRequestHandler
public void rollback()
rollback()
method does nothing.rollback
in interface MultipartRequestHandler
public void finish()
finish()
method does nothing.finish
in interface MultipartRequestHandler
Copyright © 2000–2016 Apache Software Foundation. All rights reserved.