1 /******************************************************************************
2 * Copyright (c) 2000-2016 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
13 ******************************************************************************/
17 import from Test332A all;
20 // start of simulated import from ASN***************************
21 // note : the following commented out section should be equivalent to
22 // the sequences imported from ASN1
24 type record MyBigMessageType1
30 type record MyBigMessageType2
36 type record MyBigMessageType3
42 const MyBigMessageType1 myBigMessage1 :=
48 const MyBigMessageType2 myBigMessage2 :=
54 const MyBigMessageType3 myBigMessage3 :=
60 //end of simulated import from ASN***************************
63 //AS A CONSTANT***************************
65 const integer MyInt1 := myBigMessage1.field2 //5
67 const integer MyInt2 := myBigMessage2.field2 //2
69 const integer MyInt3 := myBigMessage3.field2 //3
70 // we only check the type here
71 // ideally the values should be checked too (dynamically?)
73 const boolean MyBoolean := myBigMessage1.field1
75 const bitstring MyBitstring := myBigMessage2.field1
77 const octetstring MyOctetstring := myBigMessage3.field1
78 //AS A CONSTANT***************************
80 type port MyPort message
83 } with { extension "internal" }
87 MyBigMessageType1 firstfield,
88 MyBigMessageType2 secondfield,
89 MyBigMessageType3 thirdfield
92 template MyType myMessage(template MyBigMessageType1 par_MyBigMessageType1,
93 template MyBigMessageType2 par_MyBigMessageType2,
94 template MyBigMessageType2 par_MyBigMessageType2
98 firstfield := par_MyBigMessageType1,
99 secondfield := par_MyBigMessageType2,
100 thirdfield := par_MyBigMessageType3
103 type component MyMainComponent
108 type component MyParallelComponent
113 function handle_msg_on_ptc() runs on MyParallelComponent
116 // AS PARAMETER *********************************************
117 P_PCO.receive (myMessage(myBigMessage1, myBigMessage2, myBigMessage3))
119 // AS PARAMETER *********************************************
123 testcase Test() runs on MyMainComponent
126 // AS A VARIABLE *********************************************
127 var MyBigMessageType1 myExampleMessage1 := myBigMessage1
129 var MyBigMessageType2 myExampleMessage2 := myBigMessage2
131 var MyBigMessageType3 myExampleMessage3 := myBigMessage3
132 // AS A VARIABLE *********************************************
134 var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
135 connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
136 myparallelcomponent.start(handle_msg_on_ptc());
138 // AS A PARAMETER *********************************************
139 M_PCO.send(myMessage(myBigMessage1, myBigMessage2, myBigMessage3))
140 // AS A PARAMETER *********************************************
142 myparallelcomponent.done;