public class MockServletContext
extends java.lang.Object
implements javax.servlet.ServletContext
Constructor and Description |
---|
MockServletContext(java.lang.String realPath) |
Modifier and Type | Method and Description |
---|---|
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String arg0,
java.lang.Class<? extends javax.servlet.Filter> arg1) |
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String arg0,
javax.servlet.Filter arg1) |
javax.servlet.FilterRegistration.Dynamic |
addFilter(java.lang.String arg0,
java.lang.String arg1) |
void |
addListener(java.lang.Class<? extends java.util.EventListener> arg0) |
void |
addListener(java.lang.String arg0) |
<T extends java.util.EventListener> |
addListener(T arg0) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String arg0,
java.lang.Class<? extends javax.servlet.Servlet> arg1) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String arg0,
javax.servlet.Servlet arg1) |
javax.servlet.ServletRegistration.Dynamic |
addServlet(java.lang.String arg0,
java.lang.String arg1) |
<T extends javax.servlet.Filter> |
createFilter(java.lang.Class<T> arg0) |
<T extends java.util.EventListener> |
createListener(java.lang.Class<T> arg0) |
<T extends javax.servlet.Servlet> |
createServlet(java.lang.Class<T> arg0) |
void |
declareRoles(java.lang.String... arg0) |
java.lang.Object |
getAttribute(java.lang.String arg0) |
java.util.Enumeration |
getAttributeNames() |
java.lang.ClassLoader |
getClassLoader() |
javax.servlet.ServletContext |
getContext(java.lang.String arg0) |
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 arg0) |
java.util.Map<java.lang.String,? extends javax.servlet.FilterRegistration> |
getFilterRegistrations() |
java.lang.String |
getInitParameter(java.lang.String arg0) |
java.util.Enumeration |
getInitParameterNames() |
javax.servlet.descriptor.JspConfigDescriptor |
getJspConfigDescriptor() |
int |
getMajorVersion() |
java.lang.String |
getMimeType(java.lang.String arg0) |
int |
getMinorVersion() |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String arg0) |
java.lang.String |
getRealPath(java.lang.String arg0) |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String arg0) |
java.net.URL |
getResource(java.lang.String arg0) |
java.io.InputStream |
getResourceAsStream(java.lang.String arg0) |
java.util.Set |
getResourcePaths(java.lang.String arg0) |
java.lang.String |
getServerInfo() |
javax.servlet.Servlet |
getServlet(java.lang.String arg0)
Deprecated.
|
java.lang.String |
getServletContextName() |
java.util.Enumeration |
getServletNames()
Deprecated.
|
javax.servlet.ServletRegistration |
getServletRegistration(java.lang.String arg0) |
java.util.Map<java.lang.String,? extends javax.servlet.ServletRegistration> |
getServletRegistrations() |
java.util.Enumeration |
getServlets()
Deprecated.
|
javax.servlet.SessionCookieConfig |
getSessionCookieConfig() |
java.lang.String |
getVirtualServerName() |
void |
log(java.lang.Exception arg0,
java.lang.String arg1)
Deprecated.
|
void |
log(java.lang.String arg0) |
void |
log(java.lang.String arg0,
java.lang.Throwable arg1) |
void |
removeAttribute(java.lang.String arg0) |
void |
setAttribute(java.lang.String arg0,
java.lang.Object arg1) |
boolean |
setInitParameter(java.lang.String arg0,
java.lang.String arg1) |
void |
setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> arg0) |
public java.lang.String getServletContextName()
getServletContextName
in interface javax.servlet.ServletContext
public java.lang.String getServerInfo()
getServerInfo
in interface javax.servlet.ServletContext
public java.lang.String getRealPath(java.lang.String arg0)
getRealPath
in interface javax.servlet.ServletContext
public java.net.URL getResource(java.lang.String arg0) throws java.net.MalformedURLException
getResource
in interface javax.servlet.ServletContext
java.net.MalformedURLException
public java.lang.Object getAttribute(java.lang.String arg0)
getAttribute
in interface javax.servlet.ServletContext
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletContext
public void setAttribute(java.lang.String arg0, java.lang.Object arg1)
setAttribute
in interface javax.servlet.ServletContext
public void removeAttribute(java.lang.String arg0)
removeAttribute
in interface javax.servlet.ServletContext
public java.lang.String getInitParameter(java.lang.String arg0)
getInitParameter
in interface javax.servlet.ServletContext
public java.util.Enumeration getInitParameterNames()
getInitParameterNames
in interface javax.servlet.ServletContext
public void log(java.lang.String arg0)
log
in interface javax.servlet.ServletContext
public void log(java.lang.String arg0, java.lang.Throwable arg1)
log
in interface javax.servlet.ServletContext
@Deprecated public void log(java.lang.Exception arg0, java.lang.String arg1)
log
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.ServletContext getContext(java.lang.String arg0)
getContext
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String arg0)
getRequestDispatcher
in interface javax.servlet.ServletContext
public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String arg0)
getNamedDispatcher
in interface javax.servlet.ServletContext
public java.lang.String getMimeType(java.lang.String arg0)
getMimeType
in interface javax.servlet.ServletContext
public java.util.Set getResourcePaths(java.lang.String arg0)
getResourcePaths
in interface javax.servlet.ServletContext
public java.io.InputStream getResourceAsStream(java.lang.String arg0)
getResourceAsStream
in interface javax.servlet.ServletContext
@Deprecated public javax.servlet.Servlet getServlet(java.lang.String arg0) throws javax.servlet.ServletException
getServlet
in interface javax.servlet.ServletContext
javax.servlet.ServletException
@Deprecated public java.util.Enumeration getServlets()
getServlets
in interface javax.servlet.ServletContext
@Deprecated public java.util.Enumeration getServletNames()
getServletNames
in interface javax.servlet.ServletContext
public java.lang.String getContextPath()
getContextPath
in interface javax.servlet.ServletContext
public void addListener(java.lang.String arg0)
addListener
in interface javax.servlet.ServletContext
public <T extends java.util.EventListener> void addListener(T arg0)
addListener
in interface javax.servlet.ServletContext
public void addListener(java.lang.Class<? extends java.util.EventListener> arg0)
addListener
in interface javax.servlet.ServletContext
public <T extends javax.servlet.Filter> T createFilter(java.lang.Class<T> arg0) throws javax.servlet.ServletException
createFilter
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public <T extends java.util.EventListener> T createListener(java.lang.Class<T> arg0) throws javax.servlet.ServletException
createListener
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public <T extends javax.servlet.Servlet> T createServlet(java.lang.Class<T> arg0) throws javax.servlet.ServletException
createServlet
in interface javax.servlet.ServletContext
javax.servlet.ServletException
public void declareRoles(java.lang.String... arg0)
declareRoles
in interface javax.servlet.ServletContext
public java.lang.ClassLoader getClassLoader()
getClassLoader
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 arg0, java.lang.String arg1)
setInitParameter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String arg0, java.lang.String arg1)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String arg0, javax.servlet.Filter arg1)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.FilterRegistration.Dynamic addFilter(java.lang.String arg0, java.lang.Class<? extends javax.servlet.Filter> arg1)
addFilter
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String arg0, java.lang.String arg1)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String arg0, javax.servlet.Servlet arg1)
addServlet
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration.Dynamic addServlet(java.lang.String arg0, java.lang.Class<? extends javax.servlet.Servlet> arg1)
addServlet
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 javax.servlet.FilterRegistration getFilterRegistration(java.lang.String arg0)
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.descriptor.JspConfigDescriptor getJspConfigDescriptor()
getJspConfigDescriptor
in interface javax.servlet.ServletContext
public javax.servlet.ServletRegistration getServletRegistration(java.lang.String arg0)
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.SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig
in interface javax.servlet.ServletContext
public void setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> arg0) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
setSessionTrackingModes
in interface javax.servlet.ServletContext
java.lang.IllegalStateException
java.lang.IllegalArgumentException
public java.lang.String getVirtualServerName()
getVirtualServerName
in interface javax.servlet.ServletContext
Copyright © 2001-2018 Jalios SA. All Rights Reserved.