Test348T.ttcn 1.8 KB
Newer Older
1
/******************************************************************************
balaskoa's avatar
balaskoa committed
2
 * Copyright (c) 2000-2020 Ericsson Telecom AB
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Balasko, Jeno
 *   Kulcsar, Endre
 *   Szabados, Kristof
 *
 ******************************************************************************/
module Test348T
{
import from Test348A all;

type octetstring MyOctetstringType2

// AS A CONSTANT *********************************************
const MyOctetstringType2 myOctetstringValue2 := myOctetstringValue1

type port MyPort message
{
inout MyType
} with { extension "internal" }

type record MyType
{
octetstring field1
}

template MyType myMessage(octetstring par_Octetstring) :=
{
field1 := par_Octetstring
}

type component MyMainComponent
    {
      port MyPort M_PCO;
    }

type component MyParallelComponent
    {
      port MyPort P_PCO;
    }

function handle_msg_on_ptc() runs on MyParallelComponent
{

// AS A PARAMETER *********************************************
P_PCO.receive (myMessage(myOctetstringValue1))
setverdict ( pass );
}

testcase Test() runs on MyMainComponent
{

// AS A VARIABLE *********************************************
var MyOctetstringType2 myOctetstringValue3 := myOctetstringValue1

var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
 myparallelcomponent.start(handle_msg_on_ptc());

// AS A PARAMETER *********************************************
 M_PCO.send(myMessage(myOctetstringValue1))
myparallelcomponent.done;
}

control
    {
    execute (Test())
    }
}