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