public abstract class StrutsJUnit4TestCase<T>
extends com.opensymphony.xwork2.XWorkJUnit4TestCase
| 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 |
| Constructor and Description |
|---|
StrutsJUnit4TestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
containsErrors() |
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
|
void |
finishExecution() |
protected T |
getAction()
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 com.opensymphony.xwork2.ActionProxy |
getActionProxy(String uri)
Creates an action proxy for a request, and sets parameters of the ActionInvocation to the passed
parameters.
|
protected String |
getConfigPath()
Override this method to return a comma separated list of paths to a configuration
file.
|
protected Dispatcher |
initDispatcher(Map<String,String> params) |
protected void |
initDispatcherParams() |
protected void |
initServletMockObjects() |
protected void |
injectStrutsDependencies(Object object)
Injects dependencies on an Object using Struts internal IoC container
|
void |
setUp()
Sets up the configuration settings, XWork configuration, and
message resources
|
protected void |
setupBeforeInitDispatcher() |
void |
tearDown() |
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 T getAction()
protected boolean containsErrors()
protected String executeAction(String uri) throws javax.servlet.ServletException, UnsupportedEncodingException
javax.servlet.ServletExceptionUnsupportedEncodingExceptionprotected com.opensymphony.xwork2.ActionProxy getActionProxy(String uri)
protected ActionMapping getActionMapping(javax.servlet.http.HttpServletRequest request)
protected ActionMapping getActionMapping(String url)
protected void injectStrutsDependencies(Object object)
protected void setupBeforeInitDispatcher()
throws Exception
Exceptionprotected void initServletMockObjects()
public void finishExecution()
public void setUp()
throws Exception
setUp in class com.opensymphony.xwork2.XWorkJUnit4TestCaseExceptionprotected void initDispatcherParams()
protected Dispatcher initDispatcher(Map<String,String> params)
protected String getConfigPath()
The default implementation simply returns null.
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.