Java Doc for ActionTestModule.java in  » Testing » mockrunner-0.4 » com » mockrunner » struts » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » mockrunner 0.4 » com.mockrunner.struts 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.mockrunner.base.HTMLOutputModule
   com.mockrunner.struts.ActionTestModule

ActionTestModule
public class ActionTestModule extends HTMLOutputModule (Code)
Module for Struts action tests. Simulates Struts without reading the struts-config.xml file. Per default this class does everything like Struts when calling an action but you can change the behaviour (e.g. disable form population). Please note: If your action throws an exception and an exception handler is registered (use ActionTestModule.addExceptionHandler ), the handler will be called to handle the exception. Otherwise the exception will be rethrown as com.mockrunner.base.NestedApplicationException .



Constructor Summary
public  ActionTestModule(ActionMockObjectFactory mockFactory)
    

Method Summary
public  ActionForwardactionPerform(Class action)
     Calls the action of the specified type using no ActionForm.
public  ActionForwardactionPerform(Action action)
     Calls the specified action using no ActionForm.
public  ActionForwardactionPerform(Class action, Class form)
     Calls the action of the specified type using the ActionForm of the specified type.
public  ActionForwardactionPerform(Action action, Class form)
     Calls the specified action using the ActionForm of the specified type.
public  ActionForwardactionPerform(Class action, ActionForm form)
     Calls the action of the specified type using the specified ActionForm object.
public  ActionForwardactionPerform(Action action, ActionForm form)
     Calls the specified action using the specified ActionForm object.
public  voidaddExceptionHandler(ExceptionHandlerConfig handler)
     Registers an exception handler.
public  StringaddMappedPropertyRequestPrefix(String property)
     Convenience method for map backed properties.
public  ActionFormcreateActionForm(Class form)
     Creates a new ActionForm object of the specified type and sets it as the current ActionForm.
public  DynaActionFormcreateDynaActionForm(FormBeanConfig formConfig)
     Creates a new DynaActionForm based on the specified form config and sets it as the current ActionForm.
public  ValidatorResourcescreateValidatorResources(String[] resourcesFiles)
     Creates a valid ValidatorResources object based on the specified config files.
public  voidgenerateValidToken()
     Generates a token and sets it to the session and the request.
public  ActionMessagegetActionErrorByKey(String errorKey)
     Returns the action error with the specified key or null if such an error does not exist.
public  ActionMessagesgetActionErrors()
     Get the currently present action errors.
public  ActionMessagesgetActionErrorsFromRequest()
     Get the currently present action errors from the request.
public  ActionMessagesgetActionErrorsFromSession()
     Get the currently present action errors from the session.
public  ActionFormgetActionForm()
     Returns the current ActionForm.
public  MockActionForwardgetActionForward()
     Returns the current ActionForward.
public  ActionMappinggetActionMapping()
     Delegates to com.mockrunner.mock.web.ActionMockObjectFactory.getActionMapping .
public  ActionMessagegetActionMessageByKey(String messageKey)
     Returns the action message with the specified key or null if such a message does not exist.
public  ActionMessagesgetActionMessages()
     Get the currently present action messages.
public  ActionMessagesgetActionMessagesFromRequest()
     Get the currently present action messages from the request.
public  ActionMessagesgetActionMessagesFromSession()
     Get the currently present action messages from the session.
public  ActiongetLastAction()
     Returns the last tested Action object.
public  MockActionMappinggetMockActionMapping()
     Delegates to com.mockrunner.mock.web.ActionMockObjectFactory.getMockActionMapping .
public  MockPageContextgetMockPageContext()
     Returns the MockPageContext object.
public  StringgetOutput()
     Returns the HTML output as a string (if the action creates HTML output).
public  booleanhasActionErrors()
     Returns if action errors are present.
public  booleanhasActionMessages()
     Returns if action messages are present.
public  voidpopulateRequestToForm()
     Populates the current request parameters to the ActionForm.
public  voidsetActionErrors(ActionMessages errors)
     Sets the specified ActionErrors object as the currently present errors to the request.
public  voidsetActionErrorsToSession(ActionMessages errors)
     Sets the specified ActionErrors object as the currently present errors to the session.
public  voidsetActionForm(ActionForm formObj)
     Sets the specified ActionForm object as the current ActionForm.
public  voidsetActionMessages(ActionMessages messages)
     Sets the specified ActionMessages object as the currently present messages to the request.
public  voidsetActionMessagesToSession(ActionMessages messages)
     Sets the specified ActionMessages object as the currently present messages to the session.
public  voidsetDataSource(DataSource dataSource)
     Sets the specified DataSource.
public  voidsetDataSource(String key, DataSource dataSource)
     Sets the specified DataSource.
public  voidsetDoPopulate(boolean doPopulate)
     Set if the form should be populated with the request parameters before calling the action.
public  voidsetErrorAttributeKey(String errorAttributeKey)
     Name of the key under which errors are stored.
public  voidsetInput(String input)
     Sets the input attribute.
public  voidsetLocale(Locale locale)
     Sets the specified locale as a session attribute using Globals.LOCALE_KEY as the key.
public  voidsetMessageAttributeKey(String messageAttributeKey)
     Name of the key under which messages are stored.
public  voidsetParameter(String parameter)
     Sets the parameter by calling ActionMapping.setParameter on the action mapping returned by ActionTestModule.getActionMapping .
public  voidsetRecognizeMessagesInSession(boolean recognizeInSession)
     Set if messages that are saved to the session (instead of the request) should be recognized.
public  voidsetReset(boolean reset)
     Set if the reset method should be called before populating a form with ActionTestModule.populateRequestToForm .
public  voidsetResources(MessageResources resources)
     Sets the specified messages resources as a request attribute using Globals.MESSAGES_KEY as the key.
public  voidsetResources(String key, MessageResources resources)
     Sets the specified messages resources as a servlet context attribute using the specified key and the module config prefix. You can use this method, if your action calls Action.getResources(HttpServletRequest, String). Please note that the com.mockrunner.mock.web.MockModuleConfig is set by Mockrunner as the current module.
public  voidsetValidate(boolean validate)
     Sets if form validation should be performed before calling the action. Calls ActionMapping.setValidate on the action mapping returned by ActionTestModule.getActionMapping .
public  voidsetValidatorResources(ValidatorResources validatorResources)
     Sets the specified ValidatorResources.
public  voidverifyActionErrorNotPresent(String errorKey)
     Verifies that an action error with the specified key is not present.
public  voidverifyActionErrorPresent(String errorKey)
     Verifies that an action error with the specified key is present.
public  voidverifyActionErrorProperty(String errorKey, String property)
     Verifies that the specified error is stored for the specified property.
public  voidverifyActionErrorValue(String errorKey, Object value)
     Verifies the value of the action error with the specified key.
public  voidverifyActionErrorValues(String errorKey, Object[] values)
     Verifies the values of the action error with the specified key.
public  voidverifyActionErrors(String errorKeys)
     Verifies that the specified action errors are present.
public  voidverifyActionMessageNotPresent(String messageKey)
     Verifies that an action message with the specified key is not present.
public  voidverifyActionMessagePresent(String messageKey)
     Verifies that an action message with the specified key is present.
public  voidverifyActionMessageProperty(String messageKey, String property)
     Verifies that the specified message is stored for the specified property.
public  voidverifyActionMessageValue(String messageKey, Object value)
     Verifies the value of the action message with the specified key.
public  voidverifyActionMessageValues(String messageKey, Object[] values)
     Verifies the values of the action message with the specified key.
public  voidverifyActionMessages(String messageKeys)
     Verifies that the specified action messages are present.
public  voidverifyForward(String path)
     Verifies the forward path returned by the action. If your action uses mapping.findForward("success") to find the forward, you can use this method or ActionTestModule.verifyForwardName to test the success forward name.
public  voidverifyForwardName(String name)
     Verifies the forward name returned by the action. If your action uses mapping.findForward("success") to find the forward, you can use this method or ActionTestModule.verifyForward to test the success forward name.
public  voidverifyHasActionErrors()
     Verifies that there are action errors present.
public  voidverifyHasActionMessages()
     Verifies that there are action messages present.
public  voidverifyNoActionErrors()
     Verifies that there are no action errors present.
public  voidverifyNoActionMessages()
     Verifies that there are no action messages present.
public  voidverifyNumberActionErrors(int number)
     Verifies the number of action errors.
public  voidverifyNumberActionMessages(int number)
     Verifies the number of action messages.
public  voidverifyRedirect(boolean redirect)
     Verifies the redirect attribute.


Constructor Detail
ActionTestModule
public ActionTestModule(ActionMockObjectFactory mockFactory)(Code)




Method Detail
actionPerform
public ActionForward actionPerform(Class action)(Code)
Calls the action of the specified type using no ActionForm. Sets the current action form to null.
Parameters:
  action - the Class of the action the resulting ActionForward



actionPerform
public ActionForward actionPerform(Action action)(Code)
Calls the specified action using no ActionForm. Sets the current ActionForm to null.
Parameters:
  action - the Action the resulting ActionForward



actionPerform
public ActionForward actionPerform(Class action, Class form)(Code)
Calls the action of the specified type using the ActionForm of the specified type. Creates the appropriate ActionForm, sets it as the current ActionForm and populates it before calling the action (if populating is disabled, the form will not be populated, use ActionTestModule.setDoPopulate ). If form validation is enabled (use ActionTestModule.setValidate ) and fails, the action will not be called. In this case, the returned ActionForward is based on the input attribute. (Set it with ActionTestModule.setInput ).
Parameters:
  action - the Class of the action
Parameters:
  form - the Class of the form the resulting ActionForward



actionPerform
public ActionForward actionPerform(Action action, Class form)(Code)
Calls the specified action using the ActionForm of the specified type. Creates the appropriate ActionForm, sets it as the current ActionForm and populates it before calling the action (if populating is disabled, the form will not be populated, use ActionTestModule.setDoPopulate ). If form validation is enabled (use ActionTestModule.setValidate ) and fails, the action will not be called. In this case, the returned ActionForward is based on the input attribute. (Set it with ActionTestModule.setInput ).
Parameters:
  action - the Action
Parameters:
  form - the Class of the form the resulting ActionForward



actionPerform
public ActionForward actionPerform(Class action, ActionForm form)(Code)
Calls the action of the specified type using the specified ActionForm object. The form will be set as the current ActionForm and will be populated before the action is called (if populating is disabled, the form will not be populated, use ActionTestModule.setDoPopulate ). Please note that request parameters will eventually overwrite form values. Furthermore the form will be reset before populating it. If you do not want that, disable reset using ActionTestModule.setReset . If form validation is enabled (use ActionTestModule.setValidate ) and fails, the action will not be called. In this case, the returned ActionForward is based on the input attribute. (Set it with ActionTestModule.setInput ).
Parameters:
  action - the Class of the action
Parameters:
  form - the ActionForm object the resulting ActionForward



actionPerform
public ActionForward actionPerform(Action action, ActionForm form)(Code)
Calls the specified action using the specified ActionForm object. The form will be set as the current ActionForm and will be populated before the action is called (if populating is disabled, the form will not be populated, use ActionTestModule.setDoPopulate ). Please note that request parameters will eventually overwrite form values. Furthermore the form will be reset before populating it. If you do not want that, disable reset using ActionTestModule.setReset . If form validation is enabled (use ActionTestModule.setValidate ) and fails, the action will not be called. In this case, the returned ActionForward is based on the input attribute. (Set it with ActionTestModule.setInput ).
Parameters:
  action - the Action
Parameters:
  form - the ActionForm object the resulting ActionForward



addExceptionHandler
public void addExceptionHandler(ExceptionHandlerConfig handler)(Code)
Registers an exception handler. The exception handler will be called if an action throws an exception. Usually, you will pass an instance of DefaultExceptionHandlerConfig to this method. DefaultExceptionHandlerConfig relies on Struts ExceptionHandler classes. In special cases, you may add own implementations of ExceptionHandlerConfig , that may be independent from the Struts exception handling mechanism. If no matching handler is registered, the exception will be rethrown as com.mockrunner.base.NestedApplicationException .
Parameters:
  handler - the exception handler



addMappedPropertyRequestPrefix
public String addMappedPropertyRequestPrefix(String property)(Code)
Convenience method for map backed properties. Creates a String value(property).
Parameters:
  property - the property the String in map backed propery style



createActionForm
public ActionForm createActionForm(Class form)(Code)
Creates a new ActionForm object of the specified type and sets it as the current ActionForm.
Parameters:
  form - the Class of the form



createDynaActionForm
public DynaActionForm createDynaActionForm(FormBeanConfig formConfig)(Code)
Creates a new DynaActionForm based on the specified form config and sets it as the current ActionForm.
Parameters:
  formConfig - the FormBeanConfig



createValidatorResources
public ValidatorResources createValidatorResources(String[] resourcesFiles)(Code)
Creates a valid ValidatorResources object based on the specified config files. Since the parsing of the files is time consuming, it makes sense to cache the result. You can set the returned ValidatorResources object with ActionTestModule.setValidatorResources . It is then used in all validations.
Parameters:
  resourcesFiles - the array of config files



generateValidToken
public void generateValidToken()(Code)
Generates a token and sets it to the session and the request.



getActionErrorByKey
public ActionMessage getActionErrorByKey(String errorKey)(Code)
Returns the action error with the specified key or null if such an error does not exist.
Parameters:
  errorKey - the error key the action error with the specified key



getActionErrors
public ActionMessages getActionErrors()(Code)
Get the currently present action errors. Can be called after ActionTestModule.actionPerform to get the errors the action has set. If messages in the session are recognized (use ActionTestModule.setRecognizeMessagesInSession ), this method returns the union of request and session errors. Otherwise, it only returns the request errors. the action errors



getActionErrorsFromRequest
public ActionMessages getActionErrorsFromRequest()(Code)
Get the currently present action errors from the request. the action messages



getActionErrorsFromSession
public ActionMessages getActionErrorsFromSession()(Code)
Get the currently present action errors from the session. the action messages



getActionForm
public ActionForm getActionForm()(Code)
Returns the current ActionForm. the ActionForm object



getActionForward
public MockActionForward getActionForward()(Code)
Returns the current ActionForward. Can be called after ActionTestModule.actionPerform to get the ActionForward the action has returned. the MockActionForward



getActionMapping
public ActionMapping getActionMapping()(Code)
Delegates to com.mockrunner.mock.web.ActionMockObjectFactory.getActionMapping . the MockActionMapping



getActionMessageByKey
public ActionMessage getActionMessageByKey(String messageKey)(Code)
Returns the action message with the specified key or null if such a message does not exist.
Parameters:
  messageKey - the message key the action message with the specified key



getActionMessages
public ActionMessages getActionMessages()(Code)
Get the currently present action messages. Can be called after ActionTestModule.actionPerform to get the messages the action has set. If messages in the session are recognized (use ActionTestModule.setRecognizeMessagesInSession ), this method returns the union of request and session messages. Otherwise, it only returns the request messages. the action messages



getActionMessagesFromRequest
public ActionMessages getActionMessagesFromRequest()(Code)
Get the currently present action messages from the request. the action messages



getActionMessagesFromSession
public ActionMessages getActionMessagesFromSession()(Code)
Get the currently present action messages from the session. the action messages



getLastAction
public Action getLastAction()(Code)
Returns the last tested Action object. the Action object



getMockActionMapping
public MockActionMapping getMockActionMapping()(Code)
Delegates to com.mockrunner.mock.web.ActionMockObjectFactory.getMockActionMapping . the MockActionMapping



getMockPageContext
public MockPageContext getMockPageContext()(Code)
Returns the MockPageContext object. Delegates to com.mockrunner.mock.web.ActionMockObjectFactory.getMockPageContext . the MockPageContext



getOutput
public String getOutput()(Code)
Returns the HTML output as a string (if the action creates HTML output). Flushes the output before returning it. the output



hasActionErrors
public boolean hasActionErrors()(Code)
Returns if action errors are present. true if errors are present, false otherwise



hasActionMessages
public boolean hasActionMessages()(Code)
Returns if action messages are present. true if messages are present, false otherwise



populateRequestToForm
public void populateRequestToForm()(Code)
Populates the current request parameters to the ActionForm. The form will be reset before populating if reset is enabled ( ActionTestModule.setReset . If form validation is enabled (use ActionTestModule.setValidate ) the form will be validated after populating it and the appropriate ActionErrors will be set.



setActionErrors
public void setActionErrors(ActionMessages errors)(Code)
Sets the specified ActionErrors object as the currently present errors to the request.
Parameters:
  errors - the ActionErrors object



setActionErrorsToSession
public void setActionErrorsToSession(ActionMessages errors)(Code)
Sets the specified ActionErrors object as the currently present errors to the session.
Parameters:
  errors - the ActionErrors object



setActionForm
public void setActionForm(ActionForm formObj)(Code)
Sets the specified ActionForm object as the current ActionForm.
Parameters:
  formObj - the ActionForm object



setActionMessages
public void setActionMessages(ActionMessages messages)(Code)
Sets the specified ActionMessages object as the currently present messages to the request.
Parameters:
  messages - the ActionMessages object



setActionMessagesToSession
public void setActionMessagesToSession(ActionMessages messages)(Code)
Sets the specified ActionMessages object as the currently present messages to the session.
Parameters:
  messages - the ActionMessages object



setDataSource
public void setDataSource(DataSource dataSource)(Code)
Sets the specified DataSource. You can use this method, if your action calls Action.getDataSource(HttpServletRequest).
Parameters:
  dataSource - DataSource



setDataSource
public void setDataSource(String key, DataSource dataSource)(Code)
Sets the specified DataSource. You can use this method, if your action calls Action.getDataSource(HttpServletRequest, String).
Parameters:
  key - the key of the DataSource
Parameters:
  dataSource - DataSource



setDoPopulate
public void setDoPopulate(boolean doPopulate)(Code)
Set if the form should be populated with the request parameters before calling the action. Default is true which is the standard Struts behaviour.
Parameters:
  doPopulate - should population be performed



setErrorAttributeKey
public void setErrorAttributeKey(String errorAttributeKey)(Code)
Name of the key under which errors are stored. Default is Globals.ERROR_KEY.
Parameters:
  errorAttributeKey - the message key



setInput
public void setInput(String input)(Code)
Sets the input attribute. If form validation fails, the input attribute can be verified with ActionTestModule.verifyForward . Calls ActionMapping.setInput on the action mapping returned by ActionTestModule.getActionMapping .
Parameters:
  input - the input attribute



setLocale
public void setLocale(Locale locale)(Code)
Sets the specified locale as a session attribute using Globals.LOCALE_KEY as the key. You can use this method, if your action calls Action.getLocale(HttpServletRequest).
Parameters:
  locale - the locale



setMessageAttributeKey
public void setMessageAttributeKey(String messageAttributeKey)(Code)
Name of the key under which messages are stored. Default is Globals.MESSAGE_KEY.
Parameters:
  messageAttributeKey - the message key



setParameter
public void setParameter(String parameter)(Code)
Sets the parameter by calling ActionMapping.setParameter on the action mapping returned by ActionTestModule.getActionMapping . You can test your Actions with different parameter settings in the same test method.
Parameters:
  parameter - the parameter



setRecognizeMessagesInSession
public void setRecognizeMessagesInSession(boolean recognizeInSession)(Code)
Set if messages that are saved to the session (instead of the request) should be recognized. Default is true.
Parameters:
  recognizeInSession - should messages in the session be recognized



setReset
public void setReset(boolean reset)(Code)
Set if the reset method should be called before populating a form with ActionTestModule.populateRequestToForm . Default is true which is the standard Struts behaviour.
Parameters:
  reset - should reset be called



setResources
public void setResources(MessageResources resources)(Code)
Sets the specified messages resources as a request attribute using Globals.MESSAGES_KEY as the key. You can use this method, if your action calls Action.getResources(HttpServletRequest). The deprecated method Action.getResources() takes the resources from the servlet context with the same key. If your action uses this method, you have to set the resources manually to the servlet context.
Parameters:
  resources - the messages resources



setResources
public void setResources(String key, MessageResources resources)(Code)
Sets the specified messages resources as a servlet context attribute using the specified key and the module config prefix. You can use this method, if your action calls Action.getResources(HttpServletRequest, String). Please note that the com.mockrunner.mock.web.MockModuleConfig is set by Mockrunner as the current module. It has the name testmodule. This can be changed with ModuleConfig.setPrefix.
Parameters:
  key - the key of the messages resources
Parameters:
  resources - the messages resources



setValidate
public void setValidate(boolean validate)(Code)
Sets if form validation should be performed before calling the action. Calls ActionMapping.setValidate on the action mapping returned by ActionTestModule.getActionMapping . Default is false.
Parameters:
  validate - should validation be performed



setValidatorResources
public void setValidatorResources(ValidatorResources validatorResources)(Code)
Sets the specified ValidatorResources. The easiest way to create ValidatorResources is the method ActionTestModule.createValidatorResources .
Parameters:
  validatorResources - the ValidatorResources



verifyActionErrorNotPresent
public void verifyActionErrorNotPresent(String errorKey)(Code)
Verifies that an action error with the specified key is not present.
Parameters:
  errorKey - the error key
throws:
  VerifyFailedException - if verification fails



verifyActionErrorPresent
public void verifyActionErrorPresent(String errorKey)(Code)
Verifies that an action error with the specified key is present.
Parameters:
  errorKey - the expected error key
throws:
  VerifyFailedException - if verification fails



verifyActionErrorProperty
public void verifyActionErrorProperty(String errorKey, String property)(Code)
Verifies that the specified error is stored for the specified property.
Parameters:
  errorKey - the error key
Parameters:
  property - the exepcted value
throws:
  VerifyFailedException - if verification fails



verifyActionErrorValue
public void verifyActionErrorValue(String errorKey, Object value)(Code)
Verifies the value of the action error with the specified key. Fails if the specified value does not match the actual value or if the error has more than one value.
Parameters:
  errorKey - the error key
Parameters:
  value - the exepcted value
throws:
  VerifyFailedException - if verification fails



verifyActionErrorValues
public void verifyActionErrorValues(String errorKey, Object[] values)(Code)
Verifies the values of the action error with the specified key. Regards number and order of values.
Parameters:
  errorKey - the error key
Parameters:
  values - the exepcted values
throws:
  VerifyFailedException - if verification fails



verifyActionErrors
public void verifyActionErrors(String errorKeys)(Code)
Verifies that the specified action errors are present. Regards number and order of action errors.
Parameters:
  errorKeys - the array of expected error keys
throws:
  VerifyFailedException - if verification fails



verifyActionMessageNotPresent
public void verifyActionMessageNotPresent(String messageKey)(Code)
Verifies that an action message with the specified key is not present.
Parameters:
  messageKey - the message key
throws:
  VerifyFailedException - if verification fails



verifyActionMessagePresent
public void verifyActionMessagePresent(String messageKey)(Code)
Verifies that an action message with the specified key is present.
Parameters:
  messageKey - the expected message key
throws:
  VerifyFailedException - if verification fails



verifyActionMessageProperty
public void verifyActionMessageProperty(String messageKey, String property)(Code)
Verifies that the specified message is stored for the specified property.
Parameters:
  messageKey - the message key
Parameters:
  property - the exepcted value
throws:
  VerifyFailedException - if verification fails



verifyActionMessageValue
public void verifyActionMessageValue(String messageKey, Object value)(Code)
Verifies the value of the action message with the specified key. Fails if the specified value does not match the actual value or if the message has more than one value.
Parameters:
  messageKey - the message key
Parameters:
  value - the exepcted value
throws:
  VerifyFailedException - if verification fails



verifyActionMessageValues
public void verifyActionMessageValues(String messageKey, Object[] values)(Code)
Verifies the values of the action message with the specified key. Regards number and order of values.
Parameters:
  messageKey - the message key
Parameters:
  values - the exepcted values
throws:
  VerifyFailedException - if verification fails



verifyActionMessages
public void verifyActionMessages(String messageKeys)(Code)
Verifies that the specified action messages are present. Regards number and order of action messages.
Parameters:
  messageKeys - the array of expected message keys
throws:
  VerifyFailedException - if verification fails



verifyForward
public void verifyForward(String path)(Code)
Verifies the forward path returned by the action. If your action uses mapping.findForward("success") to find the forward, you can use this method or ActionTestModule.verifyForwardName to test the success forward name. If your action creates an ActionForward on its own you can use this method to verify the forward path.
Parameters:
  path - the expected path
throws:
  VerifyFailedException - if verification fails



verifyForwardName
public void verifyForwardName(String name)(Code)
Verifies the forward name returned by the action. If your action uses mapping.findForward("success") to find the forward, you can use this method or ActionTestModule.verifyForward to test the success forward name. If your action creates an ActionForward on its own you can use this method to verify the forward name.
Parameters:
  name - the expected name
throws:
  VerifyFailedException - if verification fails



verifyHasActionErrors
public void verifyHasActionErrors()(Code)
Verifies that there are action errors present.
throws:
  VerifyFailedException - if verification fails



verifyHasActionMessages
public void verifyHasActionMessages()(Code)
Verifies that there are action messages present.
throws:
  VerifyFailedException - if verification fails



verifyNoActionErrors
public void verifyNoActionErrors()(Code)
Verifies that there are no action errors present.
throws:
  VerifyFailedException - if verification fails



verifyNoActionMessages
public void verifyNoActionMessages()(Code)
Verifies that there are no action messages present.
throws:
  VerifyFailedException - if verification fails



verifyNumberActionErrors
public void verifyNumberActionErrors(int number)(Code)
Verifies the number of action errors.
Parameters:
  number - the expected number of errors
throws:
  VerifyFailedException - if verification fails



verifyNumberActionMessages
public void verifyNumberActionMessages(int number)(Code)
Verifies the number of action messages.
Parameters:
  number - the expected number of messages
throws:
  VerifyFailedException - if verification fails



verifyRedirect
public void verifyRedirect(boolean redirect)(Code)
Verifies the redirect attribute.
Parameters:
  redirect - the expected redirect attribute
throws:
  VerifyFailedException - if verification fails



Methods inherited from com.mockrunner.base.HTMLOutputModule
abstract public String getOutput()(Code)(Java Doc)
public BufferedReader getOutputAsBufferedReader()(Code)(Java Doc)
public org.jdom.Document getOutputAsJDOMDocument()(Code)(Java Doc)
public org.w3c.dom.Document getOutputAsW3CDocument()(Code)(Java Doc)
public String getOutputAsWellformedXML()(Code)(Java Doc)
public void setCaseSensitive(boolean caseSensitive)(Code)(Java Doc)
public void verifyOutput(String expectedOutput)(Code)(Java Doc)
public void verifyOutputContains(String expectedOutput)(Code)(Java Doc)
public void verifyOutputRegularExpression(String expression)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.