Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / ASN1 / Test330 / Test330T.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2015 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8 module Test330T
9 {
10
11 import from Test330A all;
12 /*
13 // start of simulated import from ASN
14 //note : the following commented out section should be equivalent to
15 //the sequences imported from ASN1
16 type union MyUnion {
17 boolean bOOLEAN ,
18 bitstring bIT_STRING ,
19 octetstring oCTET_STRING }
20
21 type record MyExampleMessageType1
22 {
23 integer field1 , //Type
24
25 MyUnion field2
26
27 }
28 //end of simulated import from ASN
29 */
30
31 template MyExampleMessageType1 myExampleMessage1 :=
32 {
33 field1 := ?,
34
35 field2 := ?
36 }
37
38 template MyExampleMessageType1 myExampleMessage2 :=
39 {
40 field1 := *,
41
42 field2 := *
43 }
44
45 template MyExampleMessageType1 myExampleMessage3 :=
46 {
47 field1 := 10,
48
49 field2 := {bOOLEAN := true} // bOOLEAN????
50 }
51
52 //*********************************************
53
54 const MyExampleMessageType1 myExampleMessage4 :=
55 {
56 field1 := 6, // has to be integer
57
58 field2 := {bOOLEAN := true} // bOOLEAN????
59 }
60
61 const MyExampleMessageType1 myExampleMessage5 :=
62 {
63 field1 := 6, // has to be integer
64
65 field2 := {bIT_STRING := '001100'B} //bIT_STRING????
66 }
67
68 const MyExampleMessageType1 myExampleMessage6 :=
69 {
70 field1 := 6, // has to be integer
71
72 field2 := {oCTET_STRING := '1234567890ABCDEF'O} //oCTET_STRING???
73 }
74
75 //*********************************************
76
77 type port MyPort message
78 {
79 inout MyType
80 } with { extension "internal" }
81
82 type record MyType
83 {
84 MyExampleMessageType1 firstfield
85 }
86
87 template MyType myMessage(template MyExampleMessageType1 par_MyExampleMessageType1) :=
88 {
89 firstfield := par_MyExampleMessageType1
90 }
91
92 type component MyMainComponent
93 {
94 port MyPort M_PCO;
95 }
96
97 type component MyParallelComponent
98 {
99 port MyPort P_PCO;
100 }
101
102 function handle_msg_on_ptc() runs on MyParallelComponent
103 {
104
105 // AS PARAMETER *********************************************
106 P_PCO.receive (myMessage(myExampleMessage1))
107 setverdict ( pass );
108
109 P_PCO.receive (myMessage(myExampleMessage2))
110 setverdict ( pass );
111
112 P_PCO.receive (myMessage(myExampleMessage3))
113 setverdict ( pass );
114
115 P_PCO.receive (myMessage(myExampleMessage4))
116 setverdict ( pass );
117
118 P_PCO.receive (myMessage(myExampleMessage5))
119 setverdict ( pass );
120
121 P_PCO.receive (myMessage(myExampleMessage6))
122 setverdict ( pass );
123
124 P_PCO.receive (myMessage(myExampleMessage1))
125 setverdict ( pass );
126
127 } // end of function
128
129 testcase Test() runs on MyMainComponent
130 {
131
132 // AS A VARIABLE *********************************************
133 var MyExampleMessageType1 myExampleMessage7 := myExampleMessage4
134
135 var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
136 connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
137 myparallelcomponent.start(handle_msg_on_ptc());
138
139 // AS A PARAMETER *********************************************
140 M_PCO.send(myMessage(myExampleMessage3))
141
142 M_PCO.send(myMessage(myExampleMessage3))
143
144 M_PCO.send(myMessage(myExampleMessage3))
145
146 M_PCO.send(myMessage(myExampleMessage4))
147
148 M_PCO.send(myMessage(myExampleMessage5))
149
150 M_PCO.send(myMessage(myExampleMessage6))
151
152 M_PCO.send(myMessage(myExampleMessage7))
153
154 myparallelcomponent.done;
155 }
156
157 control
158 {
159 execute (Test())
160 }
161
162 } // end of module
This page took 0.044762 seconds and 5 git commands to generate.