Part 2: Parameterization of asynchronous packages

../../_images/Tut_PT_Part2.png

Objective

Parameterization of asynchronous packages with input and return values

Test creation

  1. Switch to “sender” in test case editor

  2. Create the numeric variable “loopCounter” with the standard value by selecting New variable in the context menu of tab Variables right below the test case editor

  3. Create the numeric variable “maxLoop” with the standard value

  4. Edit the loop by entering “maxLoop” as number of loops and “loopCounter” as counter

  5. The variable “maxLoop” is marked as input parameter and the variable “loopCounter” as return value see image “Variables with parameter marking”)

  6. As in the above procedure, the packages “receiver1” and “receiver2” are to get the variable “maxLoop” as input parameter and number of loops, and the variable “loopCounter” as loop counter (“loopCounter” needs not be marked as return value)

  7. Switch to “main” in test case editor

  8. Create the numeric variable “sendCountInput” with the value 10

  9. Create the numeric variable “sendCountOutput” with the standard value

  10. Open the package parameterization dialog of “sender” by double-clicking the package in the entry of “main” in the test case editor, and create the parameter-and-return link like in image “parameterization with variable link”

  11. The packages “receiver1” and “receiver2” are to be attributed the same input parameter (sendCountInput) like in the previous step

  12. After calling up “receiver2” in the test case of “main”, insert an if-then-else branching with the condition “sendCountInput == sendCountOutput”

  13. Insert into the “THEN” branch the comment “sending counter coincides with expectation” with the evaluation “SUCCESS”

  14. Insert into the “ELSE” branch the comment “sending counter does not coincide with expectation” with the evaluation “FAILED”

  15. Save all packages and execute the main package

../../_images/ParalleleTests_Variablen.png

Variables with parameter marking

../../_images/ParalleleTests_Parametrierung.png

Parameterization with variable link

Result

The package “main” provides “sender”, “receiver1” and “receiver2” with an input parameter which controls the number of loop runs. In addition, the return value is read out by “sender” and compared with the transfer parameter.

Remark

“Main” now waits explicitly for “sender” to finish in order to evaluate sender’s return value.