|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.slim3.struts.test.MockServletContext
public class MockServletContext
A mock implementation for ServletContext.
| Field Summary | |
|---|---|
protected Map<String,Object> |
attributeTable
The map for the attributes. |
protected String |
contextPath
The context path. |
protected Map<String,String> |
initParameterMap
The map for the initial parameters. |
static int |
MAJOR_VERSION
Major Version |
static int |
MINOR_VERSION
Minor Version |
protected Map<String,String> |
realPathMap
The map for initial parameters. |
protected Map<String,URL> |
resourceMap
The map for resource. |
protected Map<String,Set<String>> |
resourcePathsMap
The map for resource paths. |
static String |
SERVER_INFO
Server Info |
protected String |
servletContextName
The servlet context name. |
| Constructor Summary | |
|---|---|
MockServletContext()
Constructor. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAJOR_VERSION
public static final int MINOR_VERSION
public static final String SERVER_INFO
protected String servletContextName
protected String contextPath
protected Map<String,String> initParameterMap
protected Map<String,Object> attributeTable
protected Map<String,Set<String>> resourcePathsMap
protected Map<String,URL> resourceMap
protected Map<String,String> realPathMap
| Constructor Detail |
|---|
public MockServletContext()
| Method Detail |
|---|
public ServletContext getContext(String path)
getContext in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic String getMimeType(String file)
getMimeType in interface ServletContextpublic Set<String> getResourcePaths(String path)
getResourcePaths in interface ServletContext
public void addResourcePaths(String path,
Set<String> resourcePaths)
path - the pathresourcePaths - the resource pathspublic URL getResource(String path)
getResource in interface ServletContext
public void addResource(String path,
URL url)
path - the pathurl - the URL resourcepublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface ServletContextpublic RequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String name)
getNamedDispatcher in interface ServletContext
public Servlet getServlet(String name)
throws ServletException
getServlet in interface ServletContextServletExceptionpublic Enumeration<Servlet> getServlets()
getServlets in interface ServletContextpublic Enumeration<String> getServletNames()
getServletNames in interface ServletContextpublic void log(String message)
log in interface ServletContext
public void log(Exception ex,
String message)
log in interface ServletContext
public void log(String message,
Throwable t)
log in interface ServletContextpublic String getRealPath(String path)
getRealPath in interface ServletContext
public void addRealPath(String path,
String realPath)
path - the context relative pathrealPath - the real pathpublic String getServerInfo()
getServerInfo in interface ServletContextServletContext.getServerInfo()public String getInitParameter(String name)
getInitParameter in interface ServletContextpublic Enumeration<String> getInitParameterNames()
getInitParameterNames in interface ServletContext
public void setInitParameter(String name,
String value)
name - the parameter namevalue - the valuepublic void removeInitParameter(String name)
name - the parameter namepublic Object getAttribute(String name)
getAttribute in interface ServletContextServletContext.getAttribute(java.lang.String)public Enumeration<String> getAttributeNames()
getAttributeNames in interface ServletContext
public void setAttribute(String name,
Object value)
setAttribute in interface ServletContextpublic void removeAttribute(String name)
removeAttribute in interface ServletContextServletContext.removeAttribute(java.lang.String)public String getServletContextName()
getServletContextName in interface ServletContextServletContext.getServletContextName()public void setServletContextName(String servletContextName)
servletContextName - the servlet context namepublic String getContextPath()
getContextPath in interface ServletContextpublic void setContextPath(String contextPath)
contextPath - the context path
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||