MyExample.ttcn 1.19 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
2
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
/******************************************************************************
 * Copyright (c) 2000-2014 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
// TTCN-3 version of "Hello, world!"
module MyExample
{
type port PCOType message
{
  inout charstring;
}

type component MTCType
{
  port PCOType MyPCO_PT;
}

testcase tc_HelloW() runs on MTCType system MTCType
{
  map(mtc:MyPCO_PT, system:MyPCO_PT);
  MyPCO_PT.send("Hello, world!");
  setverdict(pass);
}

testcase tc_HelloW2() runs on MTCType system MTCType
{
  timer TL_T := 15.0;
  map(mtc:MyPCO_PT, system:MyPCO_PT);
  MyPCO_PT.send("Hello, world!");
  TL_T.start;
  alt {
    [] MyPCO_PT.receive("Hello, TTCN-3!") { TL_T.stop; setverdict(pass); }
    [] TL_T.timeout { setverdict(inconc); }
    [] MyPCO_PT.receive { TL_T.stop; setverdict(fail); }
  }
}

control
{
  execute(tc_HelloW());
  execute(tc_HelloW2());
}
}