org.springframework.mock.web
Class MockServletConfig

java.lang.Object
  extended by org.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.

Since:
1.0.2
Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
MockServletConfig(ServletContext servletContext)
          Create new MockServletConfig with empty String as name.
MockServletConfig(ServletContext servletContext, String servletName)
          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 servletName)
Create new MockServletConfig.

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

getServletName

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

getServletContext

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

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


Copyright (c) 2002-2006 The Spring Framework Project.