Package com.mockobjects.servlet

# Class MockServletContext

java.lang.Object
com.mockobjects.MockObject
com.mockobjects.servlet.MockServletContext

All Implemented Interfaces:
  `Verifiable`

public class MockServletContext extends MockObject

## Constructor Summary

Constructors
Constructor
Description
`MockServletContext()`

## Method Summary

Modifier and Type
Method
Description
`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`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockServletContext

public MockServletContext()

## Method Details

### getServlets

public Enumeration getServlets()

### log

public void log(String string)

### setExpectedLog

public void setExpectedLog(String string)

### setupGetResource

public void setupGetResource(URL resource)

### getResource

public URL getResource(String string)

### setupGetResourcePaths

public void setupGetResourcePaths(Set resourcePaths)

### getResourcePaths

public Set getResourcePaths(String string)

### getContext

public ServletContext getContext(String string)

### getMinorVersion

public int getMinorVersion()

### removeAttribute

public void removeAttribute(String string)

### log

public void log(String string, Throwable t)

### setExpectedLogThrowable

public void setExpectedLogThrowable(Throwable throwable)

### addRealPath

public void addRealPath(String realPath)

### getRealPath

public String getRealPath(String string)

### getServletNames

public Enumeration getServletNames()

### getServlet

public Servlet getServlet(String string)

### log

public void log(Exception exception, String string)

### getServerInfo

public String getServerInfo()

### setExpectedRequestDispatcherURI

public void setExpectedRequestDispatcherURI(String uri)

### setupGetRequestDispatcher

public void setupGetRequestDispatcher(RequestDispatcher requestDispatcher)

### getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String uri)

### getMajorVersion

public int getMajorVersion()

### getResourcePaths

public Set getResourcePaths()

### setupGetAttribute

public void setupGetAttribute(String string, Object object)

### getMimeType

public String getMimeType(String string)

### getNamedDispatcher

public RequestDispatcher getNamedDispatcher(String string)

### getInitParameter

public String getInitParameter(String paramName)

### setInitParameter

public void setInitParameter(String paramName, String paramValue)

### getAttribute

public Object getAttribute(String string)

### getAttributeNames

public Enumeration getAttributeNames()

### getServletContextName

public String getServletContextName()

### getResourceAsStream

public InputStream getResourceAsStream(String string)

### getInitParameterNames

public Enumeration getInitParameterNames()

### addExpectedAttribute

public void addExpectedAttribute(String key, Object value)

### setAttribute

public void setAttribute(String key, Object value)