public abstract class StrutsTestCase extends XWorkTestCase
Modifier and Type | Field and Description |
---|---|
protected Dispatcher |
dispatcher |
protected Map<String,String> |
dispatcherInitParams |
protected org.springframework.mock.web.MockPageContext |
pageContext |
protected org.springframework.mock.web.MockHttpServletRequest |
request |
protected org.springframework.core.io.DefaultResourceLoader |
resourceLoader |
protected org.springframework.mock.web.MockHttpServletResponse |
response |
protected org.springframework.mock.web.MockServletContext |
servletContext |
actionProxyFactory, configuration, configurationManager, container
Constructor and Description |
---|
StrutsTestCase() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyAdditionalParams(ActionContext context)
Can be overwritten in subclass to provide additional context's params and settings used during action invocation
|
protected <T> T |
createAction(Class<T> clazz)
A helper method which allows instantiate an action if this action extends
ActionSupport or any other action class
that requires framework's dependencies injection. |
protected String |
executeAction(String uri)
Executes an action and returns it's output (not the result returned from
execute()), but the actual output that would be written to the response.
|
protected Object |
findValueAfterExecute(String key)
gets an object from the stack after an action is executed
|
protected ActionMapping |
getActionMapping(javax.servlet.http.HttpServletRequest request)
Finds an ActionMapping for a given request
|
protected ActionMapping |
getActionMapping(String url)
Finds an ActionMapping for a given url
|
protected ActionProxy |
getActionProxy(String uri)
Creates an action proxy for a request, and sets parameters of the ActionInvocation to the passed
parameters.
|
protected void |
initActionContext(ActionContext actionContext) |
protected Dispatcher |
initDispatcher(Map<String,String> params) |
protected void |
initServletMockObjects() |
protected void |
initSession(ActionContext actionContext) |
protected void |
injectStrutsDependencies(Object object)
Injects dependencies on an Object using Struts internal IoC container
|
protected void |
setUp()
Sets up the configuration settings, XWork configuration, and
message resources
|
protected void |
setupAfterInitDispatcher(Dispatcher dispatcher) |
protected void |
setupBeforeInitDispatcher() |
protected void |
tearDown() |
loadButAdd, loadButAdd, loadConfigurationProviders
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
protected org.springframework.mock.web.MockHttpServletResponse response
protected org.springframework.mock.web.MockHttpServletRequest request
protected org.springframework.mock.web.MockPageContext pageContext
protected org.springframework.mock.web.MockServletContext servletContext
protected Dispatcher dispatcher
protected org.springframework.core.io.DefaultResourceLoader resourceLoader
protected Object findValueAfterExecute(String key)
protected String executeAction(String uri) throws javax.servlet.ServletException, UnsupportedEncodingException
javax.servlet.ServletException
UnsupportedEncodingException
protected ActionProxy getActionProxy(String uri)
protected <T> T createAction(Class<T> clazz)
ActionSupport
or any other action class
that requires framework's dependencies injection.protected void initActionContext(ActionContext actionContext)
protected void initSession(ActionContext actionContext)
protected void applyAdditionalParams(ActionContext context)
context
- current ActionContext
protected ActionMapping getActionMapping(javax.servlet.http.HttpServletRequest request)
protected ActionMapping getActionMapping(String url)
protected void injectStrutsDependencies(Object object)
protected void setUp() throws Exception
setUp
in class XWorkTestCase
Exception
protected void setupBeforeInitDispatcher() throws Exception
Exception
protected void setupAfterInitDispatcher(Dispatcher dispatcher)
protected void initServletMockObjects()
protected Dispatcher initDispatcher(Map<String,String> params)
protected void tearDown() throws Exception
tearDown
in class XWorkTestCase
Exception
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.