|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.struts.action.ActionServlet org.apache.struts.mock.MockActionServlet
public class MockActionServlet
Mock ActionServlet object for low-level unit tests of Struts controller components. Coarser grained tests should be implemented in terms of the Cactus framework, instead of the mock object classes.
WARNING - Only getter methods for servletContext and
servletConfig are provided, plus additional methods to configure this
object as necessary. Methods for unsupported operations will throw
UnsupportedOperationException
.
WARNING - Because unit tests operate in a single threaded environment, no synchronization is performed.
Field Summary | |
---|---|
protected javax.servlet.ServletConfig |
servletConfig
|
protected javax.servlet.ServletContext |
servletContext
|
Fields inherited from class org.apache.struts.action.ActionServlet |
---|
chainConfig, config, configDigester, convertNull, internal, internalName, log, registrations, servletMapping, servletName |
Constructor Summary | |
---|---|
MockActionServlet()
Constructor. |
|
MockActionServlet(javax.servlet.ServletContext servletContext,
javax.servlet.ServletConfig servletConfig)
Constructor. |
Method Summary | |
---|---|
javax.servlet.ServletConfig |
getServletConfig()
Get property |
javax.servlet.ServletContext |
getServletContext()
Get property |
void |
initInternal()
Expose as public so that test classes can exercise things which retrieve messages. |
void |
setServletConfig(javax.servlet.ServletConfig servletConfig)
Set property |
void |
setServletContext(javax.servlet.ServletContext servletContext)
Set property |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected javax.servlet.ServletContext servletContext
protected javax.servlet.ServletConfig servletConfig
Constructor Detail |
---|
public MockActionServlet(javax.servlet.ServletContext servletContext, javax.servlet.ServletConfig servletConfig)
Constructor.
public MockActionServlet()
Constructor.
Method Detail |
---|
public void setServletContext(javax.servlet.ServletContext servletContext)
Set property
servletContext
- public javax.servlet.ServletContext getServletContext()
Get property
getServletContext
in interface javax.servlet.ServletConfig
getServletContext
in class javax.servlet.GenericServlet
public void setServletConfig(javax.servlet.ServletConfig servletConfig)
Set property
servletConfig
- public javax.servlet.ServletConfig getServletConfig()
Get property
getServletConfig
in interface javax.servlet.Servlet
getServletConfig
in class javax.servlet.GenericServlet
public void initInternal() throws javax.servlet.ServletException
Expose as public so that test classes can exercise things which retrieve messages.
initInternal
in class ActionServlet
javax.servlet.ServletException
- if we cannot initialize these resources
javax.servlet.UnavailableException
- if we cannot load resources
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |