eXo WS :: HTTP :: testframework 2.3.9-GA

org.exoplatform.services.test.mock
Class MockServletContext

java.lang.Object
  extended by org.exoplatform.services.test.mock.MockServletContext
All Implemented Interfaces:
javax.servlet.ServletContext

public class MockServletContext
extends Object
implements javax.servlet.ServletContext

The Class MockServletContext.

Version:
$Id: $
Author:
Max Shaposhnik

Constructor Summary
MockServletContext()
          Instantiates a new mock servlet context.
MockServletContext(String name)
          Instantiates a new mock servlet context.
MockServletContext(String name, String path)
          Instantiates a new mock servlet context.
 
Method Summary
 Object getAttribute(String name)
          
 Enumeration getAttributeNames()
          
 javax.servlet.ServletContext getContext(String s)
          
 String getContextPath()
          
 String getInitParameter(String name)
          
 Enumeration getInitParameterNames()
          
 String getLogBuffer()
          Gets the log buffer.
 int getMajorVersion()
          
 String getMimeType(String s)
          
 int getMinorVersion()
          
 javax.servlet.RequestDispatcher getNamedDispatcher(String s)
          
 String getRealPath(String s)
          
 javax.servlet.RequestDispatcher getRequestDispatcher(String s)
          
 URL getResource(String s)
          
 InputStream getResourceAsStream(String s)
          
 Set getResourcePaths(String s)
          
 String getServerInfo()
          
 javax.servlet.Servlet getServlet(String s)
          Deprecated. 
 String getServletContextName()
          
 Enumeration getServletNames()
          Deprecated. 
 Enumeration getServlets()
          Deprecated. 
 void log(Exception e, String s)
          Deprecated. 
 void log(String s)
          
 void log(String s, Throwable throwable)
          
 void removeAttribute(String name)
          
 void setAttribute(String name, Object value)
          
 void setContextPath(String s)
          Sets the context path.
 void setInitParameter(String name, String value)
          Sets the init parameter.
 void setName(String name)
          Sets the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockServletContext

public MockServletContext()
Instantiates a new mock servlet context.


MockServletContext

public MockServletContext(String name)
Instantiates a new mock servlet context.

Parameters:
name - the name

MockServletContext

public MockServletContext(String name,
                          String path)
Instantiates a new mock servlet context.

Parameters:
name - the name
path - the path
Method Detail

setName

public void setName(String name)
Sets the name.

Parameters:
name - the new name

getLogBuffer

public String getLogBuffer()
Gets the log buffer.

Returns:
the log buffer

getContext

public javax.servlet.ServletContext getContext(String s)

Specified by:
getContext in interface javax.servlet.ServletContext

getMajorVersion

public int getMajorVersion()

Specified by:
getMajorVersion in interface javax.servlet.ServletContext

getMinorVersion

public int getMinorVersion()

Specified by:
getMinorVersion in interface javax.servlet.ServletContext

getMimeType

public String getMimeType(String s)

Specified by:
getMimeType in interface javax.servlet.ServletContext

getResourcePaths

public Set getResourcePaths(String s)

Specified by:
getResourcePaths in interface javax.servlet.ServletContext

getResource

public URL getResource(String s)
                throws MalformedURLException

Specified by:
getResource in interface javax.servlet.ServletContext
Throws:
MalformedURLException

getResourceAsStream

public InputStream getResourceAsStream(String s)

Specified by:
getResourceAsStream in interface javax.servlet.ServletContext

getRequestDispatcher

public javax.servlet.RequestDispatcher getRequestDispatcher(String s)

Specified by:
getRequestDispatcher in interface javax.servlet.ServletContext

getNamedDispatcher

public javax.servlet.RequestDispatcher getNamedDispatcher(String s)

Specified by:
getNamedDispatcher in interface javax.servlet.ServletContext

getServlet

@Deprecated
public javax.servlet.Servlet getServlet(String s)
                                 throws javax.servlet.ServletException
Deprecated. 

Specified by:
getServlet in interface javax.servlet.ServletContext
Throws:
javax.servlet.ServletException

getServlets

@Deprecated
public Enumeration getServlets()
Deprecated. 

Specified by:
getServlets in interface javax.servlet.ServletContext

getServletNames

@Deprecated
public Enumeration getServletNames()
Deprecated. 

Specified by:
getServletNames in interface javax.servlet.ServletContext

log

public void log(String s)

Specified by:
log in interface javax.servlet.ServletContext

log

@Deprecated
public void log(Exception e,
                           String s)
Deprecated. 

Specified by:
log in interface javax.servlet.ServletContext

log

public void log(String s,
                Throwable throwable)

Specified by:
log in interface javax.servlet.ServletContext

setContextPath

public void setContextPath(String s)
Sets the context path.

Parameters:
s - the new context path

getRealPath

public String getRealPath(String s)

Specified by:
getRealPath in interface javax.servlet.ServletContext

getServerInfo

public String getServerInfo()

Specified by:
getServerInfo in interface javax.servlet.ServletContext

setInitParameter

public void setInitParameter(String name,
                             String value)
Sets the init parameter.

Parameters:
name - the name
value - the value

getInitParameter

public String getInitParameter(String name)

Specified by:
getInitParameter in interface javax.servlet.ServletContext

getInitParameterNames

public Enumeration getInitParameterNames()

Specified by:
getInitParameterNames in interface javax.servlet.ServletContext

getAttribute

public Object getAttribute(String name)

Specified by:
getAttribute in interface javax.servlet.ServletContext

getAttributeNames

public Enumeration getAttributeNames()

Specified by:
getAttributeNames in interface javax.servlet.ServletContext

setAttribute

public void setAttribute(String name,
                         Object value)

Specified by:
setAttribute in interface javax.servlet.ServletContext

removeAttribute

public void removeAttribute(String name)

Specified by:
removeAttribute in interface javax.servlet.ServletContext

getServletContextName

public String getServletContextName()

Specified by:
getServletContextName in interface javax.servlet.ServletContext

getContextPath

public String getContextPath()

Specified by:
getContextPath in interface javax.servlet.ServletContext

eXo WS :: HTTP :: testframework 2.3.9-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.