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 | module X | |
9 | { | |
10 | import from X682 language "ASN.1:1997" all | |
11 | ||
12 | type port MyPort1 message | |
13 | { | |
14 | out ErrorReturn; | |
15 | in octetstring; | |
16 | } | |
17 | ||
18 | type port MyPort2 message | |
19 | { | |
20 | out octetstring; | |
21 | in ErrorReturn; | |
22 | } | |
23 | ||
24 | type component MyComponent | |
25 | { | |
26 | timer T := 1.0; | |
27 | port MyPort1 P1; | |
28 | port MyPort2 P2; | |
29 | } | |
30 | ||
31 | type component MySystemType | |
32 | { | |
33 | port MyPort2 S1; | |
34 | port MyPort1 S2; | |
35 | } | |
36 | ||
37 | altstep MyAltstep() runs on MyComponent | |
38 | { | |
39 | [] P1.receive { setverdict(fail); } | |
40 | [] P2.receive { setverdict(fail); } | |
41 | [] T.timeout { setverdict(inconc); T.start; } | |
42 | } | |
43 | ||
44 | testcase TC0a() runs on MyComponent system MySystemType | |
45 | { | |
46 | var default d := activate(MyAltstep()); | |
47 | map(mtc:P1, system:S2); | |
48 | map(mtc:P2, system:S1); | |
49 | ||
50 | P1.send(errorReturn1); | |
51 | T.start; | |
52 | P1.receive(ber_errorReturn1); | |
53 | setverdict(pass); | |
54 | T.stop; | |
55 | ||
56 | deactivate(d); | |
57 | unmap(mtc:P1, system:S2); | |
58 | unmap(mtc:P2, system:S1); | |
59 | } | |
60 | ||
61 | testcase TC0b() runs on MyComponent system MySystemType | |
62 | { | |
63 | var default d := activate(MyAltstep()); | |
64 | map(mtc:P1, system:S2); | |
65 | map(mtc:P2, system:S1); | |
66 | ||
67 | P2.send(ber_errorReturn1); | |
68 | T.start; | |
69 | P2.receive(errorReturn1); | |
70 | setverdict(pass); | |
71 | T.stop; | |
72 | ||
73 | deactivate(d); | |
74 | unmap(mtc:P1, system:S2); | |
75 | unmap(mtc:P2, system:S1); | |
76 | } | |
77 | ||
78 | control | |
79 | { | |
80 | execute(TC0a()); | |
81 | execute(TC0b()); | |
82 | } | |
83 | ||
84 | } |