@ConsumerType
public class MockServletContext
extends java.lang.Object
implements javax.servlet.ServletContext
ServletContext
implementation.Constructor and Description |
---|
MockServletContext() |
Modifier and Type | Method and Description |
---|---|
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.Class<? extends javax.servlet.Filter> filterClass) |
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
javax.servlet.Filter filter) |
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String filterName,
java.lang.String className) |
void |
addListener(java.lang.Class<? extends java.util.EventListener> listenerClass) |
void |
addListener(java.lang.String pClassName) |
<T extends java.util.EventListener> |
addListener(T listener) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.Class<? extends javax.servlet.Servlet> servletClass) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
javax.servlet.Servlet servlet) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String servletName,
java.lang.String className) |
<T extends javax.servlet.Filter> |
createFilter(java.lang.Class<T> clazz) |
<T extends java.util.EventListener> |
createListener(java.lang.Class<T> clazz) |
<T extends javax.servlet.Servlet> |
createServlet(java.lang.Class<T> clazz) |
void |
declareRoles(java.lang.String... roleNames) |
java.lang.Object |
getAttribute(java.lang.String name) |
java.util.Enumeration<java.lang.String> |
getAttributeNames() |
java.lang.ClassLoader |
getClassLoader() |
javax.servlet.ServletContext |
getContext(java.lang.String uriPath) |
java.lang.String |
getContextPath() |
java.util.Set<javax.servlet.SessionTrackingMode> |
getDefaultSessionTrackingModes() |
int |
getEffectiveMajorVersion() |
int |
getEffectiveMinorVersion() |
java.util.Set<javax.servlet.SessionTrackingMode> |
getEffectiveSessionTrackingModes() |
javax.servlet.FilterRegistration |
getFilterRegistration(java.lang.String filterName) |
java.util.Map<java.lang.String,? extends javax.servlet.FilterRegistration> |
getFilterRegistrations() |
java.lang.String |
getInitParameter(java.lang.String name) |
java.util.Enumeration<java.lang.String> |
getInitParameterNames() |
javax.servlet.descriptor.JspConfigDescriptor |
getJspConfigDescriptor() |
int |
getMajorVersion() |
java.lang.String |
getMimeType(java.lang.String file) |
int |
getMinorVersion() |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String name) |
java.lang.String |
getRealPath(java.lang.String pPath) |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path) |
java.net.URL |
getResource(java.lang.String pPath) |
java.io.InputStream |
getResourceAsStream(java.lang.String path) |
java.util.Set<java.lang.String> |
getResourcePaths(java.lang.String path) |
java.lang.String |
getServerInfo() |
javax.servlet.Servlet |
getServlet(java.lang.String name) |
java.lang.String |
getServletContextName() |
java.util.Enumeration<java.lang.String> |
getServletNames() |
javax.servlet.ServletRegistration |
getServletRegistration(java.lang.String servletName) |
java.util.Map<java.lang.String,? extends javax.servlet.ServletRegistration> |
getServletRegistrations() |
java.util.Enumeration<javax.servlet.Servlet> |
getServlets() |
javax.servlet.SessionCookieConfig |
getSessionCookieConfig() |
java.lang.String |
getVirtualServerName() |
void |
log(java.lang.Exception exception,
java.lang.String msg) |
void |
log(java.lang.String msg) |
void |
log(java.lang.String msg,
java.lang.Throwable throwable) |
void |
removeAttribute(java.lang.String name) |
void |
setAttribute(java.lang.String name,
java.lang.Object object) |
boolean |
setInitParameter(java.lang.String name,
java.lang.String value) |
void |
setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes) |
public java.lang.String getMimeType(java.lang.String file)
getMimeType
in interface javax.servlet.ServletContext
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.ServletContext
public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletContext
public javax.servlet.ServletContext getContext(java.lang.String uriPath)
getContext
in interface javax.servlet.ServletContext
public java.lang.String getContextPath()
getContextPath
in interface javax.servlet.ServletContext
public java.lang.String getInitParameter(java.lang.String name)
getInitParameter
in interface javax.servlet.ServletContext
public java.util.Enumeration<java.lang.String> getInitParameterNames()
getInitParameterNames
in interface javax.servlet.ServletContext
public int getMajorVersion()
getMajorVersion
in interface javax.servlet.ServletContext
public int getMinorVersion()
getMinorVersion
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String name)
getNamedDispatcher
in interface javax.servlet.ServletContext
public java.lang.String getRealPath(java.lang.String pPath)
getRealPath
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher
in interface javax.servlet.ServletContext
public java.net.URL getResource(java.lang.String pPath)
getResource
in interface javax.servlet.ServletContext
public java.io.InputStream getResourceAsStream(java.lang.String path)
getResourceAsStream
in interface javax.servlet.ServletContext
public java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
getResourcePaths
in interface javax.servlet.ServletContext
public java.lang.String getServerInfo()
getServerInfo
in interface javax.servlet.ServletContext
public javax.servlet.Servlet getServlet(java.lang.String name)
getServlet
in interface javax.servlet.ServletContext
public java.lang.String getServletContextName()
getServletContextName
in interface javax.servlet.ServletContext
public java.util.Enumeration<java.lang.String> getServletNames()
getServletNames
in interface javax.servlet.ServletContext
public java.util.Enumeration<javax.servlet.Servlet> getServlets()
getServlets
in interface javax.servlet.ServletContext
public void log(java.lang.String msg)
log
in interface javax.servlet.ServletContext
public void log(java.lang.Exception exception, java.lang.String msg)
log
in interface javax.servlet.ServletContext
public void log(java.lang.String msg, java.lang.Throwable throwable)
log
in interface javax.servlet.ServletContext
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.ServletContext
public void setAttribute(java.lang.String name, java.lang.Object object)
setAttribute
in interface javax.servlet.ServletContext
public int getEffectiveMajorVersion()
getEffectiveMajorVersion
in interface javax.servlet.ServletContext
public int getEffectiveMinorVersion()
getEffectiveMinorVersion
in interface javax.servlet.ServletContext
public boolean setInitParameter(java.lang.String name, java.lang.String value)
setInitParameter
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.String className)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String servletName, javax.servlet.Servlet servlet)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String servletName, java.lang.Class<? extends javax.servlet.Servlet> servletClass)
addServlet
in interface javax.servlet.ServletContext
public <T extends javax.servlet.Servlet> T createServlet(java.lang.Class<T> clazz) throws javax.servlet.ServletException
createServlet
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public javax.servlet.ServletRegistration getServletRegistration(java.lang.String servletName)
getServletRegistration
in interface javax.servlet.ServletContext
public java.util.Map<java.lang.String,? extends javax.servlet.ServletRegistration> getServletRegistrations()
getServletRegistrations
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.String className)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String filterName, javax.servlet.Filter filter)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String filterName, java.lang.Class<? extends javax.servlet.Filter> filterClass)
addFilter
in interface javax.servlet.ServletContext
public <T extends javax.servlet.Filter> T createFilter(java.lang.Class<T> clazz) throws javax.servlet.ServletException
createFilter
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public javax.servlet.FilterRegistration getFilterRegistration(java.lang.String filterName)
getFilterRegistration
in interface javax.servlet.ServletContext
public java.util.Map<java.lang.String,? extends javax.servlet.FilterRegistration> getFilterRegistrations()
getFilterRegistrations
in interface javax.servlet.ServletContext
public javax.servlet.SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig
in interface javax.servlet.ServletContext
public void setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes
in interface javax.servlet.ServletContext
public java.util.Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes
in interface javax.servlet.ServletContext
public java.util.Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes
in interface javax.servlet.ServletContext
public void addListener(java.lang.String pClassName)
addListener
in interface javax.servlet.ServletContext
public <T extends java.util.EventListener> void addListener(T listener)
addListener
in interface javax.servlet.ServletContext
public void addListener(java.lang.Class<? extends java.util.EventListener> listenerClass)
addListener
in interface javax.servlet.ServletContext
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> clazz)
createListener
in interface javax.servlet.ServletContext
public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor
in interface javax.servlet.ServletContext
public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface javax.servlet.ServletContext
public void declareRoles(java.lang.String... roleNames)
declareRoles
in interface javax.servlet.ServletContext
public java.lang.String getVirtualServerName()
getVirtualServerName
in interface javax.servlet.ServletContext
Copyright © 2014–2021 wcm.io. All rights reserved.