|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.tui.MockServletContext
public class MockServletContext
Partial implementation of the ServletContext where just
enough is present to allow for communication between Mondrian's
XMLA code and other code in the same JVM.
Currently it is used in both the CmdRunner and in XMLA JUnit tests. If you need to add to this implementation, please do so.
| Field Summary | |
|---|---|
static String |
PARAM_CALLBACKS
|
static String |
PARAM_CHAR_ENCODING
|
static String |
PARAM_DATASOURCES_CONFIG
|
| Constructor Summary | |
|---|---|
MockServletContext()
|
|
| Method Summary | |
|---|---|
void |
addInitParameter(String name,
String value)
|
void |
addResource(String name,
URL url)
|
Object |
getAttribute(String s)
|
Enumeration |
getAttributeNames()
Returns an Enumeration containing the attribute names available within this servlet context. |
ServletContext |
getContext(String s)
Returns a ServletContext object that corresponds to a specified URL on the server. |
String |
getContextPath()
|
String |
getInitParameter(String name)
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist. |
Enumeration |
getInitParameterNames()
Returns the names of the context's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the context has no initialization parameters. |
int |
getMajorVersion()
Returns the major version of the Java Servlet API that this servlet container supports. |
String |
getMimeType(String s)
Returns the MIME type of the specified file, or null if the MIME type is not known. |
int |
getMinorVersion()
Returns the minor version of the Servlet API that this servlet container supports. |
RequestDispatcher |
getNamedDispatcher(String s)
Returns a RequestDispatcher object that acts as a wrapper for the named servlet. |
String |
getRealPath(String path)
Returns a String containing the real path for a given virtual path. |
RequestDispatcher |
getRequestDispatcher(String s)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. |
URL |
getResource(String name)
Returns a URL to the resource that is mapped to a specified path. |
InputStream |
getResourceAsStream(String s)
Returns the resource located at the named path as an InputStream object. |
Set |
getResourcePaths(String s)
|
String |
getServerInfo()
Returns the name and version of the servlet container on which the servlet is running. |
Servlet |
getServlet(String s)
|
String |
getServletContextName()
|
Enumeration |
getServletNames()
|
Enumeration |
getServlets()
|
void |
log(Exception exception,
String s)
Deprecated. Method log is deprecated |
void |
log(String s)
Writes the specified message to a servlet log file, usually an event log. |
void |
log(String s,
Throwable throwable)
Writes an explanatory message and a stack trace for a given Throwable exception to the servlet log file. |
void |
removeAttribute(String s)
Removes the attribute with the given name from the servlet context. |
void |
setAttribute(String s,
Object obj)
Binds an object to a given attribute name in this servlet context. |
void |
setMajorVersion(int majorVersion)
|
void |
setMinorVersion(int minorVersion)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PARAM_DATASOURCES_CONFIG
public static final String PARAM_CHAR_ENCODING
public static final String PARAM_CALLBACKS
| Constructor Detail |
|---|
public MockServletContext()
| Method Detail |
|---|
public ServletContext getContext(String s)
getContext in interface ServletContextpublic String getContextPath()
getContextPath in interface ServletContextpublic int getMajorVersion()
getMajorVersion in interface ServletContextpublic int getMinorVersion()
getMinorVersion in interface ServletContextpublic String getMimeType(String s)
getMimeType in interface ServletContextpublic Set getResourcePaths(String s)
getResourcePaths in interface ServletContext
public URL getResource(String name)
throws MalformedURLException
getResource in interface ServletContextMalformedURLExceptionpublic InputStream getResourceAsStream(String s)
getResourceAsStream in interface ServletContextpublic RequestDispatcher getRequestDispatcher(String s)
getRequestDispatcher in interface ServletContextpublic RequestDispatcher getNamedDispatcher(String s)
getNamedDispatcher in interface ServletContext
public Servlet getServlet(String s)
throws ServletException
getServlet in interface ServletContextServletExceptionpublic Enumeration getServlets()
getServlets in interface ServletContextpublic Enumeration getServletNames()
getServletNames in interface ServletContextpublic void log(String s)
log in interface ServletContext
public void log(Exception exception,
String s)
log in interface ServletContext
public void log(String s,
Throwable throwable)
log in interface ServletContextpublic String getRealPath(String path)
getRealPath in interface ServletContextpublic String getServerInfo()
getServerInfo in interface ServletContextpublic String getInitParameter(String name)
getInitParameter in interface ServletContextpublic Enumeration getInitParameterNames()
getInitParameterNames in interface ServletContextpublic Object getAttribute(String s)
getAttribute in interface ServletContextpublic Enumeration getAttributeNames()
getAttributeNames in interface ServletContext
public void setAttribute(String s,
Object obj)
setAttribute in interface ServletContextpublic void removeAttribute(String s)
removeAttribute in interface ServletContextpublic String getServletContextName()
getServletContextName in interface ServletContextpublic void setMajorVersion(int majorVersion)
public void setMinorVersion(int minorVersion)
public void addResource(String name,
URL url)
public void addInitParameter(String name,
String value)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||