Skip to main content
This revision made September 29, 2012 14:50, by steven.davelaar

Testing Task Flows

Main Table of Contents

Specifying Input Parameter Values

For every task flow input parameter, you can use an EL expression to specify a value. The tester runs in the memory scope of the unbounded task flow, so you can reference any managed bean that you defined in your adfc-config.xml in the EL expression. You can also use all other common ADF EL expressions, for example #{} to get the name of the logged in user or #{securityContext.userInRole['Administrator']} to test role privilege if you have secured your application using ADF security.

If you do not use an EL expression, then the way you specify the input parameter value depends on the input parameter class, as explained in the subsections below. If no class name is specified with task flow input parameter definition, then the tester defaults the class to java.lang.Object.

Specifying Primitive Type Values

For the folllowing input parameter classes you can directly enter a value that will be auto-converted to the correct type: java.lang.Integer, java.lang.String, java.math.BigDecimal, java.lang.Long, java.lang.Short, java.lang.Double,java.lang.Float, java.lang.Boolean, java.lang.Character, java.lang.Byte, oracle.jbo.domain.Number

Specifying Date Values

If the input parameter class is a date type (java.util.Date, oracle.jbo.domain.Date or oracle.jbo.domain.TimeStamp), you can enter a date value using the format dd-MM-yyyy.

Specifying oracle.jbo.Key Values

If the input parameter class is oracle.jbo.Key, you can specify the value of the key attribute. If the key object is a composite key existing of multiple attriubutes, you can specify a comma-delimited list of key attribute values. Note that the values must be specified in the same order as the attributes are defined in the key.

Specifying Map Values

If the input parameter is of type java.util.Map or java.util.HashMap, you can use the edit icon to launch a dialog to construct the map.

In the dialog you can use the "Add Map Entry" button to add multiple entries. Based on the class name you enter an edit icon will appear allowing you to add complex or (nested) map types as a map entry.

Specifying Complex Type Values

If the input parameter type is not one of the types discussed above, you are dealing with a so-called complex type, typically a custom Java class with a number of properties.

Provided that this Java class has a public no-arguments constructor, you can use the edit icon to launch a dialog to construct the complex type.

All the properties of the complex type with a public setter method are displayed. As you can see the property can be a map or complex type itself, allowing you to use a nested dialog editor to specify the map or complex type values. The tester supports an unlimited number of nesting levels to specify complex types.

Specifying java.lang.Object Values

If the input parameter type is not defined, or set to java.lang.Object, you need to use the edit icon to launch a dialog where you can enter the class name you want to use for your parameter value.

If you then enter a primitive type, a date type or oracle.jbo.Key as the class name, you can click OK to close the dialog again so you can enter the value directly in the input parameter field.

If you enter a map type as class name, you can also click OK to close the dialog, and if you then click the edit icon again, the map editor dialog will be launched. If you enter a complex type as class name, then all properties that have a setter method in the class appear when you tab out the class name field. See Specifying Complex Type Values] for more info.

Using your Own Java Code to Set Up Parameter Values

As you have learned from the above descriptions, the tester provides a sophisticated mechanism to spefiy simple to very complex input parameter values. If this mechanism is not sufficient for your specific test case, for example because you need to instaitae a complex type that does not have a public no-arguments constructor, then you can write your own task flow parameter setup Java class with simple getter methods for the various task flow parameters. Register this class as a managed bean in the adfc-config.xml, and you can simply use an EL expression that references the appropriate getter method in your set up class to set up the parameter value.

Understanding the Run Options

Saving Task Flow Testcases

If you want to save a combination of task flow input parameters and run options you can do so by clicking the "Save As..." button.

If you click OK, after entering a name for the testcase and optionally a description, the testcase will appear in the tree menu at the left. Clicking on a tescase in the tree menu will prepopulate the input paramers with the vaklues as set when you saved the testcase.


Note that you saved the testcases for the duration of the session. If you undeploy your application and run the tester again, the tree menu will be empty. Fortunately, you can export and import testcases and you can also start the tester with preloaded task flows and testcases. See section Adding, Loading, Importing and Exporting Taskflows and Testcases.

Difference compared to previous revision
===Understanding the Run Options=== ===Saving Task Flow Testcases=== If you want to save a combination of task flow input parameters and run options you can do so by clicking the "Save As..." button. [[image: SaveAsTestcase.jpg|block]]
Please Confirm