Commit | Line | Data |
---|---|---|
970ed795 | 1 | /////////////////////////////////////////////////////////////////////////////// |
3abe9331 | 2 | // Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
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 | /////////////////////////////////////////////////////////////////////////////// | |
8 | // TTCN-3 version of "Hello, world!" | |
9 | module MyExample | |
10 | { | |
11 | type port PCOType message | |
12 | { | |
13 | inout charstring; | |
14 | } | |
15 | ||
16 | type component MTCType | |
17 | { | |
18 | port PCOType MyPCO; | |
19 | } | |
20 | ||
21 | testcase HelloW() runs on MTCType system MTCType | |
22 | { | |
23 | map(mtc:MyPCO, system:MyPCO); | |
24 | MyPCO.send("Hello, world!"); | |
25 | setverdict(pass); | |
26 | } | |
27 | ||
28 | testcase HelloW2() runs on MTCType system MTCType | |
29 | { | |
30 | timer T := 1.0; | |
31 | map(mtc:MyPCO, system:MyPCO); | |
32 | MyPCO.send("Hello, world!"); | |
33 | T.start; | |
34 | alt { | |
35 | [] MyPCO.receive("Hello, TTCN-3!") { T.stop; setverdict(pass); } | |
36 | [] T.timeout { setverdict(inconc); } | |
37 | [] MyPCO.receive { T.stop; setverdict(fail); } | |
38 | } | |
39 | } | |
40 | ||
41 | control | |
42 | { | |
43 | execute(HelloW()); | |
44 | execute(HelloW2()); | |
3abe9331 | 45 | //1 pass, 1 inconc expected |
970ed795 EL |
46 | } |
47 | } |