org.springframework.mock.web
Class MockServletConfig

java.lang.Object
  extended byorg.springframework.mock.web.MockServletConfig
All Implemented Interfaces:
ServletConfig

public class MockServletConfig
extends Object
implements ServletConfig

Mock implementation of the ServletConfig interface.

Used for testing the web framework; typically not necessary for testing application controllers.

Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
MockServletConfig(ServletContext servletContext)
          Create new MockServletConfig with empty String as name.
MockServletConfig(ServletContext servletContext, String name)
          Create new MockServletConfig.
 
Method Summary
 void addInitParameter(String name, String value)
           
 String getInitParameter(String name)
           
 Enumeration getInitParameterNames()
           
 ServletContext getServletContext()
           
 String getServletName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockServletConfig

public MockServletConfig(ServletContext servletContext)
Create new MockServletConfig with empty String as name.

Parameters:
servletContext - the ServletContext that the servlet runs in

MockServletConfig

public MockServletConfig(ServletContext servletContext,
                         String name)
Create new MockServletConfig.

Parameters:
servletContext - the ServletContext that the servlet runs in
name - the name of the servlet
Method Detail

addInitParameter

public void addInitParameter(String name,
                             String value)

getInitParameter

public String getInitParameter(String name)
Specified by:
getInitParameter in interface ServletConfig

getInitParameterNames

public Enumeration getInitParameterNames()
Specified by:
getInitParameterNames in interface ServletConfig

getServletContext

public ServletContext getServletContext()
Specified by:
getServletContext in interface ServletConfig

getServletName

public String getServletName()
Specified by:
getServletName in interface ServletConfig


Copyright (C) 2003-2004 The Spring Framework Project.