Jeté Actions 

Home Actions
The Action interface is used when setting up, running, and tearing down test cases.  Each of these are a collection of actions, some validated (depending on the action type) and some not.  

Test action hierarchy
Each action implements the Action interface, which is simply the method definition runAction().  The ValidatedAction is an abstract implementation of this interface that contains a collection of validators.  If validators are present, then they are run after the child action is run.

FormSubmissionValidatedAction
This action is used for submitting a web form to a specific URL, with confiigured request data.  This extends the WebSessionValidatedAction, for use by other web related actions for storing web conversations (per HttpUnit), web request, and web response data.  

A web conversation may be set via Spring, or initialized upon retrieval.

See Sample FormSubmissionValidatedAction

MethodInvocationAction
This action makes heavy use of Spring's MethodInvokingFactoryBean.  Simply use spring to define an object, and configure this action with that object, the method to invoke, and the arguments for that method.  

This also implements the MethodResultAction, which simply defines the getResults() interface.  This interface is used by result validators for retrieving the result object to validate.  

See Sample MethodInvocationAction

DBSetupAction
This action makes use of DbUnit DataSets to perform db operations.  Database connections use a Spring configured data source.  Multiple database operations may be specified as part of the dbOperations list.  

Possible operations are:
  • NONE
  • UPDATE
  • INSERT
  • REFRESH
  • DELETE
  • DELETE_ALL
  • TRUNCATE_TABLE
  • CLEAN_INSERT
DataSets may be either configured in the usual Spring manor, or wrapped with one of the supplied wrapper classes.  The wrapper classes exist only to help with configuration by simplifying configuration.  

If no data set wrapper is set, and a dataFilePath is specified, the ReplacementDataSetWrapper is used.  This allows very simple DBSetupAction configuration by specifying only the path of the data file without having to worry about wrappers and such, while gaining default replacement values (see below).

Current wrappers are:
  • FlatXmlDataSetWrapper - takes a filepath as a constructor, creating a File object and the FlatXmlDataSet
  • ReplacementDataSetWrapper - allows the user to specify a flat xml filepath, and object and substring replacement maps.  These maps allow the underlying dataset to search the xml file and replace the found keys with the specified data.  This wrapper also provides some default replacements:
    • [null] - inserts null into the dataset
    • [date] - inserts a new Date object into the dataset
See Sample DBSetupAction

WaitAction
This action waits a configured number of milliseconds and is helpful, for example, when asynchronous actions need to complete.

See
Sample WaitAction
hosted by SourceForge Logo