Skip to main content
This revision made September 28, 2012 16:23, by steven.davelaar

Adding, Loading, Importing and Exporting Task Flows and Testcases

Main Table of Contents


Loading Available Task Flows

You can use the icon to launch a dialog to load available task flows.

The "Load from Directory" field is used to determine the starting point for searching task flows relative to the web root ("public_html) folder of your web application. If you did not follow the best practice to store task flow definitions under (a sub-directory of) the WEB-INF folder, you need to change this directory to point to a directory that does contain task flows. If you want to start searching in the web root folder, you need to specify a "/" as value.
If all your task flow definitions are stored in the same folder, as specified in "Load from Directory", you can uncheck the checkbox "Recurse into Sub-Directories?". Leave this checkbox checked if you have created subfolders with task flow definitions.
As there is no runtime API call in ADF to get all bounded task flows in a web application, the task flows are found by SAX parsing all documents with extension ".xml" and then check whether the second element in the document is the task-flow-definition element. While SAX parsing is efficient with minimal memory usage (the document is streamed rather than loaded as a whole), and fast (processing is always stopped after the second XML element) it might take a while if you have a deeply nested folder structure with many xml files.

If your web application contains ADF libraries that contain task flows you want to test, then you should check the checkbox "Load from ADF Libraries?". Loading from ADF libraries is fast and efficient because the task-flow-registry.xml files are used to load the task flows. Each ADF Library contains this task-flow-registry.xml file which lists the task flow definitions that are present in the ADF library. Note that if a task flow definition is marked as "Library Private" in the task-flow-registry.xml, it will not be loaded.

Auto-Loading Task Flows and Testcases

If you export your task flows and testcases to XML, and you name this file adf-emg-task-flow-tester.xml and you store this XML file in the source root directory of your ADF project, then the task flows and testcases defined in this XML file will be auto-loaded when you start the tester. If your web application contains ADF libraries, and these libraries also contain an adf-emg-task-flow-tester.xml in the root directory of your classpath, then the content of these files are processed as well. If multiple files contain the same task flow, then the testcases of these task flows will be presented together under the the task flow node in the tree menu. Testcases with the same name are loaded both, they will show up as two entries with the same name in the tree menu. If the XML file contains a task flow definition that no longer exists or cannot be loaded in the context of the web application it will be ignored. If the XML file contains a task flow input parameter that no longer exists in the task flow definition, it will be ignored as well. If a new task flow input parameter has been added that is not yet present in the XML, it will be displayed when the testcase is selected, but of course without a value.

Exporting Task Flows and Testcases

You can use the icon to launch a dialog to export task flows and their testcases to XML.

You can either copy and paste (parts of) the XML to an existing export file, or export directly to a new file using the "Export to File..." button.

Importing Task Flows and Testcases

You can use the icon to launch a dialog to import task flows and their testcases to XML.

Note that the XML that you provide, must have the following structure:

<TaskFlowTester xmlns="http://adf.emg.org/tftester">

   <TaskFlow displayName="" taskFlowId=""/>
      <TestCase name="" runAscall="" runInRegion="" stretchLayout="">
         <ParamValueObject name="" className="" valueAsString=""/>
     </TestCase>
   </TaskFlow>

</TaskFlowTester>

If the enclosing TaskFlowTester tags are missing the import will fail.

Difference compared to previous revision
Note that the XML that you provide, must have the following structure: If the enclosing TaskFlowTester tags are missing the import will fail.
 
 
Close
loading
Please Confirm
Close