org.infoglue.cms.util
Class FakeFilterConfig

java.lang.Object
  |
  +--org.infoglue.cms.util.FakeFilterConfig
All Implemented Interfaces:
javax.servlet.FilterConfig

public class FakeFilterConfig
extends java.lang.Object
implements javax.servlet.FilterConfig

Allows us to configure the InfoGlueAuthorizationFilter for testing outside of a servlet environment. Parameter keys and values are read from cms.properties.

Author:
Jed Prentice

Constructor Summary
FakeFilterConfig()
           
 
Method Summary
 java.lang.String getFilterName()
          Returns the name of this filter
 java.lang.String getInitParameter(java.lang.String name)
          Returns the init parameter with the given name
 java.util.Enumeration getInitParameterNames()
          Returns an enumeration of all init parameters
 javax.servlet.ServletContext getServletContext()
          Returns the servlet context
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeFilterConfig

public FakeFilterConfig()
Method Detail

getFilterName

public java.lang.String getFilterName()
Returns the name of this filter

Specified by:
getFilterName in interface javax.servlet.FilterConfig
Returns:
"fakeServletFilter"

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the servlet context

Specified by:
getServletContext in interface javax.servlet.FilterConfig
Returns:
a reference to FakeServletContext
See Also:
FakeServletContext

getInitParameter

public java.lang.String getInitParameter(java.lang.String name)
Returns the init parameter with the given name

Specified by:
getInitParameter in interface javax.servlet.FilterConfig
Parameters:
name - the name of the desired init parameter
Returns:
the value of the init parameter associated with name, or null if no init parametrer with name exists.

getInitParameterNames

public java.util.Enumeration getInitParameterNames()
Returns an enumeration of all init parameters

Specified by:
getInitParameterNames in interface javax.servlet.FilterConfig
Returns:
an enumeration of all init parameters