Package org.apache.struts.mock
Class MockActionServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.struts.action.ActionServlet
org.apache.struts.mock.MockActionServlet
- All Implemented Interfaces:
Servlet
,ServletConfig
,Serializable
public class MockActionServlet
extends org.apache.struts.action.ActionServlet
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.
- Version:
- $Rev$ $Date: 2005-05-14 02:09:06 -0400 (Sat, 14 May 2005) $
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.action.ActionServlet
chainConfig, config, configDigester, convertNull, internal, internalName, registrations, servletMapping, servletName
-
Constructor Summary
ConstructorDescriptionConstructor.MockActionServlet
(ServletContext servletContext, ServletConfig servletConfig) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet propertyGet propertyvoid
Expose as public so that test classes can exercise things which retrieve messages.void
setServletConfig
(ServletConfig servletConfig) Set propertyvoid
setServletContext
(ServletContext servletContext) Set propertyMethods inherited from class org.apache.struts.action.ActionServlet
addServletMapping, destroy, destroyConfigDigester, destroyInternal, destroyModules, doGet, doPost, getInternal, getModuleConfig, getRequestProcessor, init, initChain, initConfigDigester, initModuleActions, initModuleConfig, initModuleConfigFactory, initModuleExceptionConfigs, initModuleFormBeans, initModuleForwards, initModuleMessageResources, initModulePlugIns, initModulePrefixes, initOther, initServlet, parseModuleConfigFile, parseModuleConfigFile, process, processActionConfigClass, processActionConfigExtension, processExceptionConfigClass, processExceptionExtension, processFormBeanConfigClass, processFormBeanExtension, processForwardConfigClass, processForwardExtension, splitAndResolvePaths
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletInfo, getServletName, init, log, log
-
Field Details
-
servletContext
-
servletConfig
-
-
Constructor Details
-
MockActionServlet
Constructor.- Parameters:
servletContext
- the ServletContextservletConfig
- the ServletConfig
-
MockActionServlet
public MockActionServlet()Constructor.
-
-
Method Details
-
setServletContext
Set property- Parameters:
servletContext
- the ServletContext
-
getServletContext
Get property- Specified by:
getServletContext
in interfaceServletConfig
- Overrides:
getServletContext
in classGenericServlet
- Returns:
- the ServletContext
-
setServletConfig
Set property- Parameters:
servletConfig
- the ServletConfig
-
getServletConfig
Get property- Specified by:
getServletConfig
in interfaceServlet
- Overrides:
getServletConfig
in classGenericServlet
- Returns:
- the ServletConfig
-
initInternal
Expose as public so that test classes can exercise things which retrieve messages.- Overrides:
initInternal
in classorg.apache.struts.action.ActionServlet
- Throws:
ServletException
-