| |
|
| com.mockrunner.struts.BasicActionTestCaseAdapter com.mockrunner.example.struts.StoreDataActionTest
StoreDataActionTest | public class StoreDataActionTest extends BasicActionTestCaseAdapter (Code) | | Example test for
StoreDataAction .
Demonstrates multithread testing. The use of an inner thread
class and a single test method is a standard pattern that can
be used in any multithreading test for Servlets and actions.
Please note that each thread has to call the action with
different sessions and requests but with one
ServletContext in order to simulate the real
container behaviour. See the constructor of the thread how
to deal with the test module and factory.
Remove the synchronized keyword in
StoreDataAction and the test
will fail.
com.mockrunner.base.MultiThreadTestSuite is meant to
make multithread testing much easier, but it is not working
properly yet, so we do not use it here.
|
Inner Class :public class StoreTestThread extends Thread | |
testStoreDataAction | public void testStoreDataAction() throws Exception(Code) | | |
Methods inherited from com.mockrunner.struts.BasicActionTestCaseAdapter | protected ActionForward actionPerform(Class action, Class form)(Code)(Java Doc) protected ActionForward actionPerform(Class action)(Code)(Java Doc) protected ActionForward actionPerform(Action action)(Code)(Java Doc) protected ActionForward actionPerform(Action action, ActionForm form)(Code)(Java Doc) protected ActionForward actionPerform(Action action, Class form)(Code)(Java Doc) protected ActionForward actionPerform(Class action, ActionForm form)(Code)(Java Doc) protected void addExceptionHandler(ExceptionHandlerConfig handler)(Code)(Java Doc) protected String addMappedPropertyRequestPrefix(String property)(Code)(Java Doc) protected ActionForm createActionForm(Class form)(Code)(Java Doc) protected ActionMockObjectFactory createActionMockObjectFactory()(Code)(Java Doc) protected ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory)(Code)(Java Doc) protected ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory, boolean createNewSession)(Code)(Java Doc) protected ActionTestModule createActionTestModule()(Code)(Java Doc) protected ActionTestModule createActionTestModule(ActionMockObjectFactory mockFactory)(Code)(Java Doc) protected DynaActionForm createDynaActionForm(FormBeanConfig formConfig)(Code)(Java Doc) protected ValidatorResources createValidatorResources(String[] resourcesFiles)(Code)(Java Doc) protected void generateValidToken()(Code)(Java Doc) protected ActionMessage getActionErrorByKey(String errorKey)(Code)(Java Doc) protected ActionMessages getActionErrors()(Code)(Java Doc) protected ActionMessages getActionErrorsFromRequest()(Code)(Java Doc) protected ActionMessages getActionErrorsFromSession()(Code)(Java Doc) protected ActionForm getActionForm()(Code)(Java Doc) protected MockActionForward getActionForward()(Code)(Java Doc) protected ActionMapping getActionMapping()(Code)(Java Doc) protected ActionMessage getActionMessageByKey(String messageKey)(Code)(Java Doc) protected ActionMessages getActionMessages()(Code)(Java Doc) protected ActionMessages getActionMessagesFromRequest()(Code)(Java Doc) protected ActionMessages getActionMessagesFromSession()(Code)(Java Doc) protected ActionMockObjectFactory getActionMockObjectFactory()(Code)(Java Doc) protected ActionTestModule getActionTestModule()(Code)(Java Doc) protected HTMLOutputModule getHTMLOutputModule()(Code)(Java Doc) protected Action getLastAction()(Code)(Java Doc) protected MockActionMapping getMockActionMapping()(Code)(Java Doc) protected MockPageContext getMockPageContext()(Code)(Java Doc) protected boolean hasActionErrors()(Code)(Java Doc) protected boolean hasActionMessages()(Code)(Java Doc) protected void populateRequestToForm()(Code)(Java Doc) protected void setActionErrors(ActionMessages errors)(Code)(Java Doc) protected void setActionErrorsToSession(ActionMessages errors)(Code)(Java Doc) protected void setActionForm(ActionForm formObj)(Code)(Java Doc) protected void setActionMessages(ActionMessages messages)(Code)(Java Doc) protected void setActionMessagesToSession(ActionMessages messages)(Code)(Java Doc) protected void setActionMockObjectFactory(ActionMockObjectFactory actionMockObjectFactory)(Code)(Java Doc) protected void setActionTestModule(ActionTestModule actionTestModule)(Code)(Java Doc) protected void setDataSource(DataSource dataSource)(Code)(Java Doc) protected void setDataSource(String key, DataSource dataSource)(Code)(Java Doc) protected void setDoPopulate(boolean doPopulate)(Code)(Java Doc) protected void setErrorAttributeKey(String errorAttributeKey)(Code)(Java Doc) protected void setInput(String input)(Code)(Java Doc) protected void setLocale(Locale locale)(Code)(Java Doc) protected void setMessageAttributeKey(String messageAttributeKey)(Code)(Java Doc) protected void setParameter(String parameter)(Code)(Java Doc) protected void setRecognizeMessagesInSession(boolean recognizeInSession)(Code)(Java Doc) protected void setReset(boolean reset)(Code)(Java Doc) protected void setResources(MessageResources resources)(Code)(Java Doc) protected void setResources(String key, MessageResources resources)(Code)(Java Doc) protected void setUp() throws Exception(Code)(Java Doc) protected void setValidate(boolean validate)(Code)(Java Doc) protected void setValidatorResources(ValidatorResources validatorResources)(Code)(Java Doc) protected void tearDown() throws Exception(Code)(Java Doc) protected void verifyActionErrorNotPresent(String errorKey)(Code)(Java Doc) protected void verifyActionErrorPresent(String errorKey)(Code)(Java Doc) protected void verifyActionErrorProperty(String errorKey, String property)(Code)(Java Doc) protected void verifyActionErrorValue(String errorKey, Object value)(Code)(Java Doc) protected void verifyActionErrorValues(String errorKey, Object[] values)(Code)(Java Doc) protected void verifyActionErrors(String[] errorKeys)(Code)(Java Doc) protected void verifyActionMessageNotPresent(String messageKey)(Code)(Java Doc) protected void verifyActionMessagePresent(String messageKey)(Code)(Java Doc) protected void verifyActionMessageProperty(String messageKey, String property)(Code)(Java Doc) protected void verifyActionMessageValue(String messageKey, Object value)(Code)(Java Doc) protected void verifyActionMessageValues(String messageKey, Object[] values)(Code)(Java Doc) protected void verifyActionMessages(String[] messageKeys)(Code)(Java Doc) protected void verifyForward(String path)(Code)(Java Doc) protected void verifyForwardName(String name)(Code)(Java Doc) protected void verifyHasActionErrors()(Code)(Java Doc) protected void verifyHasActionMessages()(Code)(Java Doc) protected void verifyNoActionErrors()(Code)(Java Doc) protected void verifyNoActionMessages()(Code)(Java Doc) protected void verifyNumberActionErrors(int number)(Code)(Java Doc) protected void verifyNumberActionMessages(int number)(Code)(Java Doc) protected void verifyRedirect(boolean redirect)(Code)(Java Doc)
|
|
|
|