public class MockServletConfig extends Object implements ServletConfig
ServletConfig interface.
Used for testing the web framework; typically not necessary for testing application controllers.
| Constructor and Description |
|---|
MockServletConfig()
Create a new MockServletConfig with a default
MockServletContext. |
MockServletConfig(ServletContext servletContext)
Create a new MockServletConfig.
|
MockServletConfig(ServletContext servletContext,
String servletName)
Create a new MockServletConfig.
|
MockServletConfig(String servletName)
Create a new MockServletConfig with a default
MockServletContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
addInitParameter(String name,
String value) |
String |
getInitParameter(String name) |
Enumeration<String> |
getInitParameterNames() |
ServletContext |
getServletContext() |
String |
getServletName() |
public MockServletConfig()
MockServletContext.public MockServletConfig(String servletName)
MockServletContext.servletName - the name of the servletpublic MockServletConfig(ServletContext servletContext)
servletContext - the ServletContext that the servlet runs inpublic MockServletConfig(ServletContext servletContext, String servletName)
servletContext - the ServletContext that the servlet runs inservletName - the name of the servletpublic String getServletName()
getServletName in interface ServletConfigpublic ServletContext getServletContext()
getServletContext in interface ServletConfigpublic String getInitParameter(String name)
getInitParameter in interface ServletConfigpublic Enumeration<String> getInitParameterNames()
getInitParameterNames in interface ServletConfig