Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id380966344
Content column
id380966346
  • You must use internal simulation clock mode on the «SimulationConfig» when using the duration constraint.
  • Duration constraints will be compared between Call and Reply Messages and evaluated that can fail with a warning message shown on the Console pane if the constraints are not satisfied.
  • The execution can stop at breakpoints by setting the Constraint Failure As Breakpoint option to true in the Specification window of «SimulationConfig»

    .

    Content block
    id380966345

    Simulation allows you to evaluate duration constraints between Call Messages and Reply Messages, e.g., you can specify that a Call Message must get a Reply Message in 500 ms, so the actual duration of operation method execution must be compared with the duration constraint of 500 ms. The comparison is done as an evaluation of the constraint and will generate a fail value for testcases or stop at breakpoints on the constraint failure on the Constraint Failure As Breakpoint option. However, it does not support the delay time of a message.

    The default time unit of the duration constraint is millisecond (ms), but you can also use other time units by specifying them after the duration value, e.g., you can use 10s to denote 10 seconds. If you specify both the minimum and maximum values, Simulation will use the maximum value of the duration constraint to delay the delivery of a Message.

    A Sequence diagram showing how a Duration Constraint {500} can be used to evaluate between the Call Message and Reply Message.

    The figure above shows that cons sends a Call Message to bank to verify an account (12345678) with an expected duration constraint of 500 ms from the Reply Message. The evaluation in the first run is failed because the actual duration (431 ms) is less than 500 ms, while another run passes because the actual duration (710 ms) is greater than 500 ms.

    Warning
    titleImportant
    Content block
    id380966342

    Related pages