Skip to content

Commit 2ae5da1

Browse files
elena-volkova-hclGitHub Enterprise
authored andcommitted
RIC-1215: New test case delegation_connector_03 (#97)
* RIC-1215: New test case delegation_connector_03 * RIC-1215: Added signal sending * RIC-1215: Added EMX versions of delegation_connector_03/02 * Added description to testcase.md * minor * Use CDATA
1 parent 8d0b203 commit 2ae5da1

File tree

13 files changed

+1837
-0
lines changed

13 files changed

+1837
-0
lines changed

art-comp-test/connectors.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
{
99
"path": "tests/delegation_connector_02"
1010
},
11+
{
12+
"path": "tests/delegation_connector_03"
13+
},
1114
{
1215
"path": "tests/delegation_connector_nested"
1316
},
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
protocol Proto {
2+
in init();
3+
out init_done();
4+
};
5+
6+
protocol HEvents {
7+
in init();
8+
out init_done();
9+
in h();
10+
out h_done();
11+
};
12+
13+
protocol SEvents {
14+
in init();
15+
out init_done();
16+
in s();
17+
out s_done();
18+
};
19+
20+
capsule S {
21+
service behavior port p_s : SEvents;
22+
service behavior port r_s~ : SEvents;
23+
statemachine {
24+
state State, Initialized;
25+
initial -> State;
26+
State -> Initialized on p_s.init
27+
`
28+
r_s.init().send();
29+
`;
30+
};
31+
};
32+
33+
capsule H {
34+
part x : S;
35+
part y : S;
36+
37+
service port r_xs~ : SEvents, r_ys~ : SEvents;
38+
connect x.r_s with r_xs; // delegation connector
39+
connect y.r_s with r_ys; // delegation connector
40+
41+
behavior port xs~ : SEvents, ys~ : SEvents;
42+
connect xs with x.p_s;
43+
connect ys with y.p_s;
44+
45+
service behavior port p_h : HEvents;
46+
service behavior port r_h~ : HEvents;
47+
48+
statemachine {
49+
state State, Initialized;
50+
initial -> State;
51+
State -> Initialized on p_h.init
52+
`
53+
xs.init().send();
54+
ys.init().send();
55+
r_h.init().send();
56+
`;
57+
};
58+
};
59+
60+
capsule Main {
61+
part h : H;
62+
63+
service port r_h~ : HEvents, r_xs~ : SEvents, r_ys~ : SEvents;
64+
connect h.r_h with r_h; // delegation connector
65+
connect h.r_xs with r_xs; // delegation connector
66+
connect h.r_ys with r_ys; // delegation connector
67+
68+
behavior port p_h~ : HEvents;
69+
connect p_h with h.p_h;
70+
71+
service behavior port p_main : Proto;
72+
service behavior port r_main~ : Proto;
73+
74+
statemachine {
75+
state State, Initialized;
76+
initial -> State;
77+
State -> Initialized on p_main.init
78+
`
79+
p_h.init().send();
80+
r_main.init().send();
81+
`;
82+
};
83+
};
84+
85+
capsule Tester {
86+
[[rt::decl]]
87+
`
88+
bool xi = false, yi = false, hi = false, mi = false;
89+
`
90+
service behavior port p~ : Proto;
91+
service behavior port r : Proto;
92+
service behavior port h : HEvents, xs : SEvents, ys : SEvents;
93+
behavior port timer : Timing;
94+
statemachine {
95+
state Initialized;
96+
initial -> State `
97+
p.init().send();
98+
timer.informEvery(RTTimespec(0, 100));
99+
`;
100+
state State {
101+
on xs.init `xi = true;`;
102+
on ys.init `yi = true;`;
103+
on h.init `hi = true;`;
104+
on r.init `mi = true;`;
105+
};
106+
State -> Initialized on timer.timeout when `xi && yi && hi && mi`
107+
`
108+
PASS();
109+
`;
110+
};
111+
};
112+
113+
capsule Top [[rt::properties(color="#100f0f")]] {
114+
part tester : Tester;
115+
part main : Main;
116+
117+
connect tester.p with main.p_main;
118+
connect tester.r with main.r_main;
119+
connect tester.h with main.r_h;
120+
connect tester.xs with main.r_xs;
121+
connect tester.ys with main.r_ys;
122+
123+
statemachine {
124+
state State;
125+
initial -> State;
126+
};
127+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
group: cpp_code_generation
3+
---
4+
Model contains complex structure of ports and connectors. Delegation connectors are used for sending reflection events from various components to top tester.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
let tc = TCF.define(TCF.ART_TO_CPP);
2+
tc.topCapsule = 'Top';
3+
tc.prerequisites = ["../../TestUtils/testlib.tcjs"];
4+
tc.targetFolder = 'delegation_connector_03_target';
5+
tc.commonPreface = `
6+
#include "testlib.art.h"
7+
#include <stdio.h>
8+
`;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>delegation_connector_02</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.ibm.xtools.umldt.core.internal.builders.UMLDevelopmentBuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
</buildSpec>
15+
<natures>
16+
<nature>com.ibm.xtools.umldt.core.internal.natures.MDDProjectNature</nature>
17+
</natures>
18+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

art-comp-test/testsEmx/delegation_connector_02/delegation_connector_02.emx

Lines changed: 280 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
let tc = TCF.define(TCF.CPP_TRANSFORM);
2+
tc.sources = [
3+
'platform:/resource/delegation_connector_02/delegation_connector_02.emx#_n_UL4MOIEe-bn9N8KUUk8Q',
4+
];
5+
tc.commonPreface = `
6+
#include <stdio.h>
7+
8+
`;
9+
tc.compilationMakeType = MakeType.GNU_make;
10+
tc.createTargetProject = true;
11+
tc.targetConfiguration = 'WinT.x64-MinGw-12.2.0';
12+
tc.targetProject = 'delegation_connector_02_target';
13+
tc.topCapsule = 'platform:/resource/delegation_connector_02/delegation_connector_02.emx#_pszocMOIEe-bn9N8KUUk8Q';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>delegation_connector_03</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.ibm.xtools.umldt.core.internal.builders.UMLDevelopmentBuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
</buildSpec>
15+
<natures>
16+
<nature>com.ibm.xtools.umldt.core.internal.natures.MDDProjectNature</nature>
17+
</natures>
18+
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
active.config=top.tcjs
2+
eclipse.preferences.version=1
3+
top.level.only=true

0 commit comments

Comments
 (0)