[More Detail] [Collapse All]
Feature: Import interface configurations

Interface confiugration in swagger 2.0 format can be loaded from
local disk file, or using http url.
features/004-interface/interface-load.feature
- Background:
link
features/004-interface/interface-load.feature:7
Given I use a fixture named "fixture-resolver"
- Scenario: Load swagger 2.0 format file from local disk
link

Load swagger 2.0 format interface specification from local file
'data/interface_customer.yaml'.

Fixture defines setup 'default', where environment does not make
any actions. Specification generation, and TLA+ model checking
run  successfully.
features/004-interface/interface-load.feature:12
And a file named "data/interface_customer.yaml" should exist
And YAML configuration file `cnf/sbuilder.yaml`
interfaces:

    -  className: Sbuilder::ParamSetLoaderSwagger
       url: data/interface_customer.yaml
When I generate TLA+ model setup `default`
And I do PLC transformation for setup `default`
And I run TLC for setup `default`
Then the stdout should contain "Model checking completed. No error has been found."
- Scenario: Load swagger 2.0 format file from http resource
link

Load swagger 2.0 format inteface from http url, and use cache file
'petstore.yaml' in cache directory 'cache'.

Fixture defines setup 'default', where environment does not make
any actions. Specification generation, and TLA+ model checking
run  successfully.

We also check that specification code in model.tla contains fixed
strings "DEFINITION: definitions:Pet" and "END-OF-DEFINTION Pet"
to start start and end of data type definitions.
features/004-interface/interface-load.feature:36
Given a file named "data/interface_customer.yaml" should exist
And YAML configuration file `cnf/sbuilder.yaml`
interfaces:

    -  className: Sbuilder::ParamSetLoaderSwagger
       url: https://cdn.rawgit.com/swagger-api/swagger-spec/master/examples/v2.0/yaml/petstore-expanded.yaml
       cache: petstore.yaml
# Override snippets in fixture
And YAML configuration file `cnf/sbuilder.yaml`
snippets:
And a file named "cache/petstore.yaml" should not exist
When I generate TLA+ model setup `default`
Then a file named "cache/petstore.yaml" should exist
And the file named "gen/default/tla/model.tla" should match /DEFINITION: definitions:Pet/
And the file named "gen/default/tla/model.tla" should match /END-OF-DEFINTION Pet/
When I do PLC transformation for setup `default`
And I run TLC for setup `default`
Then the stdout should contain "Model checking completed. No error has been found."