Class MockServletConfig

java.lang.Object
org.apache.commons.chain.web.javax.servlet.MockServletConfig
All Implemented Interfaces:
javax.servlet.ServletConfig

public class MockServletConfig extends Object implements javax.servlet.ServletConfig
Mock ServletConfig implementation.
  • Constructor Details

    • MockServletConfig

      Default Constructor.
    • MockServletConfig

      public MockServletConfig(String servletName)
      Construct an instance with the specified name.
      Parameters:
      servletName - the servlet name
    • MockServletConfig

      public MockServletConfig(String servletName, javax.servlet.ServletContext servletContext)
      Construct an instance with the specified name and context.
      Parameters:
      servletName - the servlet name
      servletContext - the servlet context
  • Method Details

    • getInitParameter

      Get a specified init parameter.
      Specified by:
      getInitParameter in interface javax.servlet.ServletConfig
      Parameters:
      name - parameter name
      Returns:
      the parameter value
    • getInitParameterNames

      Get the init parameter names.
      Specified by:
      getInitParameterNames in interface javax.servlet.ServletConfig
      Returns:
      the set of parameter names
    • getServletContext

      public javax.servlet.ServletContext getServletContext()
      Get the servlet context.
      Specified by:
      getServletContext in interface javax.servlet.ServletConfig
      Returns:
      the servlet context
    • getServletName

      Return the servlet name.
      Specified by:
      getServletName in interface javax.servlet.ServletConfig
      Returns:
      The servlet name
    • setInitParameter

      public void setInitParameter(String name, String value)
      Set a specified init parameter.
      Parameters:
      name - parameter name
      value - the parameter value