Skip to main content
This revision made September 29, 2012 18:02, 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 #{securityContext.userPrincipal.name} 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.

Running a Test

After you specified the task flow input parameters (if any), or you selected a previously saved testcase, you are ready to run a test. If you are testing a task flow with page fragments you have a number of run options you can set.

  • Stretch Layout: If the page fragements in the task flow are set up to stretch the layout vertically, you can check this checkbox to test the stretching. If you uncheck this checkbox, you can see how the layout will be when the task flow is embedded in a page that has a flowing layout at the insertion point of the ADF region. If the page fragments in your task flow having a flowing layout, the value of the checkbox doesn't matter for your test.
  • Run in Region: If you select this option, the task flow will be run in the tester region at lower right side of the page.

y are embedded in a

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
<span>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. ===<span style="text-decoration:line-through;color:red">U</span><span style="text-decoration:underline;color:green">Ru</span>n<span style="text-decoration:underline;color:green">ning a Test=== After you specifie</span>d<span style="text-decoration:underline;color:green"> th</span>e<span style="text-decoration:underline;color:green"> task flow input pa</span>r<span style="text-decoration:underline;color:green">ameter</span>s<span style="text-decoration:underline;color:green"> (if any), or you selec</span>t<span style="text-decoration:underline;color:green">ed </span>a<span style="text-decoration:underline;color:green"> previously saved testcase, you are ready to ru</span>n<span style="text-decoration:underline;color:green"> a test. If you are testing a task flow with page fragments you have a number of run options you can set. [[image: RunOptions.jpg]] * Stretch Layout: If the page fragements in the task flow are set up to stretch the layout vertically, you can check this checkbox to test the stretching. If you uncheck this checkbox, you can see how the layout will be when the task flow is embe</span>d<span style="text-decoration:underline;color:green">ded </span>in<span style="text-decoration:underline;color:green"> a pa</span>g<span style="text-decoration:underline;color:green">e</span> th<span style="text-decoration:underline;color:green">at has a flowing layout at th</span>e <span style="text-decoration:underline;color:green">insertion point of the ADF region. If the page fragments in your task flow having a flowing layout, the value of the checkbox doesn't matter for your test. * </span>nderstanding the Run <span style="text-decoration:line-through;color:red">O</span>Run <span style="text-decoration:underline;color:green">in Region: If you select this o</span>ption<span style="text-decoration:underline;color:green">, the ta</span>ptions<span style="text-decoration:line-through;color:red">===</span>s<span style="text-decoration:underline;color:green">k flow will be run in the tester region at lower right side of the page. y are embedded in a </span> ===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.<span>
 
 
Close
loading
Please Confirm
Close