com.ideo.sweetdevria.mock
Class MockServletContext

java.lang.Object
  extended by com.ideo.sweetdevria.mock.MockServletContext
All Implemented Interfaces:
javax.servlet.ServletContext

public final class MockServletContext
extends java.lang.Object
implements javax.servlet.ServletContext

Mock ServletContext object used for "non web" context (exemple : the excel export in batch mode). This object implements only getter/setter methods for attributes.

Author:
Vitaliy Shevchuk, Gregory Paul

Constructor Summary
MockServletContext()
          Default constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attrName)
          Get an attribute.
 java.util.Enumeration getAttributeNames()
          Get attribute names.
 javax.servlet.ServletContext getContext(java.lang.String string)
          Not implemented !
 java.lang.String getInitParameter(java.lang.String string)
          Not implemented !
 java.util.Enumeration getInitParameterNames()
          Not implemented !
 int getMajorVersion()
          Not implemented !
 java.lang.String getMimeType(java.lang.String string)
          Not implemented !
 int getMinorVersion()
          Not implemented !
 javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String string)
          Not implemented !
 java.lang.String getRealPath(java.lang.String string)
          Not implemented !
 javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String string)
          Not implemented !
 java.net.URL getResource(java.lang.String string)
          Not implemented !
 java.io.InputStream getResourceAsStream(java.lang.String string)
          Not implemented !
 java.util.Set getResourcePaths(java.lang.String string)
          Not implemented !
 java.lang.String getServerInfo()
          Not implemented !
 javax.servlet.Servlet getServlet(java.lang.String string)
          Not implemented !
 java.lang.String getServletContextName()
          Not implemented !
 java.util.Enumeration getServletNames()
          Not implemented !
 java.util.Enumeration getServlets()
          Not implemented !
 void log(java.lang.Exception exception, java.lang.String string)
          Not implemented !
 void log(java.lang.String string)
          Not implemented !
 void log(java.lang.String string, java.lang.Throwable throwable)
          Not implemented !
 void removeAttribute(java.lang.String attrName)
          Remove an attribute.
 void setAttribute(java.lang.String attrName, java.lang.Object object)
          Set an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockServletContext

public MockServletContext()
Default constructor.

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String attrName)
Get an attribute.

Specified by:
getAttribute in interface javax.servlet.ServletContext
Parameters:
attrName - Attribute name
Returns:
Attribute value

getAttributeNames

public java.util.Enumeration getAttributeNames()
Get attribute names.

Specified by:
getAttributeNames in interface javax.servlet.ServletContext
Returns:
Enumeration of names

setAttribute

public void setAttribute(java.lang.String attrName,
                         java.lang.Object object)
Set an attribute.

Specified by:
setAttribute in interface javax.servlet.ServletContext
Parameters:
attrName - Attribute name
object - Attribute value

removeAttribute

public void removeAttribute(java.lang.String attrName)
Remove an attribute.

Specified by:
removeAttribute in interface javax.servlet.ServletContext
Parameters:
attrName - Attribute name

getContext

public javax.servlet.ServletContext getContext(java.lang.String string)
Not implemented !

Specified by:
getContext in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getMajorVersion

public int getMajorVersion()
Not implemented !

Specified by:
getMajorVersion in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

getMinorVersion

public int getMinorVersion()
Not implemented !

Specified by:
getMinorVersion in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

getMimeType

public java.lang.String getMimeType(java.lang.String string)
Not implemented !

Specified by:
getMimeType in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getResourcePaths

public java.util.Set getResourcePaths(java.lang.String string)
Not implemented !

Specified by:
getResourcePaths in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getResource

public java.net.URL getResource(java.lang.String string)
                         throws java.net.MalformedURLException
Not implemented !

Specified by:
getResource in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)
Throws:
java.net.MalformedURLException - MalformedURLException

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String string)
Not implemented !

Specified by:
getResourceAsStream in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String string)
Not implemented !

Specified by:
getRequestDispatcher in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getNamedDispatcher

public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String string)
Not implemented !

Specified by:
getNamedDispatcher in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getServlet

public javax.servlet.Servlet getServlet(java.lang.String string)
                                 throws javax.servlet.ServletException
Not implemented !

Specified by:
getServlet in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)
Throws:
javax.servlet.ServletException - ServletException

getServlets

public java.util.Enumeration getServlets()
Not implemented !

Specified by:
getServlets in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

getServletNames

public java.util.Enumeration getServletNames()
Not implemented !

Specified by:
getServletNames in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

log

public void log(java.lang.String string)
Not implemented !

Specified by:
log in interface javax.servlet.ServletContext
Parameters:
string - string

log

public void log(java.lang.Exception exception,
                java.lang.String string)
Not implemented !

Specified by:
log in interface javax.servlet.ServletContext
Parameters:
exception - exception
string - string

log

public void log(java.lang.String string,
                java.lang.Throwable throwable)
Not implemented !

Specified by:
log in interface javax.servlet.ServletContext
Parameters:
string - string
throwable - throwable

getRealPath

public java.lang.String getRealPath(java.lang.String string)
Not implemented !

Specified by:
getRealPath in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getServerInfo

public java.lang.String getServerInfo()
Not implemented !

Specified by:
getServerInfo in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

getInitParameter

public java.lang.String getInitParameter(java.lang.String string)
Not implemented !

Specified by:
getInitParameter in interface javax.servlet.ServletContext
Parameters:
string - string
Returns:
nothing (RuntimeException)

getInitParameterNames

public java.util.Enumeration getInitParameterNames()
Not implemented !

Specified by:
getInitParameterNames in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)

getServletContextName

public java.lang.String getServletContextName()
Not implemented !

Specified by:
getServletContextName in interface javax.servlet.ServletContext
Returns:
nothing (RuntimeException)


Copyright © 2010 Ideo Technologies. All Rights Reserved.