Package org.apache.sling.servlethelpers

# Class MockServletContext

java.lang.Object
org.apache.felix.http.javaxwrappers.ServletContextWrapper
org.apache.sling.servlethelpers.MockServletContext

All Implemented Interfaces:
  `javax.servlet.ServletContext`

@ConsumerType @Deprecated(since="2.0.0") public class MockServletContext extends org.apache.felix.http.javaxwrappers.ServletContextWrapper
Deprecated.
Use `MockJakartaServletContext` instead.
Mock `ServletContext` implementation.

## Field Summary

### Fields inherited from interface javax.servlet.ServletContext

`ORDERED_LIBS, TEMPDIR`

## Constructor Summary

Constructors
Constructor
Description
`MockServletContext(MockJakartaServletContext wrappedServletContext)`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`javax.servlet.descriptor.JspConfigDescriptor`
`getJspConfigDescriptor()`
Deprecated.
`javax.servlet.Servlet`
`getServlet(String name)`
Deprecated.
`Enumeration<String>`
`getServletNames()`
Deprecated.
`Enumeration<javax.servlet.Servlet>`
`getServlets()`
Deprecated.

### Methods inherited from class org.apache.felix.http.javaxwrappers.ServletContextWrapper

`addFilter, addFilter, addFilter, addJspFile, addListener, addListener, addListener, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getAttribute, getAttributeNames, getClassLoader, getContext, getContextPath, getDefaultSessionTrackingModes, getEffectiveMajorVersion, getEffectiveMinorVersion, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getInitParameter, getInitParameterNames, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getRealPath, getRequestCharacterEncoding, getRequestDispatcher, getResource, getResourceAsStream, getResourcePaths, getResponseCharacterEncoding, getServerInfo, getServletContextName, getServletRegistration, getServletRegistrations, getSessionCookieConfig, getSessionTimeout, getVirtualServerName, log, log, log, removeAttribute, setAttribute, setInitParameter, setRequestCharacterEncoding, setResponseCharacterEncoding, setSessionTimeout, setSessionTrackingModes`

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

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

## Constructor Details

### MockServletContext

public MockServletContext(MockJakartaServletContext wrappedServletContext)
Deprecated.

## Method Details

### getServlet

public javax.servlet.Servlet getServlet(String name)
Deprecated.

Specified by:
  `getServlet` in interface `javax.servlet.ServletContext`
Overrides:
  `getServlet` in class `org.apache.felix.http.javaxwrappers.ServletContextWrapper`

### getServletNames

public Enumeration<String> getServletNames()
Deprecated.

Specified by:
  `getServletNames` in interface `javax.servlet.ServletContext`
Overrides:
  `getServletNames` in class `org.apache.felix.http.javaxwrappers.ServletContextWrapper`

### getServlets

public Enumeration<javax.servlet.Servlet> getServlets()
Deprecated.

Specified by:
  `getServlets` in interface `javax.servlet.ServletContext`
Overrides:
  `getServlets` in class `org.apache.felix.http.javaxwrappers.ServletContextWrapper`

### getJspConfigDescriptor

public javax.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
Deprecated.

Specified by:
  `getJspConfigDescriptor` in interface `javax.servlet.ServletContext`
Overrides:
  `getJspConfigDescriptor` in class `org.apache.felix.http.javaxwrappers.ServletContextWrapper`