Titan



port


The keyword is used to define a test port. Ports facilitate communication between test components and between test components and the test system interface. Ports are always bidirectional.

Related keywords:


1. Declaring a message-based port


type port port_identifier  message {in all | type_list; ]   [  out all | type_list; ]   [  inout all | type_list;};

No element may be repeated within the curly brackets.

Example


2. Declaring a procedure-based port


type port port_identifier  procedure {in all | type_list; ]   [  out all | type_list; ]   [  inout all | type_list;};

No element may be repeated within the curly brackets.

Example


3. Declaring a mixed port


type port port_identifier  mixed {in all | type_list; ]   [  out all | type_list; ]   [  inout all | type_list;};

 

TITAN specific restriction compared to the standard:

 Mixed ports are not implemented. When encountered in the TTCN-3 program, it will cause a compilation error.

No element may be repeated within the curly brackets.

Example


Example 1:

type port MyMessagePortType_PT message { 
   in ASP_RxType1, ASP_RxType2; 
   out ASP_TxType; 
   inout integer, octetstring; 
}

The message-based port called MyMessagePortType_PT is declared. 
In incoming directions messages of type ASP_RxType1, ASP_RxType2, 
in outgoing directions messages of type ASP_TxType1, 
in both outgoing and incoming direction messages of type integer and octetstring
are allowed to pass the port.


Example 2:

type port MyProcedurePortType_PT procedure { 
   out Proc1, Proc2, Proc3 
}

The procedure-based port called MyProcedurePortType_PT is declared. 
In outgoing directions the signatures Proc1, Proc2 and Proc3 are allowed to pass the port.


Example 3:

type port MyAllMixedPortType_PT mixed { 
   inout all 
}

The mixed port called MyAllMixedPortType_PT is declared. 
In both outgoing and incoming direction all message types and all signatures defined in the module can be used at this port to communicate with either the system under test (SUT) or other test components.



BNF definition of port