Fish & Chips Club 4.10.0.0

hirondelle.fish.test.doubles
Class FakeServletConfig

Object
  extended by hirondelle.fish.test.doubles.FakeServletConfig
All Implemented Interfaces:
ServletConfig

public class FakeServletConfig
extends Object
implements ServletConfig

Fake implementation of ServletConfig, used only for testing outside of the regular runtime environment.

This class fakes the data in web.xml, and returns a FakeServletContext. The ServletContext is needed for scanning in your .sql files. As well, it references FakeConnectionSrc.

The main use case for this class is to be passed to Controller.init(javax.servlet.ServletConfig).

This implementation hard-codes its data. Other implementations might read data from another source - perhaps a properties file, or perhaps web.xml itself.


Field Summary
static String SERVLET_NAME
          Value : "Fake Testing Servlet".
 
Constructor Summary
FakeServletConfig()
          Constructor.
 
Method Summary
 String getInitParameter(String aParamName)
           
 Enumeration getInitParameterNames()
           
 ServletContext getServletContext()
          Returns a FakeServletContext.
 String getServletName()
          Returns "Fake Testing Servlet".
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVLET_NAME

public static final String SERVLET_NAME
Value : "Fake Testing Servlet".

See Also:
Constant Field Values
Constructor Detail

FakeServletConfig

public FakeServletConfig()
                  throws FileNotFoundException
Constructor. Uses a FakeServletContext, and hard-codes its init params.

Throws:
FileNotFoundException
Method Detail

getInitParameter

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

getInitParameterNames

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

getServletContext

public ServletContext getServletContext()
Returns a FakeServletContext.

Specified by:
getServletContext in interface ServletConfig

getServletName

public String getServletName()
Returns "Fake Testing Servlet".

Specified by:
getServletName in interface ServletConfig

Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26