murano/murano/tests/unit/dsl/meta/SampleClass1.yaml
Stan Lagun 425766a7f8 Migration to yaql 1.0
* Code migrated to yaql 1.0.0
* New MuranoPL object initialization
* Lots of refactoring

See referenced specs for more information

Implements: blueprint migrate-to-yaql-vnext
Implements: blueprint object-construction
Depends-on: I7f314634ab5f08a521e51082d5c84dffca4b0b5c
Closes-Bug: #1454264

Change-Id: I740a4f83c76d8b56a1da585a739d770ef823a524
2015-08-25 16:08:08 +03:00

95 lines
2.1 KiB
YAML

Name: SampleClass1
Properties:
stringProperty:
Contract: $.string().notNull()
classProperty:
Contract: $.class(SampleClass2).notNull()
assignedProperty:
Contract: $
Usage: Runtime
arbitraryProperty:
Contract: $
Workflow:
testTrace:
Arguments:
- intArg:
Contract: $.int().notNull()
Body:
- trace($intArg)
- trace($.stringProperty)
- trace($.classProperty.class2Property)
testException:
Body:
- raiseException()
testReturn:
Arguments:
- intArg:
Contract: $.int().notNull()
Body:
Return: $intArg
testCallAnotherMethod:
Body:
- trace(method1)
- $.anotherMethod()
anotherMethod:
Body:
- trace(method2)
testAttributes:
Arguments:
- arg:
Contract: $.string()
Body:
- $.setAttr(att1, $arg)
- $x: $.getAttr(att1)
- $y: $.getAttr(att2, ' Doe')
- Return: $x + $y
testAssignment:
Body:
- $result: {}
- $result.Arr: [1, 2, [10, 11]]
- $index: 1
- $result.Arr[0]: 3
- $result.Arr[$index - 1]: 5
- $result.Arr[$index + 1][1]: 123
#- $result.Dict: {}
- $result.Dict.Key1: V1
- $keyName: Key2
- $result.Dict[$keyName]: {}
- $result.Dict[$keyName]['a_b']: V2
- $result.Dict[$keyName][toUpper($keyName)]: V3
- Return: $result
testAssignmentOnProperty:
Body:
#- $.assignedProperty: {}
- $.assignedProperty.Arr: [1, 2, [10, 11]]
- $index: 1
- $.assignedProperty.Arr[0]: 3
- $.assignedProperty.Arr[$index - 1]: 5
- $.assignedProperty.Arr[$index + 1][1]: 123
#- $.assignedProperty.Dict: {}
- $.assignedProperty.Dict.Key1: V1
- $keyName: Key2
- $.assignedProperty.Dict[$keyName]: {}
- $.assignedProperty.Dict[$keyName]['a_b']: V2
- $.assignedProperty.Dict[$keyName][toUpper($keyName)]: V3
- Return: $.assignedProperty
testAssignByCopy:
Arguments:
- arg:
Contract: [$.int()]
Body:
- $x: $arg
- $x[0]: 321
- Return: $arg