Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-05-22 08:34:18 +0000
committerHenrik Rentz-Reichert2012-05-22 08:34:18 +0000
commitcee30da694b0026705301c88ccb8769c0ef0d599 (patch)
treec7483d96458c5179870bd62b74a30d7a61128388 /tests/org.eclipse.etrice.generator.tests
parent08ab5b100ebdc97ddd9a9bc868007f8d03e4f336 (diff)
downloadorg.eclipse.etrice-cee30da694b0026705301c88ccb8769c0ef0d599.tar.gz
org.eclipse.etrice-cee30da694b0026705301c88ccb8769c0ef0d599.tar.xz
org.eclipse.etrice-cee30da694b0026705301c88ccb8769c0ef0d599.zip
[generator, core.genmodel] factored out etricegen to new plug-in core.genmodel
Diffstat (limited to 'tests/org.eclipse.etrice.generator.tests')
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/connected_ports.room80
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/hierarchy.room25
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/layers.room136
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/ports.room22
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/states.room108
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/states_inheritance.room249
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/states_triggers.room176
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/structure_inheritance.room208
-rw-r--r--tests/org.eclipse.etrice.generator.tests/models/test.room30
-rw-r--r--tests/org.eclipse.etrice.generator.tests/org.eclipse.etrice.generator.tests.launch1
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestConnectedPorts.java90
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestHierarchy.java57
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestInstanceModelBuilderBase.java159
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestLayers.java73
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestPorts.java58
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStates.java120
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesAndTriggers.java144
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesInheritance.java144
-rw-r--r--tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStructureInheritance.java174
19 files changed, 1 insertions, 2053 deletions
diff --git a/tests/org.eclipse.etrice.generator.tests/models/connected_ports.room b/tests/org.eclipse.etrice.generator.tests/models/connected_ports.room
deleted file mode 100644
index 39a835514..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/connected_ports.room
+++ /dev/null
@@ -1,80 +0,0 @@
-RoomModel connected_ports {
- ProtocolClass PTest {
- incoming {
- Message in1 ()
- }
- outgoing {
- Message out1 ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef test_a1 : ATestA
- ActorRef test_a2 : ATestA
- ActorRef test_a3 : ATestA
- ActorRef test_b : ATestB
-
- Binding test_b.plain and test_a1.relay
- Binding test_a1.ext_end and test_b.repl
- Binding test_b.repl and test_a2.ext_end
- Binding test_b.repl and test_a3.ext_end
- Binding test_b.repl_relay and test_a2.relay
- Binding test_b.repl_relay and test_a3.relay
- }
-
- ActorClass ATestA {
- Interface {
- Port relay : PTest
- Port ext_end : PTest
- }
- Structure {
- external Port ext_end
- conjugated Port int_end : PTest
- ActorRef sub : ASub
- Binding sub.p1 and relay
- Binding sub.p2 and int_end
- }
- Behavior {
- }
- }
-
- ActorClass ATestB {
- Interface {
- conjugated Port plain : PTest
- conjugated Port repl [3] : PTest
- conjugated Port repl_relay [3] : PTest
- }
- Structure {
- external Port plain
- external Port repl
- ActorRef sub1 : ASubB
- Binding repl_relay and sub1.p
- }
- Behavior {
- }
- }
-
- ActorClass ASub {
- Interface {
- Port p1 : PTest
- Port p2 : PTest
- }
- Structure {
- external Port p1
- external Port p2
- }
- Behavior {
- }
- }
-
- ActorClass ASubB {
- Interface {
- conjugated Port p [3] : PTest
- }
- Structure {
- external Port p
- }
- Behavior {
- }
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/hierarchy.room b/tests/org.eclipse.etrice.generator.tests/models/hierarchy.room
deleted file mode 100644
index 0d4bb03c2..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/hierarchy.room
+++ /dev/null
@@ -1,25 +0,0 @@
-RoomModel hierarchy {
-
- SubSystemClass CMain {
- ActorRef l1a : ALevel1
- ActorRef l1b : ALevel1
- }
-
- ActorClass ALevel1 {
- Structure {
- ActorRef l2a : ALevel2
- ActorRef l2b : ALevel2
- }
- }
-
- ActorClass ALevel2 {
- Structure {
- ActorRef l3a : ALevel3
- ActorRef l3b : ALevel3
- ActorRef l3c : ALevel3
- }
- }
-
- ActorClass ALevel3 {
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/layers.room b/tests/org.eclipse.etrice.generator.tests/models/layers.room
deleted file mode 100644
index 900edc528..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/layers.room
+++ /dev/null
@@ -1,136 +0,0 @@
-RoomModel layers {
-
- ProtocolClass PServiceA {
- incoming {
- Message in1 ()
- }
- outgoing {
- Message out1 ()
- }
- }
-
- ProtocolClass PServiceB {
- incoming {
- Message in2 ()
- }
- outgoing {
- Message out2 ()
- }
- }
-
- ProtocolClass PServiceC {
- incoming {
- Message in3 ()
- }
- outgoing {
- Message out3 ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef app : AApplication
- ActorRef services : AServices
-
- LayerConnection ref app satisfied_by services.serviceA
- LayerConnection ref app satisfied_by services.serviceB
- }
-
- ActorClass AApplication {
- Structure {
- ActorRef subsysA : ASubSysA
- ActorRef subsysB : ASubSysB
- }
- }
-
- ActorClass ASubSysA {
- Structure {
- ActorRef userX : AServiceUser1
- ActorRef userY : AServiceUser2
- ActorRef userZ : AServiceUser2
- }
- }
-
- ActorClass ASubSysB {
- Interface {
- SPP service : PServiceC
- }
- Structure {
- ActorRef userX : AServiceUser1
- ActorRef userY : AServiceUser1
- ActorRef userZ : AServiceUser3
- ActorRef svcC : AServiceC
-
- LayerConnection relay_sap service satisfied_by svcC.service
- }
- }
-
- ActorClass AServiceUser1 {
- Structure {
- SAP sap : PServiceA
- }
- }
-
- ActorClass AServiceUser2 {
- Structure {
- SAP sap : PServiceB
- }
- }
-
- ActorClass AServiceUser3 {
- Structure {
- SAP sap : PServiceC
- }
- }
-
- ActorClass AServices {
- Interface {
- SPP serviceA : PServiceA
- SPP serviceB : PServiceB
- }
- Structure {
- ActorRef svcA : AServiceA
- ActorRef svcB : AServiceB
-
- LayerConnection relay_sap serviceA satisfied_by svcA.service
- LayerConnection relay_sap serviceB satisfied_by svcB.service
- }
- }
-
- ActorClass AServiceA {
- Interface {
- SPP service : PServiceA
- }
- Structure {
- ServiceImplementation of service
- }
- }
-
- ActorClass AServiceB {
- Interface {
- SPP service : PServiceB
- }
- Structure {
- ActorRef impl : AServiceBImpl
- LayerConnection relay_sap service satisfied_by impl.service
- }
- }
-
- ActorClass AServiceBImpl {
- Interface {
- SPP service : PServiceB
- }
- Structure {
- ServiceImplementation of service
- }
- }
-
- ActorClass AServiceC {
- Interface {
- SPP service : PServiceC
- }
- Structure {
- ServiceImplementation of service
- }
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/ports.room b/tests/org.eclipse.etrice.generator.tests/models/ports.room
deleted file mode 100644
index e273cc978..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/ports.room
+++ /dev/null
@@ -1,22 +0,0 @@
-RoomModel base {
- ProtocolClass PTest {
- incoming {
- Message msg()
- }
- }
-
- SubSystemClass CMain {
- ActorRef test: ATest
- }
-
- ActorClass ATest {
- Interface {
- Port relay: PTest
- Port externalEnd: PTest
- }
- Structure {
- Port internalEnd: PTest
- external Port externalEnd
- }
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/states.room b/tests/org.eclipse.etrice.generator.tests/models/states.room
deleted file mode 100644
index d12ae2f3e..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/states.room
+++ /dev/null
@@ -1,108 +0,0 @@
-RoomModel states {
-
- PrimitiveType int32 -> int32 (Integer) default "0"
-
- ProtocolClass PTest1 {
- incoming {
- Message a ()
- Message b (x : int32)
- Message c ()
- }
- outgoing {
- Message x ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef test : ATest
- }
-
- ActorClass ATest {
- Interface {
- Port fct : PTest1
- }
- Structure {
- external Port fct
- }
- Behavior {
- StateMachine {
- State State1 {}
- State State2 {}
- State State3 {
- subgraph {
- State State1 {}
- State State2 {}
- State State3 {}
- EntryPoint tp1
- TransitionPoint tp2
- ExitPoint tp3
- Transition tr0: initial -> State1 {}
- Transition tr1: my tp1 -> State3 {}
- Transition tr2: State1 -> State2 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: State2 -> State3 {
- triggers {
- <c:fct>
- }
- }
- Transition tr4: State3 -> State1 {
- triggers {
- <a:fct>
- }
- }
- Transition tr5: my tp2 -> State3 {
- triggers {
- <b:fct>
- }
- }
- Transition tr6: State3 -> my tp3 {
- triggers {
- <c:fct>
- }
- }
- }
- }
- State State4 {}
- TransitionPoint tp0
- ChoicePoint CP1
- Transition tr0: initial -> State1 {}
- Transition tr1: State1 -> State2 {
- triggers {
- <a:fct>
- }
- }
- Transition tr2: State2 -> cp CP1 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: cp CP1 -> State1 {}
- Transition tr4: cp CP1 -> State3 {
- cond {
- "x==2"
- }
- }
- Transition tr5: my tp0 -> tp1 of State3 {
- triggers {
- <a:fct>
- }
- }
- Transition tr6: cp CP1 -> State4 {
- cond {
- "x==3"
- }
- }
- Transition tr7: tp3 of State3 -> State2 {}
- Transition tr8: State3 -> State2 {
- triggers {
- <c:fct>
- }
- }
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/states_inheritance.room b/tests/org.eclipse.etrice.generator.tests/models/states_inheritance.room
deleted file mode 100644
index 16997ec0a..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/states_inheritance.room
+++ /dev/null
@@ -1,249 +0,0 @@
-RoomModel states_inheritance.t {
-
- PrimitiveType int32 -> int32 (Integer) default "0"
-
- ProtocolClass PTimer {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timerTick ()
- }
- }
-
- ProtocolClass PTimeout {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timeoutTick ()
- }
- }
-
- ActorClass ATimingService {
- Interface {
- SPP timerSPP: PTimer
- SPP timeoutSPP: PTimeout
- }
- Structure {
- ServiceImplementation of timerSPP
- ServiceImplementation of timeoutSPP
- }
- }
-
- ProtocolClass PTest1 {
- incoming {
- Message a ()
- Message b (x : int32)
- Message c ()
- }
- outgoing {
- Message x ()
- }
- }
-
- ProtocolClass PTest2 {
- incoming {
- Message x ()
- Message y ()
- Message z ()
- }
- outgoing {
- Message a ()
- }
- }
-
- ProtocolClass PTest3 {
- incoming {
- Message a ()
- }
- outgoing {
- Message b ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef application : AApplication_CMain
- ActorRef timingService : ATimingService
-
- LayerConnection ref application satisfied_by timingService.timerSPP
- LayerConnection ref application satisfied_by timingService.timeoutSPP
- }
-
- // automatically inserted AApplication_CMain
- ActorClass AApplication_CMain {
- Structure {
- ActorRef test : ADerived
- }
- }
-
- ActorClass ATest {
- Interface {
- Port fct : PTest1
- }
- Structure {
- external Port fct
- Port sub : PTest2
- SAP timer: PTimer
- SAP timeout: PTimeout
- }
- Behavior {
- StateMachine {
- State State1 {}
- State State2 {}
- State State3 {
- subgraph {
- State State1 {}
- State State2 {}
- State State3 {}
- EntryPoint tp1
- TransitionPoint tp2
- ExitPoint tp3
- handler TransitionPoint tp5
- Transition tr0: initial -> State1 {}
- Transition tr1: my tp1 -> State3 {}
- Transition tr2: State1 -> State2 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: State2 -> State3 {
- triggers {
- <c:fct>
- }
- }
- Transition tr4: State3 -> State1 {
- triggers {
- <a:fct>
- }
- }
- Transition tr5: my tp2 -> State3 {
- triggers {
- <b:fct>
- }
- }
- Transition tr6: State3 -> my tp3 {
- triggers {
- <c:fct>
- }
- }
- Transition tr7: my tp5 -> my tp5 {
- triggers {
- <timeoutTick:timeout>
- }
- }
- }
- }
- State State4 {}
- TransitionPoint tp0
- TransitionPoint tp1
- ChoicePoint CP1
- Transition tr0: initial -> State1 {}
- Transition tr1: State1 -> State2 {
- triggers {
- <a:fct>
- }
- }
- Transition tr2: State2 -> cp CP1 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: cp CP1 -> State1 {}
- Transition tr4: cp CP1 -> State3 {
- cond {
- "data==2"
- }
- }
- Transition tr5: my tp0 -> tp1 of State3 {
- triggers {
- <a:fct>
- }
- }
- Transition tr6: cp CP1 -> State4 {
- cond {
- "data==3"
- }
- }
- Transition tr7: tp3 of State3 -> State2 {}
- Transition tr8: State3 -> State2 {
- triggers {
- <c:fct>
- }
- }
- Transition tr9: my tp1 -> State2 {
- triggers {
- <timerTick:timer>
- }
- }
- }
- }
- }
-
- ActorClass ADerived extends ATest {
- Interface {
- Port port : PTest3
- }
- Structure {
- external Port port
- }
- Behavior {
- StateMachine {
- RefinedState State3 {
- subgraph {
- State State4 {}
- EntryPoint tp6
- TransitionPoint tp7
- Transition tr8: my tp6 -> State2 {}
- Transition tr9: my tp7 -> my tp7 {
- triggers {
- <z:sub>
- }
- }
- Transition tr10a: State2 -> State4 {
- triggers {
- <y:sub>
- }
- }
- Transition tr11a: State4 -> my tp3 {
- triggers {
- <z:sub>
- }
- }
- }
- }
- RefinedState State4 {
- subgraph {
- State State1 {}
- State State2 {}
- Transition tr0: initial -> State1 {}
- Transition tr1: State1 -> State2 {
- triggers {
- <a:port>
- }
- }
- }
- }
- State State5 {}
- Transition tr10: State1 -> State5 {
- triggers {
- <a:port>
- }
- }
- Transition tr11: cp CP1 -> State5 {
- cond {
- "data==4"
- }
- }
- Transition tr12: State5 -> tp6 of State3 {
- triggers {
- <a:port>
- }
- }
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/states_triggers.room b/tests/org.eclipse.etrice.generator.tests/models/states_triggers.room
deleted file mode 100644
index de2e02833..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/states_triggers.room
+++ /dev/null
@@ -1,176 +0,0 @@
-RoomModel states_trigers {
-
- PrimitiveType int32 -> int32 (Integer) default "0"
-
- ProtocolClass PTimer {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timerTick ()
- }
- }
-
- ProtocolClass PTimeout {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timeoutTick ()
- }
- }
-
- ActorClass ATimingService {
- Interface {
- SPP timerSPP: PTimer
- SPP timeoutSPP: PTimeout
- }
- Structure {
- ServiceImplementation of timerSPP
- ServiceImplementation of timeoutSPP
- }
- }
-
- ProtocolClass PTest1 {
- incoming {
- Message a ()
- Message b (x : int32)
- Message c ()
- }
- outgoing {
- Message x ()
- }
- }
-
- ProtocolClass PTest2 {
- incoming {
- Message x ()
- Message y ()
- Message z ()
- }
- outgoing {
- Message a ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef application : AApplication_CMain
- ActorRef timingService : ATimingService
-
- LayerConnection ref application satisfied_by timingService.timerSPP
- LayerConnection ref application satisfied_by timingService.timeoutSPP
- }
-
- // automatically inserted AApplication_CMain
- ActorClass AApplication_CMain {
- Structure {
- ActorRef test : ATest
- }
- }
-
- ActorClass ATest {
- Interface {
- Port fct : PTest1
- }
- Structure {
- external Port fct
- Port sub : PTest2
- SAP timer: PTimer
- SAP timeout: PTimeout
- }
- Behavior {
- StateMachine {
- State State1 {}
- State State2 {}
- State State3 {
- subgraph {
- State State1 {}
- State State2 {}
- State State3 {}
- EntryPoint tp1
- TransitionPoint tp2
- ExitPoint tp3
- handler TransitionPoint tp5
- Transition tr0: initial -> State1 {}
- Transition tr1: my tp1 -> State3 {}
- Transition tr2: State1 -> State2 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: State2 -> State3 {
- triggers {
- <x:sub>
- }
- }
- Transition tr4: State3 -> State1 {
- triggers {
- <a:fct>
- }
- }
- Transition tr5: my tp2 -> State3 {
- triggers {
- <b:fct>
- }
- }
- Transition tr6: State3 -> my tp3 {
- triggers {
- <y:sub>
- }
- }
- Transition tr7: my tp5 -> my tp5 {
- triggers {
- <timeoutTick:timeout>
- }
- }
- }
- }
- State State4 {}
- TransitionPoint tp0
- TransitionPoint tp1
- ChoicePoint CP1
- Transition tr0: initial -> State1 {}
- Transition tr1: State1 -> State2 {
- triggers {
- <a:fct>
- }
- }
- Transition tr2: State2 -> cp CP1 {
- triggers {
- <b:fct>
- }
- }
- Transition tr3: cp CP1 -> State1 {}
- Transition tr4: cp CP1 -> State3 {
- cond {
- "data==2"
- }
- }
- Transition tr5: my tp0 -> tp1 of State3 {
- triggers {
- <a:fct>
- }
- }
- Transition tr6: cp CP1 -> State4 {
- cond {
- "data==3"
- }
- }
- Transition tr7: tp3 of State3 -> State2 {}
- Transition tr8: State3 -> State2 {
- triggers {
- <c:fct>
- }
- }
- Transition tr9: my tp1 -> State2 {
- triggers {
- <timerTick:timer>
- }
- }
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/structure_inheritance.room b/tests/org.eclipse.etrice.generator.tests/models/structure_inheritance.room
deleted file mode 100644
index c262127b9..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/structure_inheritance.room
+++ /dev/null
@@ -1,208 +0,0 @@
-RoomModel structure_inherit {
-
- PrimitiveType int32 -> int32 (Integer) default "0"
-
- ProtocolClass PTimer {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timerTick ()
- }
- }
-
- ProtocolClass PTimeout {
- incoming {
- Message start (time_ms : int32)
- Message kill ()
- }
- outgoing {
- Message timeoutTick ()
- }
- }
-
- ActorClass ATimingService {
- Interface {
- SPP timerSPP: PTimer
- SPP timeoutSPP: PTimeout
- }
- Structure {
- ServiceImplementation of timerSPP
- ServiceImplementation of timeoutSPP
- }
- }
-
- ProtocolClass PBase {
- incoming {
- Message a ()
- Message b ()
- }
- outgoing {
- Message x ()
- Message y ()
- }
- }
-
- ProtocolClass PFunctionA {
- incoming {
- Message d ()
- Message e ()
- }
- outgoing {
- Message r ()
- Message s ()
- }
- }
-
- ProtocolClass PControl {
- incoming {
- Message c ()
- }
- outgoing {
- Message d ()
- }
- }
-
- ProtocolClass PFunctionB {
- incoming {
- Message h ()
- }
- outgoing {
- Message i ()
- }
- }
-
- SubSystemClass CMain {
- ActorRef application : AApplication_CMain
- ActorRef timingService : ATimingService
-
- LayerConnection ref application satisfied_by timingService.timerSPP
- LayerConnection ref application satisfied_by timingService.timeoutSPP
- }
-
- // automatically inserted AApplication_CMain
- ActorClass AApplication_CMain {
- Structure {
- ActorRef controller : AController
- ActorRef fcta : AFunctionA
- ActorRef fctb : AFunctionB
- ActorRef client : AClient
- Binding controller.base and fcta.base
- Binding controller.ctrl and fcta.ctrl
- Binding controller.base and fctb.base
- Binding controller.ctrl and fctb.ctrl
- Binding controller.base and client.base
- Binding controller.ctrl and client.ctrl
- Binding fcta.fct1 and client.pa1
- Binding fctb.fct and client.pb
- Binding client.pa2 and fcta.fct2
- }
- }
-
- ActorClass ACommonBase {
- Interface {
- Port base : PBase
- }
- Structure {
- external Port base
- conjugated Port subbase [10] : PBase
- }
- Behavior {
- }
- }
-
- ActorClass AControl extends ACommonBase {
- Interface {
- Port ctrl : PControl
- }
- Structure {
- external Port ctrl
- conjugated Port subctrl [10] : PControl
- SAP ctrltimeout: PTimeout
- }
- Behavior {
- }
- }
-
- ActorClass ABaseController {
- Interface {
- conjugated Port base [10] : PBase
- }
- Structure {
- external Port base
- }
- Behavior {
- }
- }
-
- ActorClass AController extends ABaseController {
- Interface {
- conjugated Port ctrl [10] : PControl
- }
- Structure {
- external Port ctrl
- }
- Behavior {
- }
- }
-
- ActorClass ASubA extends AControl {
- Interface {
- Port fct : PFunctionA
- }
- Structure {
- external Port fct
- SAP timeout: PTimeout
- }
- Behavior {
- }
- }
-
- ActorClass AFunctionA extends AControl {
- Interface {
- Port fct1 : PFunctionA
- Port fct2 : PFunctionA
- }
- Structure {
- SAP timeout: PTimeout
- ActorRef sub1 : ASubA
- ActorRef sub2 : ASubA
- Binding subbase and sub1.base
- Binding subctrl and sub1.ctrl
- Binding subbase and sub2.base
- Binding subctrl and sub2.ctrl
- Binding fct1 and sub2.fct
- Binding fct2 and sub1.fct
- }
- Behavior {
- }
- }
-
- ActorClass AFunctionB extends AControl {
- Interface {
- Port fct : PFunctionB
- }
- Structure {
- external Port fct
- }
- Behavior {
- }
- }
-
- ActorClass AClient extends AControl {
- Interface {
- conjugated Port pa1 : PFunctionA
- conjugated Port pb : PFunctionB
- conjugated Port pa2 : PFunctionA
- }
- Structure {
- external Port pa1
- external Port pb
- external Port pa2
- }
- Behavior {
- }
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/models/test.room b/tests/org.eclipse.etrice.generator.tests/models/test.room
deleted file mode 100644
index 6a608fc09..000000000
--- a/tests/org.eclipse.etrice.generator.tests/models/test.room
+++ /dev/null
@@ -1,30 +0,0 @@
-RoomModel test {
- ProtocolClass MyProtocol {
- incoming {
- Message in1()
- }
- outgoing {
- }
- }
-
- ActorClass Base {
- Interface {
- Port p: MyProtocol
- }
- Behavior {
- StateMachine {
- State sBase {}
- }
- }
- }
-
- ActorClass Derived extends Base {
- Behavior {
- StateMachine {
- State s {}
- State y {}
- RefinedState sBase {}
- }
- }
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/org.eclipse.etrice.generator.tests.launch b/tests/org.eclipse.etrice.generator.tests/org.eclipse.etrice.generator.tests.launch
index 163563067..e6ec15e47 100644
--- a/tests/org.eclipse.etrice.generator.tests/org.eclipse.etrice.generator.tests.launch
+++ b/tests/org.eclipse.etrice.generator.tests/org.eclipse.etrice.generator.tests.launch
@@ -23,6 +23,7 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_17"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.tests"/>
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestConnectedPorts.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestConnectedPorts.java
deleted file mode 100644
index 2823073f9..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestConnectedPorts.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.generator.etricegen.ETriceGenPackage;
-import org.eclipse.etrice.generator.etricegen.PortInstance;
-import org.eclipse.etrice.generator.etricegen.PortKind;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class TestConnectedPorts extends TestInstanceModelBuilderBase {
-
- private Root root;
- private HashMap<EClass, ArrayList<EObject>> instances;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("connected_ports.room");
- instances = collectInstances(root);
- }
-
- @Test
- public void testPortNumbers() {
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
- assertEquals("Number of PortInstances", 19, ports.size());
- }
-
- @Test
- public void testRelayPort() {
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
-
- PortInstance p = (PortInstance) getInstance(ports, "/CMain/test_a1/relay");
- assertNotNull("port expected", p);
- assertEquals("relay port expected", PortKind.RELAY, p.getKind());
- assertFalse("no conjuagted port expected", p.getPort().isConjugated());
- }
-
- @Test
- public void testInternalEndPort() {
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
-
- PortInstance p = (PortInstance) getInstance(ports, "/CMain/test_a2/int_end");
- assertNotNull("port expected", p);
- assertEquals("internal port expected", PortKind.INTERNAL, p.getKind());
- assertTrue("conjuagted port expected", p.getPort().isConjugated());
- assertEquals("port connected once", 1, p.getPeers().size());
- PortInstance peer = (PortInstance) getInstance(p.getPeers(), "/CMain/test_a2/sub/p2");
- assertNotNull("peer expected", peer);
- PortInstance start = (PortInstance) getInstance(peer.getPeers(), "/CMain/test_a2/int_end");
- assertNotNull("peer expected", start);
- assertEquals("peer of peer is start", p, start);
- }
-
- @Test
- public void testExternalEndPortConnectedToRelayPort() {
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
-
- PortInstance p = (PortInstance) getInstance(ports, "/CMain/test_a2/sub/p1");
- assertNotNull("port expected", p);
- assertEquals("external port expected", PortKind.EXTERNAL, p.getKind());
- assertEquals("port connected once", 1, p.getPeers().size());
- PortInstance peer = (PortInstance) getInstance(p.getPeers(), "/CMain/test_b/sub1/p");
- assertEquals("port connected twice", 2, peer.getPeers().size());
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestHierarchy.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestHierarchy.java
deleted file mode 100644
index d0178becb..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestHierarchy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.generator.etricegen.ActorInstance;
-import org.eclipse.etrice.generator.etricegen.ETriceGenPackage;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class TestHierarchy extends TestInstanceModelBuilderBase {
-
- private Root root;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("hierarchy.room");
- }
-
- @Test
- public void testInstances() {
-
- HashMap<EClass,ArrayList<EObject>> instances = collectInstances(root);
-
- assertEquals("Number of ComponentInstances", 1, instances.get(ETriceGenPackage.eINSTANCE.getSubSystemInstance()).size());
- assertEquals("Number of ActorInstances", 18, instances.get(ETriceGenPackage.eINSTANCE.getActorInstance()).size());
-
- ActorInstance ai = root.getSubSystemInstances().get(0).getInstances().get(0);
- assertEquals("Instance Path", "/CMain/l1a", ai.getPath());
-
- ai = ai.getInstances().get(1);
- assertEquals("Instance Path", "/CMain/l1a/l2b", ai.getPath());
-
- ai = ai.getInstances().get(2);
- assertEquals("Instance Path", "/CMain/l1a/l2b/l3c", ai.getPath());
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestInstanceModelBuilderBase.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestInstanceModelBuilderBase.java
deleted file mode 100644
index df4b9257a..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestInstanceModelBuilderBase.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.eclipse.xtext.resource.XtextResource;
-import org.eclipse.xtext.resource.XtextResourceSet;
-
-import org.eclipse.etrice.core.room.RoomModel;
-import org.eclipse.etrice.core.room.StateGraphItem;
-import org.eclipse.etrice.generator.base.ILogger;
-import org.eclipse.etrice.generator.builder.GeneratorModelBuilder;
-import org.eclipse.etrice.generator.etricegen.IDiagnostician;
-import org.eclipse.etrice.generator.etricegen.InstanceBase;
-import org.eclipse.etrice.generator.etricegen.Root;
-
-public class TestInstanceModelBuilderBase {
-
- class Logger implements ILogger {
-
- @Override
- public void logInfo(String text) {
- }
-
- @Override
- public void logError(String text, EObject obj) {
- }
-
- }
-
- class Diagnostician implements IDiagnostician {
-
- @Override
- public void warning(String msg, EObject source, EStructuralFeature feature) {
- }
-
- @Override
- public void warning(String msg, EObject source, EStructuralFeature feature, int index) {
- }
-
- @Override
- public void error(String msg, EObject source, EStructuralFeature feature) {
- fail(msg+RoomNameProvider.getLocation(source));
- }
-
- @Override
- public void error(String msg, EObject source, EStructuralFeature feature, int index) {
- fail(msg+RoomNameProvider.getLocation(source));
- }
-
- @Override
- public boolean isFailed() {
- return false;
- }
-
- }
-
- private String basePath;
-
- protected void prepare() {
- try {
- URL modelsDir = InstanceTestsActivator.getInstance().getBundle().getEntry("models");
- URL fileURL = FileLocator.toFileURL(modelsDir);
- basePath = fileURL.getFile();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- protected LinkedList<RoomModel> getModels(String modelName) {
- LinkedList<RoomModel> models = new LinkedList<RoomModel>();
- XtextResourceSet rs = new XtextResourceSet();
- rs.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
- String path = basePath + modelName;
- URI uri = URI.createFileURI(path);
- Resource resource = rs.getResource(uri, true);
- Object root = resource.getContents().get(0);
- if (root instanceof RoomModel)
- models.add((RoomModel) root);
- else
- fail("File contains no RoomModel as root object");
-
- return models;
- }
-
- protected Root buildInstanceModel(String modelName) {
- GeneratorModelBuilder builder = new GeneratorModelBuilder(new Logger(), new Diagnostician());
- LinkedList<RoomModel> models = getModels(modelName);
- Root root = builder.createGeneratorModel(models, false);
- return root;
- }
-
- protected HashMap<EClass, ArrayList<EObject>> collectInstances(EObject root) {
- HashMap<EClass, ArrayList<EObject>> result = new HashMap<EClass, ArrayList<EObject>>();
-
- TreeIterator<EObject> it = root.eAllContents();
- while (it.hasNext()) {
- EObject obj = it.next();
- EClass ecl = obj.eClass();
- ArrayList<EObject> instances = result.get(ecl);
- if (instances==null) {
- instances = new ArrayList<EObject>();
- result.put(ecl, instances);
- }
- instances.add(obj);
- }
-
- return result;
- }
-
- protected InstanceBase getInstance(List<? extends EObject> objects, String path) {
- for (EObject obj : objects) {
- if (obj instanceof InstanceBase) {
- InstanceBase inst = (InstanceBase) obj;
- if (inst.getPath().equals(path))
- return inst;
- }
- }
- return null;
- }
-
- protected StateGraphItem getStateGraphItem(List<? extends EObject> objects, String path) {
- for (EObject obj : objects) {
- if (obj instanceof StateGraphItem) {
- StateGraphItem item = (StateGraphItem) obj;
- if (RoomNameProvider.getFullPath(item).equals(path))
- return item;
- }
- }
- return null;
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestLayers.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestLayers.java
deleted file mode 100644
index b8bb08a37..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestLayers.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.generator.etricegen.ETriceGenPackage;
-import org.eclipse.etrice.generator.etricegen.InterfaceItemInstance;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.eclipse.etrice.generator.etricegen.SAPInstance;
-import org.eclipse.etrice.generator.etricegen.ServiceImplInstance;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class TestLayers extends TestInstanceModelBuilderBase {
-
- private Root root;
- private HashMap<EClass, ArrayList<EObject>> instances;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("layers.room");
- instances = collectInstances(root);
- }
-
- @Test
- public void testInstanceNumbers() {
- ArrayList<EObject> saps = instances.get(ETriceGenPackage.eINSTANCE.getSAPInstance());
- assertEquals("Number of SAPInstances", 6, saps.size());
-
- ArrayList<EObject> spps = instances.get(ETriceGenPackage.eINSTANCE.getSPPInstance());
- assertEquals("Number of SPPInstances", 7, spps.size());
-
- ArrayList<EObject> svcs = instances.get(ETriceGenPackage.eINSTANCE.getServiceImplInstance());
- assertEquals("Number of ServiceImplInstances", 3, svcs.size());
- }
-
- @Test
- public void testLayerConnections() {
- ArrayList<EObject> saps = instances.get(ETriceGenPackage.eINSTANCE.getSAPInstance());
-
- for (EObject obj : saps) {
- assertEquals("SAP has one peer", 1, ((SAPInstance)obj).getPeers().size());
- }
-
- SAPInstance sap = (SAPInstance) getInstance(saps, "/CMain/app/subsysA/userX/sap");
- assertNotNull("sap expected", sap);
- InterfaceItemInstance peer = ((SAPInstance)sap).getPeers().get(0);
- assertTrue("peer is a service", (peer instanceof ServiceImplInstance));
- ServiceImplInstance svc = (ServiceImplInstance) peer;
- assertEquals("number of serviceA peers", 3, svc.getPeers().size());
- assertEquals("sap and service have same protocol", sap.getSap().getProtocol(), svc.getSvcImpl().getSpp().getProtocol());
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestPorts.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestPorts.java
deleted file mode 100644
index cc2bd6c46..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestPorts.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.generator.etricegen.ETriceGenPackage;
-import org.eclipse.etrice.generator.etricegen.PortInstance;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class TestPorts extends TestInstanceModelBuilderBase {
-
- private Root root;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("ports.room");
- }
-
- @Test
- public void testPortNumbers() {
- HashMap<EClass, ArrayList<EObject>> instances = collectInstances(root);
- assertEquals("Number of PortInstances", 3, instances.get(ETriceGenPackage.eINSTANCE.getPortInstance()).size());
- }
-
- @Test
- public void testPortInstancePaths() {
- PortInstance pi = root.getSubSystemInstances().get(0).getInstances().get(0).getPorts().get(0);
- assertEquals("Port Name", "/CMain/test/externalEnd", pi.getPath());
-
- pi = root.getSubSystemInstances().get(0).getInstances().get(0).getPorts().get(1);
- assertEquals("Port Name", "/CMain/test/internalEnd", pi.getPath());
-
- pi = root.getSubSystemInstances().get(0).getInstances().get(0).getPorts().get(2);
- assertEquals("Port Name", "/CMain/test/relay", pi.getPath());
- }
-
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStates.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStates.java
deleted file mode 100644
index 0c78f11b1..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStates.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.eclipse.etrice.core.room.ChoicePoint;
-import org.eclipse.etrice.core.room.ContinuationTransition;
-import org.eclipse.etrice.core.room.RoomPackage;
-import org.eclipse.etrice.core.room.State;
-import org.eclipse.etrice.core.room.Transition;
-import org.eclipse.etrice.generator.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.eclipse.etrice.generator.etricegen.TransitionChain;
-
-public class TestStates extends TestInstanceModelBuilderBase {
-
- private Root root;
- private HashMap<EClass, ArrayList<EObject>> instances;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("states.room");
- instances = collectInstances(root.getXpActorClasses().get(0));
- }
-
- @Test
- public void testNumbers() {
- assertEquals("number of states", 7, instances.get(RoomPackage.eINSTANCE.getSimpleState()).size());
- assertEquals("number of choice points", 1, instances.get(RoomPackage.eINSTANCE.getChoicePoint()).size());
- assertEquals("number of transition points", 2, instances.get(RoomPackage.eINSTANCE.getTransitionPoint()).size());
- assertEquals("number of entry points", 1, instances.get(RoomPackage.eINSTANCE.getEntryPoint()).size());
- assertEquals("number of exit points", 1, instances.get(RoomPackage.eINSTANCE.getExitPoint()).size());
- assertEquals("number of initial transitions", 2, instances.get(RoomPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 9, instances.get(RoomPackage.eINSTANCE.getTriggeredTransition()).size());
- assertEquals("number of continuation transitions", 3, instances.get(RoomPackage.eINSTANCE.getContinuationTransition()).size());
- assertEquals("number of branch transitions", 2, instances.get(RoomPackage.eINSTANCE.getCPBranchTransition()).size());
- }
-
- @Test
- public void testXPACGeneral() {
- ExpandedActorClass xpac = root.getXpActorClasses().get(0);
- assertEquals("actor class", xpac.getActorClass().getName(), "ATest");
- EList<TransitionChain> chains = xpac.getTransitionChains();
- assertEquals("number of chains", 11, chains.size());
- assertEquals("numer of triggers", 3, xpac.getTriggers().size());
- }
-
- @Test
- public void testGraph() {
- ArrayList<EObject> states = instances.get(RoomPackage.eINSTANCE.getSimpleState());
-// for (EObject obj : states) {
-// LogicalSystem.out.println("state "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- ExpandedActorClass xpac = root.getXpActorClasses().get(0);
-
- State s = (State) getStateGraphItem(states, "State3_State3");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 3, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 2, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 3, xpac.getActiveTriggers(s).size());
-
- s = (State) getStateGraphItem(states, "State2");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 3, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 1, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 2, xpac.getActiveTriggers(s).size());
-
- ArrayList<EObject> cps = instances.get(RoomPackage.eINSTANCE.getChoicePoint());
-
- ChoicePoint cp = (ChoicePoint) cps.get(0);
- assertEquals("choicepoint name", "CP1", RoomNameProvider.getFullPath(cp));
- assertEquals("number of incoming transitions", 1, xpac.getIncomingTransitions(cp).size());
- assertEquals("number of outgoing transitions", 3, xpac.getOutgoingTransitions(cp).size());
-
- ContinuationTransition dflt = xpac.getDefaultBranch(xpac.getOutgoingTransitions(cp));
- assertNotNull("default branch", dflt);
- }
-
- @Test
- public void testChains() {
- ArrayList<EObject> cts = instances.get(RoomPackage.eINSTANCE.getContinuationTransition());
-// for (EObject obj : cts) {
-// LogicalSystem.out.println("ct "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- Transition t = (Transition) getStateGraphItem(cts, "State3_TRANS_tr1_FROM_tp1_TO_State3");
- assertNotNull("transition", t);
-
- ExpandedActorClass xpac = root.getXpActorClasses().get(0);
- TransitionChain chain = xpac.getChain(t);
- assertNotNull("chain", chain);
- assertEquals("chain name", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", RoomNameProvider.getFullPath(chain.getTransition()));
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesAndTriggers.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesAndTriggers.java
deleted file mode 100644
index fcc4fa84d..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesAndTriggers.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.eclipse.etrice.core.room.ChoicePoint;
-import org.eclipse.etrice.core.room.ContinuationTransition;
-import org.eclipse.etrice.core.room.Port;
-import org.eclipse.etrice.core.room.RoomPackage;
-import org.eclipse.etrice.core.room.SAPRef;
-import org.eclipse.etrice.core.room.State;
-import org.eclipse.etrice.core.room.Transition;
-import org.eclipse.etrice.generator.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.eclipse.etrice.generator.etricegen.TransitionChain;
-
-public class TestStatesAndTriggers extends TestInstanceModelBuilderBase {
-
- private Root root;
- private ExpandedActorClass xpac;
- private HashMap<EClass, ArrayList<EObject>> instances;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("states_triggers.room");
- xpac = getTestee();
- instances = collectInstances(xpac);
- }
-
- private ExpandedActorClass getTestee() {
- for (ExpandedActorClass xpac : root.getXpActorClasses()) {
- if (xpac.getActorClass().getName().equals("ATest"))
- return xpac;
- }
- return null;
- }
-
- @Test
- public void testNumbers() {
- assertEquals("number of states", 7, instances.get(RoomPackage.eINSTANCE.getSimpleState()).size());
- assertEquals("number of choice points", 1, instances.get(RoomPackage.eINSTANCE.getChoicePoint()).size());
- assertEquals("number of transition points", 4, instances.get(RoomPackage.eINSTANCE.getTransitionPoint()).size());
- assertEquals("number of entry points", 1, instances.get(RoomPackage.eINSTANCE.getEntryPoint()).size());
- assertEquals("number of exit points", 1, instances.get(RoomPackage.eINSTANCE.getExitPoint()).size());
- assertEquals("number of initial transitions", 2, instances.get(RoomPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 11, instances.get(RoomPackage.eINSTANCE.getTriggeredTransition()).size());
- assertEquals("number of continuation transitions", 3, instances.get(RoomPackage.eINSTANCE.getContinuationTransition()).size());
- assertEquals("number of branch transitions", 2, instances.get(RoomPackage.eINSTANCE.getCPBranchTransition()).size());
- }
-
- @Test
- public void testXPACGeneral() {
- EList<TransitionChain> chains = xpac.getTransitionChains();
- assertEquals("number of chains", 13, chains.size());
- assertEquals("numer of triggers", 7, xpac.getTriggers().size());
- }
-
- @Test
- public void testGraph() {
- ArrayList<EObject> states = instances.get(RoomPackage.eINSTANCE.getSimpleState());
-// for (EObject obj : states) {
-// LogicalSystem.out.println("state "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- State s = (State) getStateGraphItem(states, "State3_State3");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 3, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 2, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 6, xpac.getActiveTriggers(s).size());
-
- s = (State) getStateGraphItem(states, "State2");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 4, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 1, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 3, xpac.getActiveTriggers(s).size());
-
- ArrayList<EObject> cps = instances.get(RoomPackage.eINSTANCE.getChoicePoint());
-
- ChoicePoint cp = (ChoicePoint) cps.get(0);
- assertEquals("choicepoint name", "CP1", RoomNameProvider.getFullPath(cp));
- assertEquals("number of incoming transitions", 1, xpac.getIncomingTransitions(cp).size());
- assertEquals("number of outgoing transitions", 3, xpac.getOutgoingTransitions(cp).size());
-
- ContinuationTransition dflt = xpac.getDefaultBranch(xpac.getOutgoingTransitions(cp));
- assertNotNull("default branch", dflt);
- }
-
- @Test
- public void testChains() {
- ArrayList<EObject> cts = instances.get(RoomPackage.eINSTANCE.getContinuationTransition());
-// for (EObject obj : cts) {
-// LogicalSystem.out.println("ct "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- Transition t = (Transition) getStateGraphItem(cts, "State3_TRANS_tr1_FROM_tp1_TO_State3");
- assertNotNull("transition", t);
-
- TransitionChain chain = xpac.getChain(t);
- assertNotNull("chain", chain);
- assertEquals("chain name", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", RoomNameProvider.getFullPath(chain.getTransition()));
- }
-
- @Test
- public void testIfItems() {
- Port fct = xpac.getActorClass().getIfPorts().get(0);
- Port sub = xpac.getActorClass().getIntPorts().get(0);
- SAPRef timer = xpac.getActorClass().getStrSAPs().get(0);
- SAPRef timeout = xpac.getActorClass().getStrSAPs().get(1);
-
- assertEquals("port name", "fct", fct.getName());
- assertEquals("port name", "sub", sub.getName());
- assertEquals("sap name", "timer", timer.getName());
- assertEquals("sap name", "timeout", timeout.getName());
-
- assertEquals("port local id", 0, xpac.getInterfaceItemLocalId(fct));
- assertEquals("port local id", 1, xpac.getInterfaceItemLocalId(sub));
- assertEquals("sap local id", 2, xpac.getInterfaceItemLocalId(timer));
- assertEquals("sap local id", 3, xpac.getInterfaceItemLocalId(timeout));
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesInheritance.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesInheritance.java
deleted file mode 100644
index 954a7bd27..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStatesInheritance.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.eclipse.etrice.core.room.ChoicePoint;
-import org.eclipse.etrice.core.room.ContinuationTransition;
-import org.eclipse.etrice.core.room.RoomPackage;
-import org.eclipse.etrice.core.room.State;
-import org.eclipse.etrice.core.room.Transition;
-import org.eclipse.etrice.generator.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.eclipse.etrice.generator.etricegen.TransitionChain;
-
-public class TestStatesInheritance extends TestInstanceModelBuilderBase {
-
- private Root root;
- private HashMap<EClass, ArrayList<EObject>> instances;
- private ExpandedActorClass xpac;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("states_inheritance.room");
- xpac = getTestee();
- instances = collectInstances(xpac);
- }
-
- private ExpandedActorClass getTestee() {
- for (ExpandedActorClass xpac : root.getXpActorClasses()) {
- if (xpac.getActorClass().getName().equals("ADerived"))
- return xpac;
- }
- return null;
- }
-
-// private void assertEquals(String msg, int exp, int is) {
-// LogicalSystem.out.println(msg+" exp:"+exp+" is:"+is);
-// }
-//
-// private void assertEquals(String msg, String exp, String is) {
-// LogicalSystem.out.println(msg+" exp:"+exp+" is:"+is);
-// }
-//
-// private void assertEquals(String msg, EObject exp, EObject is) {
-// LogicalSystem.out.println(msg+" exp:"+exp+" is:"+is);
-// }
-
- @Test
- public void testNumbers() {
- assertEquals("number of states", 11, instances.get(RoomPackage.eINSTANCE.getSimpleState()).size());
- assertEquals("number of choice points", 1, instances.get(RoomPackage.eINSTANCE.getChoicePoint()).size());
- assertEquals("number of transition points", 5, instances.get(RoomPackage.eINSTANCE.getTransitionPoint()).size());
- assertEquals("number of entry points", 2, instances.get(RoomPackage.eINSTANCE.getEntryPoint()).size());
- assertEquals("number of exit points", 1, instances.get(RoomPackage.eINSTANCE.getExitPoint()).size());
- assertEquals("number of initial transitions", 3, instances.get(RoomPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 17, instances.get(RoomPackage.eINSTANCE.getTriggeredTransition()).size());
- assertEquals("number of continuation transitions", 4, instances.get(RoomPackage.eINSTANCE.getContinuationTransition()).size());
- assertEquals("number of branch transitions", 3, instances.get(RoomPackage.eINSTANCE.getCPBranchTransition()).size());
- }
-
- @Test
- public void testXPACGeneral() {
- EList<TransitionChain> chains = xpac.getTransitionChains();
- assertEquals("number of chains", 20, chains.size());
- assertEquals("numer of triggers", 8, xpac.getTriggers().size());
- }
-
- @Test
- public void testGraph() {
- ArrayList<EObject> states = instances.get(RoomPackage.eINSTANCE.getSimpleState());
-// for (EObject obj : states) {
-// LogicalSystem.out.println("state "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- State s = (State) getStateGraphItem(states, "State3_State3");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 3, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 2, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 6, xpac.getActiveTriggers(s).size());
-
- s = (State) getStateGraphItem(states, "State2");
- assertNotNull("state exists", s);
- assertEquals("number of incoming transitions", 4, xpac.getIncomingTransitions(s).size());
- assertEquals("number of outgoing transitions", 1, xpac.getOutgoingTransitions(s).size());
-
- assertEquals("active triggers", 3, xpac.getActiveTriggers(s).size());
-
- ArrayList<EObject> cps = instances.get(RoomPackage.eINSTANCE.getChoicePoint());
-
- ChoicePoint cp = (ChoicePoint) cps.get(0);
- assertEquals("choicepoint name", "CP1", RoomNameProvider.getFullPath(cp));
- assertEquals("number of incoming transitions", 1, xpac.getIncomingTransitions(cp).size());
- assertEquals("number of outgoing transitions", 4, xpac.getOutgoingTransitions(cp).size());
-
- ContinuationTransition dflt = xpac.getDefaultBranch(xpac.getOutgoingTransitions(cp));
- assertNotNull("default branch", dflt);
- }
-
- @Test
- public void testChains() {
- ArrayList<EObject> cts = instances.get(RoomPackage.eINSTANCE.getContinuationTransition());
-// for (EObject obj : cts) {
-// LogicalSystem.out.println("ct "+RoomNameProvider.getFullPath((StateGraphItem) obj));
-// }
-
- Transition t = (Transition) getStateGraphItem(cts, "State3_TRANS_tr1_FROM_tp1_TO_State3");
- assertNotNull("transition", t);
-
- TransitionChain chain = xpac.getChain(t);
- assertNotNull("chain", chain);
- assertEquals("chain name", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", RoomNameProvider.getFullPath(chain.getTransition()));
-
- t = (Transition) getStateGraphItem(cts, "State3_TRANS_tr8_FROM_tp6_TO_State2");
- assertNotNull("transition", t);
-
- chain = xpac.getChain(t);
- assertNotNull("chain", chain);
- assertEquals("chain name", "TRANS_tr12_FROM_State5_TO_State3_tp6_BY_aport", RoomNameProvider.getFullPath(chain.getTransition()));
- }
-}
diff --git a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStructureInheritance.java b/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStructureInheritance.java
deleted file mode 100644
index 2f1f22d1c..000000000
--- a/tests/org.eclipse.etrice.generator.tests/src/org/eclipse/etrice/generator/TestStructureInheritance.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
- * 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
- *
- * CONTRIBUTORS:
- * Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.generator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.eclipse.etrice.core.room.ActorClass;
-import org.eclipse.etrice.core.room.Port;
-import org.eclipse.etrice.core.room.SAPRef;
-import org.eclipse.etrice.generator.etricegen.ETriceGenPackage;
-import org.eclipse.etrice.generator.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.generator.etricegen.InterfaceItemInstance;
-import org.eclipse.etrice.generator.etricegen.PortInstance;
-import org.eclipse.etrice.generator.etricegen.PortKind;
-import org.eclipse.etrice.generator.etricegen.Root;
-import org.eclipse.etrice.generator.etricegen.SAPInstance;
-import org.eclipse.etrice.generator.etricegen.ServiceImplInstance;
-
-public class TestStructureInheritance extends TestInstanceModelBuilderBase {
-
- private Root root;
- private ExpandedActorClass xpac;
- private HashMap<EClass, ArrayList<EObject>> instances;
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("structure_inheritance.room");
- xpac = getTestee();
- instances = collectInstances(root);
- }
-
- private ExpandedActorClass getTestee() {
- for (ExpandedActorClass xpac : root.getXpActorClasses()) {
- if (xpac.getActorClass().getName().equals("AFunctionA"))
- return xpac;
- }
- return null;
- }
-
-// private void assertEquals(String msg, int exp, int is) {
-// LogicalSystem.out.println(msg+" exp:"+exp+" is:"+is);
-// }
-//
-// private void assertEquals(String msg, EObject exp, EObject is) {
-// LogicalSystem.out.println(msg+" exp:"+exp+" is:"+is);
-// }
-
- @Test
- public void testInstanceNumbers() {
- ArrayList<EObject> actors = instances.get(ETriceGenPackage.eINSTANCE.getActorInstance());
- assertEquals("Number of ActorInstances", 8, actors.size());
-
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
- assertEquals("Number of PortInstances", 30, ports.size());
-
- ArrayList<EObject> saps = instances.get(ETriceGenPackage.eINSTANCE.getSAPInstance());
- assertEquals("Number of SAPInstances", 8, saps.size());
-
- ArrayList<EObject> spps = instances.get(ETriceGenPackage.eINSTANCE.getSPPInstance());
- assertEquals("Number of SPPInstances", 2, spps.size());
-
- ArrayList<EObject> svcs = instances.get(ETriceGenPackage.eINSTANCE.getServiceImplInstance());
- assertEquals("Number of ServiceImplInstances", 2, svcs.size());
- }
-
- @Test
- public void testLayerConnections() {
- ArrayList<EObject> saps = instances.get(ETriceGenPackage.eINSTANCE.getSAPInstance());
-
- for (EObject obj : saps) {
- assertEquals("SAP has one peer", 1, ((SAPInstance)obj).getPeers().size());
- }
-
- SAPInstance sap = (SAPInstance) getInstance(saps, "/CMain/application/fcta/sub2/timeout");
- assertNotNull("sap expected", sap);
- InterfaceItemInstance peer = ((SAPInstance)sap).getPeers().get(0);
- assertTrue("peer is a service", (peer instanceof ServiceImplInstance));
- ServiceImplInstance svc = (ServiceImplInstance) peer;
- assertEquals("number of serviceA peers", 8, svc.getPeers().size());
- assertEquals("sap and service have same protocol", sap.getSap().getProtocol(), svc.getSvcImpl().getSpp().getProtocol());
- }
-
- private Port getPort(ActorClass ac, String name) {
- for (Port p : ac.getIfPorts()) {
- if (p.getName().equals(name))
- return p;
- }
- for (Port p : ac.getIntPorts()) {
- if (p.getName().equals(name))
- return p;
- }
-
- if (ac.getBase()!=null)
- return getPort(ac.getBase(), name);
-
- fail("port "+name+" not found");
- return null;
- }
-
- private SAPRef getSAP(ActorClass ac, String name) {
- for (SAPRef sap : ac.getStrSAPs()) {
- if (sap.getName().equals(name))
- return sap;
- }
-
- if (ac.getBase()!=null)
- return getSAP(ac.getBase(), name);
-
- fail("sap "+name+" not found");
- return null;
- }
-
- @Test
- public void testIfItems() {
- Port base = getPort(xpac.getActorClass(), "base");
- Port subbase = getPort(xpac.getActorClass(), "subbase");
- Port ctrl = getPort(xpac.getActorClass(), "ctrl");
- Port subctrl = getPort(xpac.getActorClass(), "subctrl");
- Port fct1 = getPort(xpac.getActorClass(), "fct1");
- Port fct2 = getPort(xpac.getActorClass(), "fct2");
- SAPRef ctrltimeout = getSAP(xpac.getActorClass(), "ctrltimeout");
- SAPRef timeout = getSAP(xpac.getActorClass(), "timeout");
-
- int lid = 0;
- assertEquals("port local id", lid++, xpac.getInterfaceItemLocalId(base));
- assertEquals("port local id", lid++, xpac.getInterfaceItemLocalId(subbase));
- assertEquals("port local id", lid++, xpac.getInterfaceItemLocalId(ctrl));
- assertEquals("port local id", lid++, xpac.getInterfaceItemLocalId(subctrl));
- assertEquals("sap local id", lid++, xpac.getInterfaceItemLocalId(ctrltimeout));
- assertEquals("sap local id", lid++, xpac.getInterfaceItemLocalId(timeout));
- assertEquals("relay port local id", -1, xpac.getInterfaceItemLocalId(fct1));
- assertEquals("relay port local id", -1, xpac.getInterfaceItemLocalId(fct2));
- }
-
- @Test
- public void testPortConnection() {
- ArrayList<EObject> ports = instances.get(ETriceGenPackage.eINSTANCE.getPortInstance());
-
- PortInstance p = (PortInstance) getInstance(ports, "/CMain/application/fcta/sub2/fct");
- assertNotNull("port expected", p);
- assertEquals("external port expected", PortKind.EXTERNAL.getValue(), p.getKind().getValue());
- assertFalse("no conjuagted port expected", p.getPort().isConjugated());
- assertEquals("port connected once", 1, p.getPeers().size());
- PortInstance peer = (PortInstance) getInstance(p.getPeers(), "/CMain/application/client/pa1");
- assertNotNull("peer expected", peer);
- peer = (PortInstance) getInstance(peer.getPeers(), "/CMain/application/fcta/sub2/fct");
- assertNotNull("peer expected", peer);
- assertEquals("peer of peer is start", p, peer);
- }
-}

Back to the top