com.mockobjects.servlet

Class MockServletContext

Implemented Interfaces:
ServletContext, Verifiable

public class MockServletContext
extends MockObject
implements ServletContext

Method Summary

void
addExpectedAttribute(String key, Object value)
void
addRealPath(String realPath)
Object
getAttribute(String string)
Enumeration
getAttributeNames()
ServletContext
getContext(String string)
String
getInitParameter(String paramName)
Enumeration
getInitParameterNames()
int
getMajorVersion()
String
getMimeType(String string)
int
getMinorVersion()
RequestDispatcher
getNamedDispatcher(String string)
String
getRealPath(String string)
RequestDispatcher
getRequestDispatcher(String uri)
URL
getResource(String string)
InputStream
getResourceAsStream(String string)
Set
getResourcePaths()
Set
getResourcePaths(String string)
String
getServerInfo()
Servlet
getServlet(String string)
String
getServletContextName()
Enumeration
getServletNames()
Enumeration
getServlets()
void
log(Exception exception, String string)
void
log(String string)
void
log(String string, Throwable t)
void
removeAttribute(String string)
void
setAttribute(String key, Object value)
void
setExpectedLog(String string)
void
setExpectedLogThrowable(Throwable throwable)
void
setExpectedRequestDispatcherURI(String uri)
void
setInitParameter(String paramName, String paramValue)
void
setupGetAttribute(String string, Object object)
void
setupGetRequestDispatcher(RequestDispatcher requestDispatcher)
void
setupGetResource(URL resource)
void
setupGetResourcePaths(Set resourcePaths)

Methods inherited from class com.mockobjects.MockObject

notImplemented, notYetImplemented, verify

Method Details

addExpectedAttribute

public void addExpectedAttribute(String key,
                                 Object value)

addRealPath

public void addRealPath(String realPath)

getAttribute

public Object getAttribute(String string)

getAttributeNames

public Enumeration getAttributeNames()

getContext

public ServletContext getContext(String string)

getInitParameter

public String getInitParameter(String paramName)

getInitParameterNames

public Enumeration getInitParameterNames()

getMajorVersion

public int getMajorVersion()

getMimeType

public String getMimeType(String string)

getMinorVersion

public int getMinorVersion()

getNamedDispatcher

public RequestDispatcher getNamedDispatcher(String string)

getRealPath

public String getRealPath(String string)

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String uri)

getResource

public URL getResource(String string)

getResourceAsStream

public InputStream getResourceAsStream(String string)

getResourcePaths

public Set getResourcePaths()

getResourcePaths

public Set getResourcePaths(String string)

getServerInfo

public String getServerInfo()

getServlet

public Servlet getServlet(String string)

getServletContextName

public String getServletContextName()

getServletNames

public Enumeration getServletNames()

getServlets

public Enumeration getServlets()

log

public void log(Exception exception,
                String string)

log

public void log(String string)

log

public void log(String string,
                Throwable t)

removeAttribute

public void removeAttribute(String string)

setAttribute

public void setAttribute(String key,
                         Object value)

setExpectedLog

public void setExpectedLog(String string)

setExpectedLogThrowable

public void setExpectedLogThrowable(Throwable throwable)

setExpectedRequestDispatcherURI

public void setExpectedRequestDispatcherURI(String uri)

setInitParameter

public void setInitParameter(String paramName,
                             String paramValue)

setupGetAttribute

public void setupGetAttribute(String string,
                              Object object)

setupGetRequestDispatcher

public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher)

setupGetResource

public void setupGetResource(URL resource)

setupGetResourcePaths

public void setupGetResourcePaths(Set resourcePaths)

Copyright © 2002 Mock Objects. All Rights Reserved.