1 /******************************************************************************
2 * Copyright (c) 2000-2014 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 Test332A all;
14 // start of simulated import from ASN***************************
15 // note : the following commented out section should be equivalent to
16 // the sequences imported from ASN1
18 type record MyBigMessageType1
24 type record MyBigMessageType2
30 type record MyBigMessageType3
36 const MyBigMessageType1 myBigMessage1 :=
42 const MyBigMessageType2 myBigMessage2 :=
48 const MyBigMessageType3 myBigMessage3 :=
54 //end of simulated import from ASN***************************
57 //AS A CONSTANT***************************
59 const integer MyInt1 := myBigMessage1.field2 //5
61 const integer MyInt2 := myBigMessage2.field2 //2
63 const integer MyInt3 := myBigMessage3.field2 //3
64 // we only check the type here
65 // ideally the values should be checked too (dynamically?)
67 const boolean MyBoolean := myBigMessage1.field1
69 const bitstring MyBitstring := myBigMessage2.field1
71 const octetstring MyOctetstring := myBigMessage3.field1
72 //AS A CONSTANT***************************
74 type port MyPort message
77 } with { extension "internal" }
81 MyBigMessageType1 firstfield,
82 MyBigMessageType2 secondfield,
83 MyBigMessageType3 thirdfield
86 template MyType myMessage(template MyBigMessageType1 par_MyBigMessageType1,
87 template MyBigMessageType2 par_MyBigMessageType2,
88 template MyBigMessageType2 par_MyBigMessageType2
92 firstfield := par_MyBigMessageType1,
93 secondfield := par_MyBigMessageType2,
94 thirdfield := par_MyBigMessageType3
97 type component MyMainComponent
102 type component MyParallelComponent
107 function handle_msg_on_ptc() runs on MyParallelComponent
110 // AS PARAMETER *********************************************
111 P_PCO.receive (myMessage(myBigMessage1, myBigMessage2, myBigMessage3))
113 // AS PARAMETER *********************************************
117 testcase Test() runs on MyMainComponent
120 // AS A VARIABLE *********************************************
121 var MyBigMessageType1 myExampleMessage1 := myBigMessage1
123 var MyBigMessageType2 myExampleMessage2 := myBigMessage2
125 var MyBigMessageType3 myExampleMessage3 := myBigMessage3
126 // AS A VARIABLE *********************************************
128 var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
129 connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
130 myparallelcomponent.start(handle_msg_on_ptc());
132 // AS A PARAMETER *********************************************
133 M_PCO.send(myMessage(myBigMessage1, myBigMessage2, myBigMessage3))
134 // AS A PARAMETER *********************************************
136 myparallelcomponent.done;