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 ******************************************************************************/
11 import from Test330A all;
13 // start of simulated import from ASN
14 //note : the following commented out section should be equivalent to
15 //the sequences imported from ASN1
18 bitstring bIT_STRING ,
19 octetstring oCTET_STRING }
21 type record MyExampleMessageType1
23 integer field1 , //Type
28 //end of simulated import from ASN
31 template MyExampleMessageType1 myExampleMessage1 :=
38 template MyExampleMessageType1 myExampleMessage2 :=
45 template MyExampleMessageType1 myExampleMessage3 :=
49 field2 := {bOOLEAN := true} // bOOLEAN????
52 //*********************************************
54 const MyExampleMessageType1 myExampleMessage4 :=
56 field1 := 6, // has to be integer
58 field2 := {bOOLEAN := true} // bOOLEAN????
61 const MyExampleMessageType1 myExampleMessage5 :=
63 field1 := 6, // has to be integer
65 field2 := {bIT_STRING := '001100'B} //bIT_STRING????
68 const MyExampleMessageType1 myExampleMessage6 :=
70 field1 := 6, // has to be integer
72 field2 := {oCTET_STRING := '1234567890ABCDEF'O} //oCTET_STRING???
75 //*********************************************
77 type port MyPort message
80 } with { extension "internal" }
84 MyExampleMessageType1 firstfield
87 template MyType myMessage(template MyExampleMessageType1 par_MyExampleMessageType1) :=
89 firstfield := par_MyExampleMessageType1
92 type component MyMainComponent
97 type component MyParallelComponent
102 function handle_msg_on_ptc() runs on MyParallelComponent
105 // AS PARAMETER *********************************************
106 P_PCO.receive (myMessage(myExampleMessage1))
109 P_PCO.receive (myMessage(myExampleMessage2))
112 P_PCO.receive (myMessage(myExampleMessage3))
115 P_PCO.receive (myMessage(myExampleMessage4))
118 P_PCO.receive (myMessage(myExampleMessage5))
121 P_PCO.receive (myMessage(myExampleMessage6))
124 P_PCO.receive (myMessage(myExampleMessage1))
129 testcase Test() runs on MyMainComponent
132 // AS A VARIABLE *********************************************
133 var MyExampleMessageType1 myExampleMessage7 := myExampleMessage4
135 var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
136 connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
137 myparallelcomponent.start(handle_msg_on_ptc());
139 // AS A PARAMETER *********************************************
140 M_PCO.send(myMessage(myExampleMessage3))
142 M_PCO.send(myMessage(myExampleMessage3))
144 M_PCO.send(myMessage(myExampleMessage3))
146 M_PCO.send(myMessage(myExampleMessage4))
148 M_PCO.send(myMessage(myExampleMessage5))
150 M_PCO.send(myMessage(myExampleMessage6))
152 M_PCO.send(myMessage(myExampleMessage7))
154 myparallelcomponent.done;