Class MockServletContext
java.lang.Object
org.apache.commons.chain.web.javax.servlet.MockServletContext
- All Implemented Interfaces:
javax.servlet.ServletContext
Mock Object for
ServletContext
(Version 2.3)-
Field Summary
Fields inherited from interface javax.servlet.ServletContext
ORDERED_LIBS, TEMPDIR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.servlet.FilterRegistration.Dynamic
javax.servlet.FilterRegistration.Dynamic
javax.servlet.FilterRegistration.Dynamic
void
addInitParameter
(String name, String value) javax.servlet.ServletRegistration.Dynamic
addJspFile
(String servletName, String jspFile) void
addListener
(Class<? extends EventListener> listenerClass) void
addListener
(String className) <T extends EventListener>
voidaddListener
(T t) javax.servlet.ServletRegistration.Dynamic
addServlet
(String servletName, Class<? extends javax.servlet.Servlet> servletClass) javax.servlet.ServletRegistration.Dynamic
addServlet
(String servletName, String className) javax.servlet.ServletRegistration.Dynamic
addServlet
(String servletName, javax.servlet.Servlet servlet) <T extends javax.servlet.Filter>
TcreateFilter
(Class<T> clazz) <T extends EventListener>
TcreateListener
(Class<T> clazz) <T extends javax.servlet.Servlet>
TcreateServlet
(Class<T> clazz) void
declareRoles
(String... roleNames) getAttribute
(String name) javax.servlet.ServletContext
getContext
(String uripath) Set
<javax.servlet.SessionTrackingMode> int
int
Set
<javax.servlet.SessionTrackingMode> javax.servlet.FilterRegistration
getFilterRegistration
(String filterName) getInitParameter
(String name) javax.servlet.descriptor.JspConfigDescriptor
int
getMimeType
(String path) int
javax.servlet.RequestDispatcher
getNamedDispatcher
(String name) getRealPath
(String path) javax.servlet.RequestDispatcher
getRequestDispatcher
(String path) getResource
(String path) getResourceAsStream
(String path) getResourcePaths
(String path) javax.servlet.Servlet
getServlet
(String name) Deprecated.Deprecated.javax.servlet.ServletRegistration
getServletRegistration
(String servletName) Enumeration
<javax.servlet.Servlet> Deprecated.javax.servlet.SessionCookieConfig
int
void
Deprecated.void
void
void
removeAttribute
(String name) void
setAttribute
(String name, Object value) boolean
setInitParameter
(String name, String value) void
setRequestCharacterEncoding
(String encoding) void
setResponseCharacterEncoding
(String encoding) void
setSessionTimeout
(int sessionTimeout) void
setSessionTrackingModes
(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
-
Constructor Details
-
MockServletContext
public MockServletContext()The Default-Constructor for this class.
-
-
Method Details
-
addInitParameter
-
getAttribute
- Specified by:
getAttribute
in interfacejavax.servlet.ServletContext
-
getAttributeNames
- Specified by:
getAttributeNames
in interfacejavax.servlet.ServletContext
-
getContext
- Specified by:
getContext
in interfacejavax.servlet.ServletContext
-
getInitParameter
- Specified by:
getInitParameter
in interfacejavax.servlet.ServletContext
-
getInitParameterNames
- Specified by:
getInitParameterNames
in interfacejavax.servlet.ServletContext
-
getMajorVersion
- Specified by:
getMajorVersion
in interfacejavax.servlet.ServletContext
-
getMimeType
- Specified by:
getMimeType
in interfacejavax.servlet.ServletContext
-
getMinorVersion
- Specified by:
getMinorVersion
in interfacejavax.servlet.ServletContext
-
getNamedDispatcher
- Specified by:
getNamedDispatcher
in interfacejavax.servlet.ServletContext
-
getRealPath
- Specified by:
getRealPath
in interfacejavax.servlet.ServletContext
-
getRequestDispatcher
- Specified by:
getRequestDispatcher
in interfacejavax.servlet.ServletContext
-
getResource
- Specified by:
getResource
in interfacejavax.servlet.ServletContext
- Throws:
MalformedURLException
-
getResourceAsStream
- Specified by:
getResourceAsStream
in interfacejavax.servlet.ServletContext
-
getResourcePaths
- Specified by:
getResourcePaths
in interfacejavax.servlet.ServletContext
-
getServlet
@Deprecated public javax.servlet.Servlet getServlet(String name) throws javax.servlet.ServletException Deprecated.- Specified by:
getServlet
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getServletContextName
- Specified by:
getServletContextName
in interfacejavax.servlet.ServletContext
-
getServerInfo
- Specified by:
getServerInfo
in interfacejavax.servlet.ServletContext
-
getServlets
Deprecated.- Specified by:
getServlets
in interfacejavax.servlet.ServletContext
-
getServletNames
Deprecated.- Specified by:
getServletNames
in interfacejavax.servlet.ServletContext
-
log
- Specified by:
log
in interfacejavax.servlet.ServletContext
-
log
Deprecated.- Specified by:
log
in interfacejavax.servlet.ServletContext
-
log
- Specified by:
log
in interfacejavax.servlet.ServletContext
-
removeAttribute
- Specified by:
removeAttribute
in interfacejavax.servlet.ServletContext
-
setAttribute
- Specified by:
setAttribute
in interfacejavax.servlet.ServletContext
-
getContextPath
- Specified by:
getContextPath
in interfacejavax.servlet.ServletContext
-
getEffectiveMajorVersion
- Specified by:
getEffectiveMajorVersion
in interfacejavax.servlet.ServletContext
-
getEffectiveMinorVersion
- Specified by:
getEffectiveMinorVersion
in interfacejavax.servlet.ServletContext
-
setInitParameter
- Specified by:
setInitParameter
in interfacejavax.servlet.ServletContext
-
addServlet
- Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
addServlet
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, javax.servlet.Servlet servlet) - Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
addServlet
public javax.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends javax.servlet.Servlet> servletClass) - Specified by:
addServlet
in interfacejavax.servlet.ServletContext
-
addJspFile
- Specified by:
addJspFile
in interfacejavax.servlet.ServletContext
-
createServlet
public <T extends javax.servlet.Servlet> T createServlet(Class<T> clazz) throws javax.servlet.ServletException - Specified by:
createServlet
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getServletRegistration
- Specified by:
getServletRegistration
in interfacejavax.servlet.ServletContext
-
getServletRegistrations
- Specified by:
getServletRegistrations
in interfacejavax.servlet.ServletContext
-
addFilter
- Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
addFilter
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, javax.servlet.Filter filter) - Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
addFilter
public javax.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends javax.servlet.Filter> filterClass) - Specified by:
addFilter
in interfacejavax.servlet.ServletContext
-
createFilter
public <T extends javax.servlet.Filter> T createFilter(Class<T> clazz) throws javax.servlet.ServletException - Specified by:
createFilter
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getFilterRegistration
- Specified by:
getFilterRegistration
in interfacejavax.servlet.ServletContext
-
getFilterRegistrations
- Specified by:
getFilterRegistrations
in interfacejavax.servlet.ServletContext
-
getSessionCookieConfig
- Specified by:
getSessionCookieConfig
in interfacejavax.servlet.ServletContext
-
setSessionTrackingModes
- Specified by:
setSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
getDefaultSessionTrackingModes
- Specified by:
getDefaultSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
getEffectiveSessionTrackingModes
- Specified by:
getEffectiveSessionTrackingModes
in interfacejavax.servlet.ServletContext
-
addListener
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
addListener
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
addListener
- Specified by:
addListener
in interfacejavax.servlet.ServletContext
-
createListener
public <T extends EventListener> T createListener(Class<T> clazz) throws javax.servlet.ServletException - Specified by:
createListener
in interfacejavax.servlet.ServletContext
- Throws:
javax.servlet.ServletException
-
getJspConfigDescriptor
- Specified by:
getJspConfigDescriptor
in interfacejavax.servlet.ServletContext
-
getClassLoader
- Specified by:
getClassLoader
in interfacejavax.servlet.ServletContext
-
declareRoles
- Specified by:
declareRoles
in interfacejavax.servlet.ServletContext
-
getVirtualServerName
- Specified by:
getVirtualServerName
in interfacejavax.servlet.ServletContext
-
getSessionTimeout
- Specified by:
getSessionTimeout
in interfacejavax.servlet.ServletContext
-
setSessionTimeout
- Specified by:
setSessionTimeout
in interfacejavax.servlet.ServletContext
-
getRequestCharacterEncoding
- Specified by:
getRequestCharacterEncoding
in interfacejavax.servlet.ServletContext
-
setRequestCharacterEncoding
- Specified by:
setRequestCharacterEncoding
in interfacejavax.servlet.ServletContext
-
getResponseCharacterEncoding
- Specified by:
getResponseCharacterEncoding
in interfacejavax.servlet.ServletContext
-
setResponseCharacterEncoding
- Specified by:
setResponseCharacterEncoding
in interfacejavax.servlet.ServletContext
-