![]() |
![]() |
![]() |
![]() |
![]() |
The RECEIVE Statement
The receipt of ASPs and/or PDUs from the IUT or messages from other test system components is one of the fundamental events in a typical TTCN behaviour tree.
Receiving an ASP
The RECEIVE statement allows the test suite specifier to express that an ASP of a certain type is to be received over a named PCO. The RECEIVE statement is denoted by:
The RECEIVE statement may be qualified and it may be followed by an ASSIGNMENT_LIST and/or TIMER_OPERATION. The order in which these statements appear in the statement line is fixed, as shown below; the square brackets indicate that the presence of the statement in the statement line is optional:
Executing a RECEIVE Statement
The numbers on the line above indicate the order, with respect to time, in which the statements should be executed: the RECEIVE is evaluated first, and succeeds if an ASP of the correct type is at the head of the PCO queue. If the RECEIVE fails then processing stops and the statement line is not successful. If the RECEIVE is successful then the QUALIFIER (if any) is evaluated. If the QUALIFIER evaluates to FALSE processing stops and the statement line is not successful. If it evaluates to TRUE then the ASSIGNMENT_LIST (if any) is executed. Finally, the TIMER_OPERATION (if any) is executed. For example:
Receiving a PDU
Normally PDUs are embedded in ASPs, and will not be explicitly named in the RECEIVE statement. However, not all protocols have a service definition (e.g. X.25) and TTCN therefore permits the RECEIVE statement to be used explicitly with PDUs instead of ASPs. Receipt of a PDU is denoted by:
Other statements that may be associated with sending a message, and the order in which the statement line is processed, is exactly the same as for an ordinary RECEIVE statement line.
Receiving a Coordination Message
The RECEIVE statement is also used to accept messages from coordination points. Receipt of a CM is denoted by:
Other statements that may be associated with receiving a message, and the order in which the statement line is processed, is exactly the same as for an ordinary RECEIVE statement line.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |