Syntax of Test Primitives
Tests can be defined using annotations on data methods without parameters.
When a Poosl model is run as POOSL Tests, all data methods with a test annotation are invoked.
When a Poosl model is run as POOSL Simulation, these annotations are ignored.
The supported data method annotations are:
- @Test
Indicates that this data method must be executed by the test framework. By default the test succeeds if no exception occurs.
- @Error
Override the default behavior, such that the test succeeds if any exception occurs.
- @Error("string")
Override the default behavior, such that the test succeeds if an exception occurs with the specific name "string".
- @Error("R{string}")
Override the default behavior, such that the test succeeds if an exception occurs with the regular expression "string".
- @Skip
Skip this test.
Exceptions can be raised implicitly (e.g., through a division by zero) or explicitly (e.g., through a call of data method assert or error).
Examples