Commit | Line | Data |
---|---|---|
970ed795 EL |
1 | <!-- |
2 | Copyright (c) 2000-2014 Ericsson Telecom AB | |
3 | ||
4 | All rights reserved. This program and the accompanying materials | |
5 | are made available under the terms of the Eclipse Public License v1.0 | |
6 | which accompanies this distribution, and is available at | |
7 | http://www.eclipse.org/legal/epl-v10.html | |
8 | --> | |
9 | <html> | |
10 | <head> | |
11 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
12 | <meta http-equiv="Content-Language" content="en-us"> | |
13 | <title>call</title> | |
14 | </head> | |
15 | <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258"> | |
16 | <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top> | |
17 | <tr> | |
18 | <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td> | |
19 | </tr> | |
20 | </table> | |
21 | <table border="0" align="right" cellpadding="0" cellspacing="0"> | |
22 | <tr> | |
23 | <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td> | |
24 | <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td> | |
25 | <td><a href="break.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td> | |
26 | <td><a href="case.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td> | |
27 | </tr> | |
28 | </table> | |
29 | <p><br clear="all"> | |
30 | </p> | |
31 | <hr> | |
32 | <h1>call</h1> | |
33 | <hr align="left" width="75%"> | |
34 | <p>The operation belongs to the family of procedure-based communication operations. It is used to specify that a test component calls a procedure in the system under test or in another test | |
35 | component. The communication may be either <a href="#Blocking">blocking</a> or <a href="#Non-blocking">non-blocking</a>. | |
36 | <ul> | |
37 | <li>The operation can be used on connected procedure-based (or mixed) ports.</li> | |
38 | <li>In case of multiple connections the receiver may be addressed.</li> | |
39 | </ul> | |
40 | <p>Related keywords:</p> | |
41 | <ul> | |
42 | <li><a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a></li> | |
43 | <li><a href="catch.html"><b><font face="Courier New" color="#003258" size="4">catch</font></b></a></li> | |
44 | <li><a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a></li> | |
45 | <li><a href="getreply.html"><b><font face="Courier New" color="#003258" size="4">getreply</font></b></a></li> | |
46 | <li><a href="modifies.html"><b><font face="Courier New" color="#003258" size="4">modifies</font></b></a></li> | |
47 | <li><a href="nowait.html"><b><font face="Courier New" color="#003258" size="4">nowait</font></b></a></li> | |
48 | <li><a href="param.html"><b><font face="Courier New" color="#003258" size="4">param</font></b></a></li> | |
49 | <li><a href="signature.html"><b><font face="Courier New" color="#003258" size="4">signature</font></b></a></li> | |
50 | <li><a href="system.html"><b><font face="Courier New" color="#003258" size="4">system</font></b></a></li> | |
51 | <li><a href="to.html"><b><font face="Courier New" color="#003258" size="4">to</font></b></a></li> | |
52 | </ul> | |
53 | <hr align="left" width="75%"> | |
54 | <p>1. <a name="Non-blocking">Non-blocking</a> communication</p> | |
55 | <hr align="left" width="50%"> | |
56 | <div align="center"> | |
57 | <center> | |
58 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
59 | <tr> | |
60 | <td width="100%"> | |
61 | <h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.call (</b></font><i> template_instance </i>[ <font face="Courier New" color="#003258" | |
62 | size="5"><b>,nowait</b></font> ] <font face="Courier New" color="#003258" size="5"><b>) </b></font>[ <font face="Courier New" color="#003258" size="5"><b>to </b></font><i>address_reference</i> ]<font | |
63 | face="Courier New" color="#003258" size="5"><b>;</b></font> </h3> | |
64 | </td> | |
65 | </tr> | |
66 | </table> | |
67 | </center> | |
68 | </div> | |
69 | <ul> | |
70 | <li> | |
71 | <p><i> port_reference</i> points out the port where the procedure is called at.</p> | |
72 | </li> | |
73 | <li> | |
74 | <p>The <b><font face="Courier New" color="#003258" size="4">call</font> </b> keyword introduces the procedure call.</p> | |
75 | </li> | |
76 | <li> | |
77 | <p><i>template_instance</i> is one of the following:</p> | |
78 | <ul> | |
79 | <li>in-line signature template (see the <a href="#Example 1">example1</a>);</li> | |
80 | <li>a specific value signature template (see the <a href="#Example 2">example 2</a>);</li> | |
81 | <li>a modified signature template (see the <a href="#Example 3">example 3</a>);<br> | |
82 | </li> | |
83 | </ul> | |
84 | </li> | |
85 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
86 | <tr> | |
87 | <td width="100%"> | |
88 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
89 | <ul> | |
90 | <li> | |
91 | <p> modified template is not implemented. When encountered in the TTCN-3 program, an error message will be generated.</p> | |
92 | </li> | |
93 | </ul> | |
94 | </td> | |
95 | </tr> | |
96 | </table> | |
97 | <li> | |
98 | <p>The optional keyword <b><font face="Courier New" color="#003258" size="4">nowait</font></b> is used when the signature is intended for blocking communication. but the process call should be | |
99 | made in a non-blocking way.</p> | |
100 | </li> | |
101 | <li> | |
102 | <p>The optional <b><font face="Courier New" color="#003258" size="4">to</font> </b> keyword is used when a port is connected to several entities and identification of the communication partner | |
103 | is required.</p> | |
104 | </li> | |
105 | </ul> | |
106 | <ul> | |
107 | <li> | |
108 | <p><i>address_reference</i> is one of the following:</p> | |
109 | <ul> | |
110 | <li>a component reference (cf. <a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a>) or the keyword <a href="system.html" | |
111 | target="_blank"><b><font face="Courier New" color="#003258" size="4">system</font></b></a>, in case of one-to-many connections.</li> | |
112 | <li>an address reference (cf. <a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a>) , when there are several entities within the | |
113 | system under test.</li> | |
114 | </ul> | |
115 | </li> | |
116 | </ul> | |
117 | <hr align="left" width="75%"> | |
118 | <p>2. <a name="Blocking">Blocking</a> communication</p> | |
119 | <hr align="left" width="50%"> | |
120 | <div align="center"> | |
121 | <center> | |
122 | <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4"> | |
123 | <tr> | |
124 | <td width="100%"> | |
125 | <h3 align="center"><i>port_reference</i><font face="Courier New" color="#003258" size="5"><b>.call (</b></font><i> template_instance </i>[ <font face="Courier New" color="#003258" | |
126 | size="5"><b>,</b></font><i>call_timer </i> ] <font face="Courier New" color="#003258" size="5"><b>) </b></font>[ <font face="Courier New" color="#003258" size="5"><b>to </b></font><i>address_reference</i> | |
127 | ]<font face="Courier New" color="#003258" size="5"><b> {</b></font>[ <i>response_handling_part</i> ] [ <i>exception_handling_part</i> ]<font face="Courier New" color="#003258" size="5"><b>};</b></font> | |
128 | </h3> | |
129 | </td> | |
130 | </tr> | |
131 | </table> | |
132 | </center> | |
133 | </div> | |
134 | <ul> | |
135 | <li> | |
136 | <p><i> port_reference</i> points out the port where the procedure is called at.</p> | |
137 | </li> | |
138 | <li> | |
139 | <p>The <b><font face="Courier New" color="#003258" size="4">call</font> </b> keyword introduces the procedure call.</p> | |
140 | </li> | |
141 | <li> | |
142 | <p><i>template_instance</i> is one of the following:</p> | |
143 | <ul> | |
144 | <li>in-line signature template;</li> | |
145 | <li>a specific value signature template;</li> | |
146 | <li>a modified signature template ;<br> | |
147 | </li> | |
148 | </ul> | |
149 | </li> | |
150 | <table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4"> | |
151 | <tr> | |
152 | <td width="100%"> | |
153 | <p><u>TITAN specific restriction compared to the standard:</u></p> | |
154 | <ul> | |
155 | <li> | |
156 | <p> modified template is not implemented. When encountered in the TTCN-3 program, an error message will be generated.</p> | |
157 | </li> | |
158 | </ul> | |
159 | </td> | |
160 | </tr> | |
161 | </table> | |
162 | <li> | |
163 | <p>The optional <i>call_timer</i> (a floating point value) determines the waiting time for a response in seconds.</p> | |
164 | </li> | |
165 | <li> | |
166 | <p>The optional <b><font face="Courier New" color="#003258" size="4">to</font> </b> keyword is used when a port is connected to several entities and identification of the communication partner | |
167 | is required.</p> | |
168 | </li> | |
169 | </ul> | |
170 | <ul> | |
171 | <li> | |
172 | <p><i>address_reference</i> is one of the following:</p> | |
173 | <ul> | |
174 | <li>a component reference (cf. <a href="create.html"><b><font face="Courier New" color="#003258" size="4">create</font></b></a>) or the keyword <a href="system.html" | |
175 | target="_blank"><b><font face="Courier New" color="#003258" size="4">system</font></b></a>, in case of one-to-many connections.</li> | |
176 | <li>an address reference (cf. <a href="address.html"><b><font face="Courier New" color="#003258" size="4">address</font></b></a>) , when there are several entities within the | |
177 | system under test.</li> | |
178 | </ul> | |
179 | </li> | |
180 | </ul> | |
181 | <ul> | |
182 | <li> | |
183 | <p>The response and exception handling part between curly brackets is used to handle responses and exceptions. It has the same structure as an <a href="alt.html"><b><font | |
184 | face="Courier New">alt</font></b></a> statement. Its elements may occur several times; they are separated by semicolons (see the <a href="#Example 4:">example 4</a>).</p> | |
185 | <ul> | |
186 | <li><i> response_handling_part</i> begins with a pair of brackets: [] Inside the bracket there may be an optional Boolean expression. The following statements are examined only when it | |
187 | is true. The following <a href="getreply.html"><b><font face="Courier New" color="#003258" size="4">getreply</font></b></a> keyword introduces the description of response | |
188 | handling. ;</li> | |
189 | <li><i>exception_handling_part</i> begins with a pair of brackets: [] Inside the bracket there may be an optional Boolean expression. The following statements are examined only when it | |
190 | is true. The following <a href="catch.html"><b><font face="Courier New" color="#003258" size="4">catch</font></b></a> keyword introduces the description of exception | |
191 | handling. When applicable, timout conditions are also handled here.</li> | |
192 | </ul> | |
193 | </li> | |
194 | </ul> | |
195 | <hr align="left" width="50%"> | |
196 | <p><a name="Example 1">Example 1</a>: in-line signature template | |
197 | <p><font face="Courier New">signature S_MyProc (out integer pl_MyPar1, inout boolean pl_MyPar2, in charset pl_MyPar3) noblock;<br> | |
198 | <br> | |
199 | MujPort_PCO.call(S_MyProc:{ -, true, "marcipaan"}) to system;</font> | |
200 | <p>The signature S_MyProc suitable for non-blocking communication is defined in the first line. It has three parameters (pl_MyPar1, pl_MyPar2 and pl_MyPar3).<br> | |
201 | In the second line, the procedure is called at the port MujPort_PCO. The port is connected to several components therefore it must be addressed, in our case to the test system interface. The | |
202 | first parameter has no value assigned because it is an out parameter from the point of view of the called procedure. The second parameter (pl_MyPar2) has the value true, the third one contains | |
203 | "marcipaan".</p> | |
204 | <hr align="left" width="50%"> | |
205 | <p><a name="Example 2">Example 2</a>: signature template</p> | |
206 | <p><font face="Courier New">template S_MyProc t_NiaTemplate (boolean pl_param) := {<br> | |
207 | field1 := 16,<br> | |
208 | field2 := pl_param,<br> | |
209 | field3 := "massepain"<br> | |
210 | }</font> | |
211 | <p><font face="Courier New">MujPort_PCO.call (t_NiaTemplate(true));</font></p> | |
212 | <p>The parameterized template (t_NiaTemplate) has three fields. When called as shown in the second line, the values true and "massepain" will be sent to the port MujPort_PCO. The first | |
213 | parameter is don't care because it is defined as an out parameter.</p> | |
214 | <hr align="left" width="50%"> | |
215 | <p><a name="Example 3">Example 3</a>: modified signature template</p> | |
216 | <p><font face="Courier New">MujPort_PCO.call (modifies t_NiaTemplate(false) := {field3 := "pate d'amande"});</font></p> | |
217 | <p>The template defined in example 2 is modified. When sent as shown, the values false and ""pate d'amande" will be sent to the port MujPort_PCO as second and third parameters.</p> | |
218 | <hr align="left" width="50%"> | |
219 | <p><a name="Example 4:">Example 4:</a> blocking communication</p> | |
220 | <p><font face="Courier New">signature S_MyProcc (in integer pl_MyPar41, inout integer pl_MyPar42) return integer exception (integer, float);<br> | |
221 | <br> | |
222 | MujPort_PCO.call(S_MyProcc:{512, 1024}, 1E-1) to system {<br> | |
223 | [] MujPort_PCO.getreply(MyProcc:{?, ?}) -> value v_MyResult param (v_MyPar1Var,v_MyPar2Var) { } <br> | |
224 | [] MujPort_PCO.catch(MyProcc, MyExceptionOne) { <br> | |
225 | setverdict(fail); <br> | |
226 | stop; <br> | |
227 | } <br> | |
228 | [] MujPort_PCO.catch(MyProcc, ExceptionTypeTwo : ?) { <br> | |
229 | setverdict(inconc); <br> | |
230 | } <br> | |
231 | [v_MyCondition] MujPort_PCO.catch(MyProcc, MyExceptionThree) { } <br> | |
232 | [] MyPort.catch(timeout) {<br> | |
233 | setverdict(fail); <br> | |
234 | stop; <br> | |
235 | } <br> | |
236 | }</font> | |
237 | <p>The signature S_MyProcc suitable for blocking communication is defined in the first line. It has two parameters (pl_MyPar41 and pl_MyPar42). The procedure returns an integer value and may raise | |
238 | exceptions, the type of the latter is integer respective float.<br> | |
239 | In the second line, the procedure is called with a time supervision of 100 ms at the port MujPort_PCO. The port is connected to several components therefore it must be addressed, in our case to | |
240 | the test system interface. The first parameter has the integer value 512, the second one (pl_MyPar2) has the integer value 1024.<br> | |
241 | The first alternative in the response and exception handling part processes the reply: all values are matched, the returned integer value is stored in the variable v_MyResult and the two returned | |
242 | parameters are stored in the variables v_MyPar1Var and v_MyPar2Var respectively.<br> | |
243 | The second alternative catches the first exception using the template MyExceptionOne, sets the verdict to fail and stops the test case.<br> | |
244 | The third alternative catches the second exception using the template MyExceptionTwo and sets the verdict to inconc.<br> | |
245 | The fourth alternative catches the third exception using the template MyExceptionThree provided that the varibale v_MyCondition equals true and does nothing.<br> | |
246 | The fifth alternative is activated when timeout occurs, sets the verdict to fail and stops the test case.</p> | |
247 | <hr align="left" width="25%"> | |
248 | <hr align="left" width="25%"> | |
249 | <p><a HREF="BNF.html#callstatement">BNF definition</a> of <font face="Courier New"> call</font></p> | |
250 | </body> | |
251 | </html> |