[More Detail] [Collapse All]
Feature: Define steps to call interface operation

Setup 'step-extension' defines array of interface operations, which
environment invokes. Each element in the array represents a time
tick, and define interface operation to execute in the time tick.
features/040-extend-steps/002-define-steps.feature
- Background: Configure setup in 'sbuilder.yaml'
link

Define setup pointing to file 'cnf/extend-steps.yaml'
features/040-extend-steps/002-define-steps.feature:11
Given I use a fixture named "fixture-resolver"
And YAML configuration file `cnf/sbuilder.yaml`
#
# 'setups' section defines two setups

setups:
- setupDirectory: setup
  extensions:
      -  url: cnf/extend-steps.yaml
- Scenario: Invoke interface operations in order 1
link

Environment invokes interface operations /customer(post),
/customer(get), /customer(delete).
features/040-extend-steps/002-define-steps.feature:27
Given a file named "cnf/extend-steps.yaml" with:
#
# Notice ordering
#
- step-extension:
       - interface: /customer(post)

       - interface: /customer(get)

       - interface: /customer(delete)
When I generate TLA+ model setup `setup`
And I do PLC transformation for setup `setup`
And I run TLC for setup `setup`
Then the stdout should contain "Model checking completed. No error has been found."
And I can observe execution trace:
Operation Tick
/customer(post) 0
/customer(get) 1
/customer(delete) 2
- Scenario: Invoke interface operations in order 2
link

Environment invokes interface operation /customer(post),
/customer(delete), /customer(get)
features/040-extend-steps/002-define-steps.feature:62
Given a file named "cnf/extend-steps.yaml" with:

# Notice ordering
#
- step-extension:
       - interface: /customer(post)

       - interface: /customer(delete)

       - interface: /customer(get)
When I generate TLA+ model setup `setup`
And I do PLC transformation for setup `setup`
And I run TLC for setup `setup`
Then the stdout should contain "Model checking completed. No error has been found."
And I can observe execution trace:
Operation Tick
/customer(post) 0
/customer(delete) 1
/customer(get) 2