Files
deb-murano/murano/tests/dsl/meta/ExceptionHandling.yaml
Stan Lagun a6d377d992 Unit tests for exception handling in MuranoPL
Change-Id: Idc7e83f3d8ce7c1e3dd763b751c9310f683ea465
2014-07-12 21:17:29 +04:00

52 lines
1.1 KiB
YAML

Name: ExceptionHandling
Methods:
testThrow:
Arguments:
- enum:
Contract: $.int().notNull()
Body:
Try:
- trace('enter try')
- $.doThrow($enum)
- trace('exit try')
Catch:
- With: exceptionName
As: e
Do:
- trace($e.message)
- With: anotherExceptionName
As: e
Do:
- trace($e.message)
- trace(rethrow)
- Rethrow:
- As: e
Do:
- trace('catch all')
- trace($e.message)
Else:
- trace('else section')
Finally:
- trace('finally section')
doThrow:
Arguments:
- enum:
Contract: $.int().notNull()
Body:
- Match:
1:
- Throw: exceptionName
Message: exception message
2:
- Throw: anotherExceptionName
Message: exception message 2
3:
- Throw: thirdExceptionName
Message: exception message 3
4:
- Return:
Value: $enum