Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2017-11-06 10:37:41 +0000
committerHenrik Rentz-Reichert2017-11-07 06:58:06 +0000
commit48d51b2b32f759e255f0cca154d2757c95d15e19 (patch)
treef1455e17e092e88c01feac4b6cf7f5ec2d2896ff /tests
parentb09856b29bfcaea08e9e57b14da3744c0a201867 (diff)
downloadorg.eclipse.etrice-48d51b2b32f759e255f0cca154d2757c95d15e19.tar.gz
org.eclipse.etrice-48d51b2b32f759e255f0cca154d2757c95d15e19.tar.xz
org.eclipse.etrice-48d51b2b32f759e255f0cca154d2757c95d15e19.zip
Bug 511330 - [core.genmodel.fsm] introduce simplified generator model
for state machines * manually merged newfsmgen to newfsmgen_finalize because no rebase was possible due to structural changes * rebased on master * switch to Oxygen and Xtend 2.12 Change-Id: If9a8c7421f07fb8e8fa824b7bc6761b9142b7eaf
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room8
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/CashTerminal.AuthServer.behavior2
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/Semantics.AETest1.behavior2
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/org.franca.examples.RobotArmExampleClient.behavior231
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/models/semantics.room7
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/org.eclipse.etrice.abstractexec.behavior.tests.launch8
-rw-r--r--tests/org.eclipse.etrice.abstractexec.behavior.tests/src/org/eclipse/etrice/abstractexec/behavior/tests/TestReachability.java16
-rw-r--r--tests/org.eclipse.etrice.core.common.tests/org.eclipse.etrice.core.common.tests.launch1
-rw-r--r--tests/org.eclipse.etrice.core.etmap.tests/org.eclipse.etrice.core.etmap.tests.launch3
-rw-r--r--tests/org.eclipse.etrice.core.etphys.tests/org.eclipse.etrice.core.etphys.tests.launch3
-rw-r--r--tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch3
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath8
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore2
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project34
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF15
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.classbin1479 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase$1.classbin1954 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.classbin5378 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$1.classbin1929 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$2.classbin1931 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$3.classbin1935 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$4.classbin1999 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$5.classbin1999 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$6.classbin1992 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.classbin6511 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$1.classbin2064 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$2.classbin2061 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$3.classbin1910 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.classbin6857 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$1.classbin2039 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$2.classbin2040 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$3.classbin2042 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$4.classbin2044 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$5.classbin1893 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.classbin7793 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM$1.classbin2052 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.classbin6421 -> 0 bytes
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties5
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/CodeInheritanceExample.room (renamed from tests/org.eclipse.etrice.core.genmodel.tests/models/code_inheritance.room)8
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room52
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room73
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room58
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room122
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/MultipleConnectedChoicepointExample.room (renamed from tests/org.eclipse.etrice.core.genmodel.tests/models/cpmult.room)9
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesInheritanceExample.room (renamed from tests/org.eclipse.etrice.core.genmodel.tests/models/states_inheritance.room)19
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesTriggersExample.room (renamed from tests/org.eclipse.etrice.core.genmodel.tests/models/states_triggers.room)21
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/TriggerExample.room87
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/Types.room13
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch44
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/.gitignore1
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java37
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend (renamed from tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend)16
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.xtend83
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend (renamed from tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend)0
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend (renamed from tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend)0
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend (renamed from tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend)0
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend (renamed from tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend)17
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.xtend116
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.xtend117
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.xtend108
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.xtend114
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java76
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.java105
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java113
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java86
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java110
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java117
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.java174
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.java161
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.java146
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.java135
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/models/states.room108
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/org.eclipse.etrice.core.genmodel.tests.launch6
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestCodeInheritance.java125
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestInstanceModelBuilderBase.java24
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestMultipleConnectedChoicepoint.java155
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStates.java117
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesAndTriggers.java142
-rw-r--r--tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesInheritance.java142
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/org.eclipse.etrice.core.room.tests.launch6
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java5
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java2
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend16
-rw-r--r--tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java156
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/.gitignore8
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/org.eclipse.etrice.generator.c.tests make.xml.launch38
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/common.xml219
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room22
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room58
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room20
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room7
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room20
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room605
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room586
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/.gitignore8
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/org.eclipse.etrice.generator.cpp.tests make.xml.launch38
-rw-r--r--tests/org.eclipse.etrice.generator.fsmtest.tests/org.eclipse.etrice.generator.fsmtest.tests.launch1
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/.gitignore11
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/make.xml130
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/org.eclipse.etrice.generator.java.tests make.xml.launch44
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest1.room182
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest2.room236
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest3.room235
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest4.room97
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest5.room149
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest6.room243
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest7.room375
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/StoreRestore.room217
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room160
-rw-r--r--tests/org.eclipse.etrice.runtime.java.tests/org.eclipse.etrice.runtime.java.tests.launch1
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/META-INF/MANIFEST.MF4
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior341
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Derived.behavior452
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen46
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/output/Derived.fsmgen61
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/output/DoubleDerived.fsmgen82
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.xtend121
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java177
126 files changed, 7740 insertions, 964 deletions
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
index 6cff28eb9..34901348f 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/bug417433.room
@@ -74,9 +74,9 @@ RoomModel org.franca.examples [ "Generated from Franca IDL model org.franca.exam
Attribute z: UInt16
}
- PrimitiveType UInt16: ptInteger -> java.lang.Integer(java.lang.Integer) default "0"
- PrimitiveType UInt32: ptInteger -> java.lang.Integer(java.lang.Integer) default "0"
- PrimitiveType Double: ptReal -> java.lang.Double(java.lang.Double) default "0.0"
- PrimitiveType Boolean: ptBoolean -> java.lang.Boolean(java.lang.Boolean) default "false"
+ PrimitiveType UInt16: ptInteger -> "java.lang.Integer(java.lang.Integer)" default "0"
+ PrimitiveType UInt32: ptInteger -> "java.lang.Integer(java.lang.Integer)" default "0"
+ PrimitiveType Double: ptReal -> "java.lang.Double(java.lang.Double)" default "0.0"
+ PrimitiveType Boolean: ptBoolean -> "java.lang.Boolean(java.lang.Boolean)" default "false"
}
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/CashTerminal.AuthServer.behavior b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/CashTerminal.AuthServer.behavior
index d7436dce6..71480d32e 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/CashTerminal.AuthServer.behavior
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/CashTerminal.AuthServer.behavior
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of AuthServer" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@children.0/@children.6/@link //@children.0/@children.7/@link //@connections.5/@link //@connections.6/@link //@children.0/@children.8/@link //@connections.7/@link //@connections.8/@link //@connections.9/@link" verticalGridUnit="10" version="0.10.0">
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of AuthServer" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@children.0/@children.6/@link //@children.0/@children.7/@link //@connections.5/@link //@connections.6/@link //@children.0/@children.8/@link //@connections.7/@link //@connections.8/@link //@connections.9/@link" verticalGridUnit="10" version="0.13.0">
<graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
<link>
<businessObjects href="../cashTerminal.room#ActorClass:AuthServer"/>
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/Semantics.AETest1.behavior b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/Semantics.AETest1.behavior
index 23384764a..44d9288c5 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/Semantics.AETest1.behavior
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/Semantics.AETest1.behavior
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of AETest1" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.0/@children.7/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@connections.5/@link" verticalGridUnit="10" version="0.10.0">
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of AETest1" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.0/@children.7/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@connections.5/@link" verticalGridUnit="10" version="0.13.0">
<graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="322" height="620"/>
<link>
<businessObjects href="../semantics.room#ActorClass:AETest1"/>
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/org.franca.examples.RobotArmExampleClient.behavior b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/org.franca.examples.RobotArmExampleClient.behavior
new file mode 100644
index 000000000..6ba89bbd1
--- /dev/null
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/diagrams/org.franca.examples.RobotArmExampleClient.behavior
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of RobotArmExampleClient" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link" verticalGridUnit="10" version="0.13.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../bug417433.room#ActorClass:RobotArmExampleClient"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#StateGraph:RobotArmExampleClient$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#StateGraph:RobotArmExampleClient$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="159" height="90" x="65" y="180">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="99" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="74" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="49" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="49" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="49" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#SimpleState:RobotArmExampleClient$waitingForMove"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="99" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="waitingForMove"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="157" height="90" x="181" y="341">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="97" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="72" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="48" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="48" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="48" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#SimpleState:RobotArmExampleClient$waitingForGrab"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="97" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="waitingForGrab"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="176" height="90" x="386" y="180">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="116" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="91" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" x="58" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="58" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="58" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#SimpleState:RobotArmExampleClient$waitingForRelease"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3" incomingConnections="//@connections.2" referencedGraphicsAlgorithm="//@children.0/@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="116" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="waitingForRelease"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="588" y="341">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../bug417433.room#SimpleState:RobotArmExampleClient$ready"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.3" referencedGraphicsAlgorithm="//@children.0/@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="ready"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../bug417433.room#InitialTransition:RobotArmExampleClient$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.2/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../bug417433.room#TriggeredTransition:RobotArmExampleClient$done1"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="done1: &lt;replyMove:me..."/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.3/@anchors.0" end="//@children.0/@children.4/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../bug417433.room#TriggeredTransition:RobotArmExampleClient$done2"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="done2: &lt;replyGrab:me..."/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.4/@anchors.0" end="//@children.0/@children.5/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../bug417433.room#TriggeredTransition:RobotArmExampleClient$done"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="done: &lt;replyRelease:..."/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/semantics.room b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/semantics.room
index 85c0eebd3..a1c316575 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/semantics.room
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/models/semantics.room
@@ -45,7 +45,8 @@ RoomModel Semantics {
}
Transition tr4: state1 -> wrong {
triggers {
- // this trigger receives a warning
+ // this trigger receives a warning:
+ // The message violates the semantic rule
<in1: p0>
}
}
@@ -53,7 +54,11 @@ RoomModel Semantics {
State state1
State state2
State state3
+
+ // State should handle the message in1 from port p0
State state4
+
+ // State should handle the message in2 from port p0
State wrong
}
}
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/org.eclipse.etrice.abstractexec.behavior.tests.launch b/tests/org.eclipse.etrice.abstractexec.behavior.tests/org.eclipse.etrice.abstractexec.behavior.tests.launch
index a6708609b..16d252bd6 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/org.eclipse.etrice.abstractexec.behavior.tests.launch
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/org.eclipse.etrice.abstractexec.behavior.tests.launch
@@ -11,7 +11,7 @@
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -32,13 +32,13 @@
<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.abstractexec.behavior.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.8 -Xms40m -Xmx512m -XX:MaxPermSize=256m -ea"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.8 -Xms40m -Xmx512m -ea"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="false"/>
<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,javax.inject@default:default,javax.xml@default:default,org.antlr.runtime@default:default,org.apache.commons.io@default:default,org.apache.log4j@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi@-1:true,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.abstractexec.behavior.tests@default:default,org.eclipse.etrice.abstractexec.behavior@default:default,org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.genmodel.fsm@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.generator.fsm@default:default,org.eclipse.etrice.logging@default:false"/>
-<booleanAttribute key="show_selected_only" value="true"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.abstractexec.behavior.tests@default:default,org.eclipse.etrice.abstractexec.behavior@default:default,org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.genmodel.fsm2@default:default,org.eclipse.etrice.core.genmodel.fsm@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.generator.fsm@default:default,org.eclipse.etrice.logging@default:false"/>
+<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
diff --git a/tests/org.eclipse.etrice.abstractexec.behavior.tests/src/org/eclipse/etrice/abstractexec/behavior/tests/TestReachability.java b/tests/org.eclipse.etrice.abstractexec.behavior.tests/src/org/eclipse/etrice/abstractexec/behavior/tests/TestReachability.java
index a3e29c486..66654cc3d 100644
--- a/tests/org.eclipse.etrice.abstractexec.behavior.tests/src/org/eclipse/etrice/abstractexec/behavior/tests/TestReachability.java
+++ b/tests/org.eclipse.etrice.abstractexec.behavior.tests/src/org/eclipse/etrice/abstractexec/behavior/tests/TestReachability.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.abstractexec.behavior.ReachabilityValidator;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.fsm.fSM.InitialTransition;
+import org.eclipse.etrice.core.fsm.fSM.RefinedTransition;
import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.fsm.fSM.State;
import org.eclipse.etrice.core.fsm.fSM.StateGraph;
@@ -93,13 +94,12 @@ public class TestReachability extends TestBase {
}
private void checkUnreachable(StateGraphItem item) {
- if (item instanceof InitialTransition) {
- Assert.assertTrue(
- item + " is incorrectly marked UNreachable (or name doesn't end with '_0' ?)",
- item.getName().endsWith("_0"));
- } else
- Assert.assertTrue(
- item + " is incorrectly marked UNreachable (or name doesn't end with '_0' ?)",
- item.getName().endsWith("_0"));
+ String name = item.getName();
+ if (item instanceof RefinedTransition) {
+ name = ((RefinedTransition) item).getTarget().getName();
+ }
+ Assert.assertTrue(
+ name + " is incorrectly marked UNreachable (or name doesn't end with '_0' ?)",
+ name.endsWith("_0"));
}
}
diff --git a/tests/org.eclipse.etrice.core.common.tests/org.eclipse.etrice.core.common.tests.launch b/tests/org.eclipse.etrice.core.common.tests/org.eclipse.etrice.core.common.tests.launch
index 171ab9d95..4c5fa5f6d 100644
--- a/tests/org.eclipse.etrice.core.common.tests/org.eclipse.etrice.core.common.tests.launch
+++ b/tests/org.eclipse.etrice.core.common.tests/org.eclipse.etrice.core.common.tests.launch
@@ -10,6 +10,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/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.common.tests"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.etmap.tests/org.eclipse.etrice.core.etmap.tests.launch b/tests/org.eclipse.etrice.core.etmap.tests/org.eclipse.etrice.core.etmap.tests.launch
index 99cb72aa4..5732b3f05 100644
--- a/tests/org.eclipse.etrice.core.etmap.tests/org.eclipse.etrice.core.etmap.tests.launch
+++ b/tests/org.eclipse.etrice.core.etmap.tests/org.eclipse.etrice.core.etmap.tests.launch
@@ -8,6 +8,9 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.etmap.tests"/>
<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/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.etmap.tests"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.etphys.tests/org.eclipse.etrice.core.etphys.tests.launch b/tests/org.eclipse.etrice.core.etphys.tests/org.eclipse.etrice.core.etphys.tests.launch
index 8a2b89ec7..ae1fb4d23 100644
--- a/tests/org.eclipse.etrice.core.etphys.tests/org.eclipse.etrice.core.etphys.tests.launch
+++ b/tests/org.eclipse.etrice.core.etphys.tests/org.eclipse.etrice.core.etphys.tests.launch
@@ -8,6 +8,9 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.etphys.tests"/>
<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/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.etphys.tests"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch b/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
index 993fee367..e30656d25 100644
--- a/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
+++ b/tests/org.eclipse.etrice.core.fsm.tests/org.eclipse.etrice.core.fsm.tests.launch
@@ -8,6 +8,9 @@
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.fsm.tests"/>
<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/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.core.fsm.tests"/>
</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath
new file mode 100644
index 000000000..325150d24
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore
new file mode 100644
index 000000000..d567ba01e
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.gitignore
@@ -0,0 +1,2 @@
+bin
+target
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project
new file mode 100644
index 000000000..0121c5ab5
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.core.genmodel.fsm.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f42de363a
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..2075402f5
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: FSM GenModel Tests
+Bundle-SymbolicName: org.eclipse.etrice.core.genmodel.fsm.tests
+Bundle-Version: 1.1.1.qualifier
+Bundle-Vendor: Eclipse eTrice
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.junit;bundle-version="4.12.0",
+ org.eclipse.osgi;bundle-version="3.11.2",
+ org.eclipse.core.runtime;bundle-version="3.12.0",
+ org.eclipse.etrice.core.room;bundle-version="1.1.0",
+ org.eclipse.etrice.core.room.tests;bundle-version="1.1.0",
+ org.eclipse.etrice.core.genmodel.fsm;bundle-version="1.1.0"
+Bundle-Activator: org.eclipse.etrice.core.genmodel.fsm.tests.FSMGenModelTestsActivator
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.class
deleted file mode 100644
index fafc5bbb6..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase$1.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase$1.class
deleted file mode 100644
index d9a98ca10..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase$1.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.class
deleted file mode 100644
index ea2ee56a0..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$1.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$1.class
deleted file mode 100644
index 15ed17236..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$1.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$2.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$2.class
deleted file mode 100644
index a3d1db3f0..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$2.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$3.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$3.class
deleted file mode 100644
index a911ff87c..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$3.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$4.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$4.class
deleted file mode 100644
index 2d48d9298..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$4.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$5.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$5.class
deleted file mode 100644
index b2746ac19..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$5.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$6.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$6.class
deleted file mode 100644
index 8678b3d0b..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM$6.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.class
deleted file mode 100644
index aec653fc7..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$1.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$1.class
deleted file mode 100644
index b577a8bf9..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$1.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$2.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$2.class
deleted file mode 100644
index 524155c11..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$2.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$3.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$3.class
deleted file mode 100644
index c15a16c13..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM$3.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.class
deleted file mode 100644
index 1dcb914b3..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$1.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$1.class
deleted file mode 100644
index 0565543d1..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$1.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$2.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$2.class
deleted file mode 100644
index 477da27ea..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$2.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$3.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$3.class
deleted file mode 100644
index 6140d18ac..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$3.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$4.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$4.class
deleted file mode 100644
index 5f5352f7f..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$4.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$5.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$5.class
deleted file mode 100644
index a7a8c75da..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM$5.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.class
deleted file mode 100644
index fe327bccc..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM$1.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM$1.class
deleted file mode 100644
index 7061f55ff..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM$1.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.class b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.class
deleted file mode 100644
index 6c03aaa30..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.class
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties
new file mode 100644
index 000000000..d8e2f0e92
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/build.properties
@@ -0,0 +1,5 @@
+source.. = src/,\
+ xtend-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/models/code_inheritance.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/CodeInheritanceExample.room
index eb4226526..e117cc638 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/models/code_inheritance.room
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/CodeInheritanceExample.room
@@ -1,10 +1,6 @@
-RoomModel code_inheritance {
+RoomModel TemplateModel {
- SubSystemClass Main {
- ActorRef appl: Deriv
- }
-
- ActorClass Deriv extends Base {
+ ActorClass TestActor extends Base {
Structure { }
Behavior {
StateMachine {
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room
new file mode 100644
index 000000000..340c2a2fc
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatFSMExample.room
@@ -0,0 +1,52 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1
+ State state2
+ State state3
+ TransitionPoint tr4
+ ChoicePoint cp0
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: state1 -> cp cp0 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr2: cp cp0 -> state3
+ Transition tr3: cp cp0 -> state2 {
+ cond {
+ "true"
+ }
+ }
+ Transition tr5: my tr4 -> state0 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room
new file mode 100644
index 000000000..81fca1eaf
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/FlatInheritedFSMExample.room
@@ -0,0 +1,73 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor extends Base {
+ Behavior {
+ StateMachine {
+ State state3
+ RefinedState state1 {
+ entry {
+ "//refined"
+ }
+ }
+ Transition tr2: state1 -> state3 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ RefinedTransition tr0 {
+ action {
+ "//refined"
+ }
+ }
+ State state4
+ State state5
+ Transition tr3: state3 -> state4 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr4: state3 -> state5 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass Base {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1
+ State state2
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: state1 -> state2 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room
new file mode 100644
index 000000000..93b631180
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMExample.room
@@ -0,0 +1,58 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state1 {
+ subgraph {
+ State state1_0
+ State state1_1
+ ExitPoint tr1
+ EntryPoint tr3
+ Transition init0: initial -> state1_0
+ Transition tr0: state1_0 -> state1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr2: state1_1 -> my tr1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr4: my tr3 -> state1_1
+ }
+ }
+ State state2
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: tr1 of state1 -> state2
+ Transition tr2: state2 -> tr3 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room
new file mode 100644
index 000000000..8c4da3559
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierInheritedFSMExample.room
@@ -0,0 +1,122 @@
+RoomModel TemplateModel {
+
+
+ abstract ActorClass Base {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0
+ State state2
+ State state1 {
+ subgraph {
+ EntryPoint tr0
+ ExitPoint tr1
+ Transition init0: initial -> state1_0
+ State state1_0
+ State state1_1
+ Transition tr2: state1_0 -> state1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ Transition init0: initial -> state0
+ Transition tr0: state0 -> tr0 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr1: tr1 of state1 -> state2
+ Transition tr2: state2 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass TestActor extends Base {
+ Behavior {
+ StateMachine {
+ RefinedState state1 {
+ subgraph {
+ State state1_2
+ Transition tr4: my tr0 -> state1_2
+ Transition tr5: state1_2 -> my tr1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition tr6: state1_2 -> state1_0 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ RefinedState state1_1 {
+ subgraph {
+ State state1_1_0
+ State state1_1_1
+ Transition tr1: initial -> state1_1_0
+ Transition tr2: state1_1_0 -> state1_1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+ }
+ RefinedState state0 {
+ subgraph {
+ State state0_0
+ Transition tr1: initial -> state0_0
+ }
+ }
+ State state3
+ Transition tr3: state0 -> state3 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ Transition tr4: state3 -> tr0 of state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass TestActor2 extends TestActor {
+ Behavior {
+ StateMachine {
+ RefinedState state0 {
+ entry {
+ ""
+ }
+ }
+ RefinedTransition tr3 {
+ action {
+ ""
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/models/cpmult.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/MultipleConnectedChoicepointExample.room
index ffbc47c24..ddaeabc48 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/models/cpmult.room
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/MultipleConnectedChoicepointExample.room
@@ -1,11 +1,8 @@
-RoomModel cpmult {
- import room.basic.types.* from "../../org.eclipse.etrice.modellib.java/models/Types.room"
+RoomModel TemplateModel {
- SubSystemClass Main {
- ActorRef appl: CPMult
- }
+ import room.basic.types.* from "Types.room"
- ActorClass CPMult {
+ ActorClass TestActor {
Interface {
Port p0: PC
}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/models/states_inheritance.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesInheritanceExample.room
index 5d9a4d00b..354489aa8 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/models/states_inheritance.room
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesInheritanceExample.room
@@ -64,22 +64,7 @@ RoomModel states_inheritance.t {
}
}
- 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 {
+ ActorClass ABase {
Interface {
Port fct : PTest1
}
@@ -182,7 +167,7 @@ RoomModel states_inheritance.t {
}
}
- ActorClass ADerived extends ATest {
+ ActorClass TestActor extends ABase {
Interface {
Port port : PTest3
}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/models/states_triggers.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesTriggersExample.room
index 9d61c910c..46ee6dede 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/models/states_triggers.room
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/StatesTriggersExample.room
@@ -1,6 +1,6 @@
-RoomModel states_trigers {
+RoomModel TemplateModel {
- PrimitiveType int32: ptInteger -> int32 (Integer) default "0"
+ PrimitiveType int32: ptInteger -> "int32" (Integer) default "0"
ProtocolClass PTimer {
incoming {
@@ -55,22 +55,7 @@ RoomModel states_trigers {
}
}
- 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 {
+ ActorClass TestActor {
Interface {
Port fct : PTest1
}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/TriggerExample.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/TriggerExample.room
new file mode 100644
index 000000000..bd6c646b6
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/TriggerExample.room
@@ -0,0 +1,87 @@
+RoomModel TemplateModel {
+
+ ActorClass TestActor {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ State state0 {
+ subgraph {
+ State state0_0
+ State state0_1
+ Transition init0: initial -> state0_0
+ Transition in3: state0_0 -> state0_1 {
+ triggers {
+ <in3: p0>
+ }
+ }
+ Transition in2: state0_1 -> state0_0 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ }
+ }
+ State state1 {
+ subgraph {
+ State state1_0
+ State state1_1
+ Transition init0: initial -> state1_0
+ Transition in1: state1_0 -> state1_1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition in1wGuard: state1_1 -> state1_0 {
+ triggers {
+ <in1: p0 guard {
+ "condA"
+ }>
+ }
+ }
+ }
+ }
+ State state2
+ TransitionPoint tr2
+ Transition init0: initial -> state0
+ Transition in1: state0 -> state1 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ Transition in1withGuard: state1 -> state2 {
+ triggers {
+ <in1: p0 guard {
+ "condA"
+ }>
+ }
+ }
+ Transition in2: my tr2 -> my tr2 {
+ triggers {
+ <in2: p0>
+ }
+ }
+ Transition in1WoGuard: state1 -> state2 {
+ triggers {
+ <in1: p0>
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message in1()
+ Message in2()
+ Message in3()
+ Message in4()
+ }
+ outgoing { }
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/Types.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/Types.room
new file mode 100644
index 000000000..b27d100f4
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/Types.room
@@ -0,0 +1,13 @@
+RoomModel room.basic.types {
+
+ PrimitiveType boolean: ptBoolean -> 'boolean' (Boolean) default 'false'
+ PrimitiveType char: ptCharacter -> 'char' (Char) default ''
+ PrimitiveType int8: ptInteger -> 'byte' (Byte) default '0'
+ PrimitiveType int16: ptInteger -> 'short' (Short) default '0'
+ PrimitiveType int32: ptInteger -> 'int' (Integer) default '0'
+ PrimitiveType int64: ptInteger -> 'long' (Long) default '0'
+ PrimitiveType float32: ptReal -> 'float' (Float) default '0'
+ PrimitiveType float64: ptReal -> 'double' (Double) default '0'
+ PrimitiveType string: ptCharacter -> 'String' (String) default ''
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch
new file mode 100644
index 000000000..3c8ac48e9
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/org.eclipse.etrice.core.genmodel.fsm.tests.launch
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="true"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.core.genmodel.fsm.tests"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.etrice.core.genmodel.fsm.tests"/>
+<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"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<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.core.genmodel.fsm.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.8 -Xms40m -Xmx512m -ea"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.epp.package.dsl.product"/>
+<booleanAttribute key="run_in_ui_thread" value="false"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="false"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/.gitignore b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/.gitignore
new file mode 100644
index 000000000..ccd488a3d
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/output/.gitignore
@@ -0,0 +1 @@
+*.fsmgen
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java
new file mode 100644
index 000000000..c947ef93f
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FSMGenModelTestsActivator.java
@@ -0,0 +1,37 @@
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.etrice.core.RoomStandaloneSetup;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
+public class FSMGenModelTestsActivator extends Plugin implements BundleActivator {
+
+ private static FSMGenModelTestsActivator instance = null;
+
+ @Inject
+ private Diagnostician diagnostician;
+
+ public static FSMGenModelTestsActivator getInstance() {
+ return instance;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ instance = this;
+
+ Injector injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
+ injector.injectMembers(this);
+ }
+
+ public Diagnostician getDiagnostician() {
+ return diagnostician;
+ }
+
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend
index 57de115da..e6cf80196 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.xtend
@@ -12,33 +12,37 @@
package org.eclipse.etrice.core.genmodel.fsm.tests
+import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
import org.eclipse.etrice.core.RoomStandaloneSetup
import org.eclipse.etrice.core.TestBase
-import org.eclipse.etrice.core.genmodel.fsm.FsmGenBuilder
+import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
+import org.eclipse.etrice.core.genmodel.fsm.NullDiagnostician
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
import org.eclipse.etrice.core.room.ActorClass
import org.eclipse.etrice.core.room.RoomModel
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
-import org.eclipse.emf.common.util.URI
class FsmGenTestBase extends TestBase {
protected Resource res = null
protected ActorClass actor
+ protected IDiagnostician diagnostician = new NullDiagnostician
+ protected extension ExtendedFsmGenBuilder builder
protected def getGraphContainer(String roomFile, String actorName) {
prepare(FSMGenModelTestsActivator.getInstance().getBundle())
res = getResource(roomFile)
actor = (res.contents.get(0) as RoomModel).actorClasses.findFirst[name.equals(actorName)]
val injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration()
- val FsmGenBuilder builder = new FsmGenBuilder(injector)
+ builder = new ExtendedFsmGenBuilder(injector, diagnostician)
builder.createTransformedModel(actor)
}
protected def save(GraphContainer gc, String fileName) {
val rs = new ResourceSetImpl
- val uri = URI.createFileURI("./output/" + fileName + ".fsmgen2")
+ val uri = URI.createFileURI("./output/" + fileName + ".fsmgen")
val res = rs.createResource(uri)
res.contents.add(gc)
res.save(newHashMap)
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.xtend
new file mode 100644
index 000000000..ace7fa309
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.xtend
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.RefinedState
+import org.eclipse.etrice.core.fsm.util.FSMHelpers
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertNull
+import static org.junit.Assert.assertTrue
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestCodeInheritance extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ extension FSMHelpers fsmHelpers = new FSMHelpers
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("CodeInheritanceExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+ assertFalse("diagnostician has no errors", diagnostician.isFailed)
+ }
+
+ @Test
+ def void testActionCodes_BaseEntryExit() {
+ val s = gc.graph.allStateNodes.findFirst[name.equals("BaseEntryExit")]
+ assertNotNull("state found", s)
+ assertTrue("refined state", s.stateGraphNode instanceof RefinedState)
+ val rs = s.stateGraphNode as RefinedState
+ assertEquals("entry code", "// derived entry\n", rs.entryCode.detailCode)
+ assertNull("exit code", rs.exitCode)
+ assertEquals("inherited entry", "// base entry\n", rs.inheritedEntryCode.detailCode)
+ assertEquals("inherited exit", "// base exit\n", rs.inheritedExitCode.detailCode)
+ }
+
+ @Test
+ def void testActionCodes_Base() {
+ val s = gc.graph.allStateNodes.findFirst[name.equals("Base")]
+ assertNotNull("state found", s)
+ assertTrue("refined state", s.stateGraphNode instanceof RefinedState)
+ val rs = s.stateGraphNode as RefinedState
+ assertNull("entry code", rs.entryCode)
+ assertEquals("exit code", "// derived exit\n", rs.exitCode.detailCode)
+ assertEquals("inherited entry", "", rs.inheritedEntryCode.detailCode)
+ assertEquals("inherited exit", "", rs.inheritedExitCode.detailCode)
+ }
+
+ @Test
+ def void testActionCodes_BaseSub() {
+ val s = gc.graph.allStateNodes.findFirst[name.equals("BaseSub")]
+ assertNotNull("state found", s)
+ assertTrue("refined state", s.stateGraphNode instanceof RefinedState)
+ val rs = s.stateGraphNode as RefinedState
+ assertEquals("entry code", "// derived entry\n", rs.entryCode.detailCode)
+ assertNull("exit code", rs.exitCode)
+ assertEquals("inherited entry", "", rs.inheritedEntryCode.detailCode)
+ assertEquals("inherited exit", "", rs.inheritedExitCode.detailCode)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend
index 977a8b0ea..977a8b0ea 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.xtend
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend
index fadf00a4d..fadf00a4d 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.xtend
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend
index db3793243..db3793243 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.xtend
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
index 0392ef48c..bb12a3ab7 100644
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/bin/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.xtend
@@ -12,6 +12,7 @@
package org.eclipse.etrice.core.genmodel.fsm.tests
+import org.eclipse.emf.ecore.util.EcoreUtil
import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
import org.eclipse.etrice.core.genmodel.fsm.NullLogger
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
@@ -27,17 +28,21 @@ import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
class TestHierInheritedFSM extends FsmGenTestBase {
GraphContainer gc
+ GraphContainer gc2
@Before
def void SetUp() {
gc = getGraphContainer("HierInheritedFSMExample.room", "TestActor")
+ gc2 = getGraphContainer("HierInheritedFSMExample.room", "TestActor2")
assertNotNull("graph context was created", gc)
+ assertNotNull("graph context was created", gc2)
val logger = new NullLogger
FsmGenChecker.check(gc, logger)
assertFalse("logger has no errors", logger.hasErrors)
save(gc, "HierInheritedFSMExample")
+ save(gc2, "HierInheritedFSMExample2")
}
@Test
@@ -66,4 +71,16 @@ class TestHierInheritedFSM extends FsmGenTestBase {
assertEquals("incoming links", 2, s.incoming.size)
assertEquals("outgoing links", 1, s.outgoing.size)
}
+
+ @Test
+ def void testOriginRefs() {
+ gc2.graph.nodes.filter[stateGraphNode.name == 'state0'] => [
+ assertEquals(1, size)
+ assertEquals('RefinedState:TestActor2$state0', EcoreUtil.getURI(head.stateGraphNode).fragment)
+ ]
+ gc2.graph.links.filter[transition.name == 'tr3'] => [
+ assertEquals(1, size)
+ assertEquals('RefinedTransition:TestActor2$tr3', EcoreUtil.getURI(head.transition).fragment)
+ ]
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.xtend
new file mode 100644
index 000000000..613854ace
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.xtend
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.CPBranchTransition
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition
+import org.eclipse.etrice.core.fsm.fSM.Transition
+import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.eclipse.etrice.core.room.DataClass
+import org.eclipse.etrice.core.room.VarDecl
+import org.junit.Before
+import org.junit.Test
+
+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 static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestMultipleConnectedChoicepoint extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("MultipleConnectedChoicepointExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+
+ // enrich our generator model with all we have
+ gc.withTriggersInStates.withChainHeads.withCommonData
+
+ assertFalse("diagnostician has no errors", diagnostician.isFailed)
+ }
+
+ @Test
+ def void testObjectNumbers() {
+ assertEquals("Number of states", 6, gc.graph.allStateNodes.size)
+ assertEquals("Number of choice points", 1, gc.graph.allChoicePointNodes.size)
+ assertEquals("Number of transition points", 0, gc.graph.allTransitionPointNodes.size)
+ assertEquals("Number of entry points", 1, gc.graph.allEntryPointNodes.size)
+ assertEquals("Number of exit points", 1, gc.graph.allExitPointNodes.size)
+ assertEquals("Number of initial transitions", 1, gc.graph.allInitialTranisitionLinks.size)
+ assertEquals("Number of triggered transitions", 5, gc.graph.allTriggeredTranisitionLinks.size)
+ assertEquals("Number of continuation transitions", 3, gc.graph.allContinuationTranisitionLinks.size)
+ assertEquals("Number of cpbranch transitions", 1, gc.graph.allCPBranchTranisitionLinks.size)
+ }
+
+ @Test
+ def void testChainsAndTriggers() {
+ assertEquals("transition chains", 6, gc.graph.getAllChainHeads.size)
+ }
+
+ @Test
+ def void testData() {
+ var tr = gc.graph.links.filter[(transition as Transition).name.equals("tr0")].head
+ assertNotNull("transition found", tr)
+ assertTrue("transition is TriggeredTransition", tr.transition instanceof TriggeredTransition)
+ var data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC2", data.refType.type.name)
+
+ val s = gc.graph.nodes.filter[stateGraphNode.name.equals("state1")].head
+ assertNotNull("state found", s)
+
+ tr = s.subgraph.links.filter[(transition as Transition).name.equals("tr2")].head
+ assertTrue("transition is TriggeredTransition", tr.transition instanceof TriggeredTransition)
+ data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC2", data.refType.type.name)
+
+ tr = s.subgraph.links.filter[(transition as Transition).name.equals("tr3")].head
+ assertTrue("transition is TriggeredTransition", tr.transition instanceof TriggeredTransition)
+ data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC4", data.refType.type.name)
+
+ tr = gc.graph.links.filter[(transition as Transition).name.equals("tr1")].head
+ assertNotNull("transition found", tr)
+ assertTrue("transition is TriggeredTransition", tr.transition instanceof TriggeredTransition)
+ data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC3", data.refType.type.name)
+
+ tr = gc.graph.links.filter[(transition as Transition).name.equals("tr3")].head
+ assertNotNull("transition found", tr)
+ assertTrue("transition is ContinuationTransition", tr.transition instanceof ContinuationTransition)
+ data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC", data.refType.type.name)
+
+ tr = gc.graph.links.filter[(transition as Transition).name.equals("tr4")].head
+ assertNotNull("transition found", tr)
+ assertTrue("transition is CPBranchTransition", tr.transition instanceof CPBranchTransition)
+ data = tr.commonData as VarDecl
+ assertTrue("data is DataClass", data.refType.type instanceof DataClass)
+ assertEquals("data is of type", "DC", data.refType.type.name)
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.xtend
new file mode 100644
index 000000000..08a01feb0
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.xtend
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.eclipse.etrice.core.naming.RoomNameProvider
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+import org.eclipse.etrice.core.fsm.fSM.Transition
+import org.eclipse.etrice.core.fsm.fSM.SimpleState
+
+class TestStatesInheritance extends FsmGenTestBase {
+
+ RoomNameProvider roomNameProvider = new RoomNameProvider
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("StatesInheritanceExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+
+ // enrich our generator model with all we have
+ gc.withTriggersInStates.withChainHeads.withCommonData
+
+ assertFalse("diagnostician has no errors", diagnostician.isFailed)
+ }
+
+ @Test
+ def void testNoTrigger() {
+ val s = gc.graph.allStateNodes.filter[name.equals("State3")].head
+ assertNotNull("state found", s)
+
+ assertEquals("non-leave state has no caught triggers", 0, s.caughtTriggers.size)
+ }
+
+ @Test
+ def void testObjectNumbers() {
+ assertEquals("Number of states", 11, gc.graph.allStateNodes.size)
+ assertEquals("Number of states", 9, gc.graph.allStateNodes.filter[stateGraphNode instanceof SimpleState].size)
+ assertEquals("Number of choice points", 1, gc.graph.allChoicePointNodes.size)
+ assertEquals("Number of transition points", 5, gc.graph.allTransitionPointNodes.size)
+ assertEquals("Number of entry points", 2, gc.graph.allEntryPointNodes.size)
+ assertEquals("Number of exit points", 1, gc.graph.allExitPointNodes.size)
+ assertEquals("Number of initial transitions", 3, gc.graph.allInitialTranisitionLinks.size)
+ assertEquals("Number of triggered transitions", 17, gc.graph.allTriggeredTranisitionLinks.size)
+ assertEquals("Number of continuation transitions", 4, gc.graph.allContinuationTranisitionLinks.size)
+ assertEquals("Number of cpbranch transitions", 3, gc.graph.allCPBranchTranisitionLinks.size)
+ }
+
+ @Test
+ def void testChainsAndTriggers() {
+ assertEquals("transition chains", 20, gc.graph.getAllChainHeads.size)
+ }
+
+ @Test
+ def void testGraph() {
+ var s = gc.graph.allStateNodes.filter[roomNameProvider.getFullPath(stateGraphNode).equals("State3_State3")].head
+ assertNotNull("state exists", s)
+ assertEquals("number of incoming transitions", 3, s.incoming.size)
+ assertEquals("number of outgoing transitions", 2, s.outgoing.size)
+ assertEquals("active triggers", 6, s.caughtTriggers.size)
+
+ s = gc.graph.allStateNodes.filter[roomNameProvider.getFullPath(stateGraphNode).equals("State2")].head
+ assertNotNull("state exists", s)
+ assertEquals("number of incoming transitions", 4, s.incoming.size)
+ assertEquals("number of outgoing transitions", 1, s.outgoing.size)
+ assertEquals("active triggers", 3, s.caughtTriggers.size)
+
+ val cp = gc.graph.allChoicePointNodes.filter[stateGraphNode.name.equals("CP1")].head
+ assertNotNull("cp exists", cp)
+ assertEquals("number of incoming transitions", 1, cp.incoming.size)
+ assertEquals("number of outgoing transitions", 4, cp.outgoing.size)
+
+ val cts = cp.outgoing.filter[transition instanceof ContinuationTransition]
+ assertEquals("Exactly one continuation (=default) transition", 1, cts.size)
+ }
+
+ @Test
+ def void testChains() {
+ var tr = gc.graph.allLinks.filter[roomNameProvider.getFullPath((transition as Transition)).equals("State3_TRANS_tr1_FROM_tp1_TO_State3")].head
+ assertNotNull("transition", tr)
+
+ assertEquals("one chain head", 1, tr.chainHeads.size)
+ assertEquals("chain name", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", roomNameProvider.getFullPath(tr.chainHeads.head.transition as Transition))
+
+ tr = gc.graph.allLinks.filter[roomNameProvider.getFullPath((transition as Transition)).equals("State3_TRANS_tr8_FROM_tp6_TO_State2")].head
+ assertNotNull("transition", tr)
+
+ assertEquals("one chain head", 1, tr.chainHeads.size)
+ assertEquals("chain name", "TRANS_tr12_FROM_State5_TO_State3_tp6_BY_aport", roomNameProvider.getFullPath(tr.chainHeads.head.transition as Transition))
+
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.xtend
new file mode 100644
index 000000000..7a1c204be
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.xtend
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.eclipse.etrice.core.naming.RoomNameProvider
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+import org.eclipse.etrice.core.fsm.fSM.Transition
+
+class TestStatesTriggers extends FsmGenTestBase {
+
+ RoomNameProvider roomNameProvider = new RoomNameProvider
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("StatesTriggersExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+
+ // enrich our generator model with all we have
+ gc.withTriggersInStates.withChainHeads.withCommonData
+
+ assertFalse("diagnostician has no errors", diagnostician.isFailed)
+ }
+
+ @Test
+ def void testNoTrigger() {
+ val s = gc.graph.allStateNodes.filter[name.equals("State3")].head
+ assertNotNull("state found", s)
+
+ assertEquals("non-leave state has no caught triggers", 0, s.caughtTriggers.size)
+ }
+
+ @Test
+ def void testObjectNumbers() {
+ assertEquals("Number of states", 7, gc.graph.allStateNodes.size)
+ assertEquals("Number of choice points", 1, gc.graph.allChoicePointNodes.size)
+ assertEquals("Number of transition points", 4, gc.graph.allTransitionPointNodes.size)
+ assertEquals("Number of entry points", 1, gc.graph.allEntryPointNodes.size)
+ assertEquals("Number of exit points", 1, gc.graph.allExitPointNodes.size)
+ assertEquals("Number of initial transitions", 2, gc.graph.allInitialTranisitionLinks.size)
+ assertEquals("Number of triggered transitions", 11, gc.graph.allTriggeredTranisitionLinks.size)
+ assertEquals("Number of continuation transitions", 3, gc.graph.allContinuationTranisitionLinks.size)
+ assertEquals("Number of cpbranch transitions", 2, gc.graph.allCPBranchTranisitionLinks.size)
+ }
+
+ @Test
+ def void testChainsAndTriggers() {
+ assertEquals("transition chains", 13, gc.graph.getAllChainHeads.size)
+ }
+
+ @Test
+ def void testGraph() {
+ var s = gc.graph.nodes.filter[name.equals("State3")].head
+ s = s.subgraph.nodes.filter[name.equals("State3")].head
+ assertNotNull("state found", s)
+ assertEquals("number of incoming transitions", 3, s.incoming.size);
+ assertEquals("number of outgoing transitions", 2, s.outgoing.size);
+ assertEquals("active triggers", 6, s.caughtTriggers.size);
+
+ s = gc.graph.nodes.filter[name.equals("State2")].head
+ assertNotNull("state found", s)
+ assertEquals("number of incoming transitions", 4, s.incoming.size);
+ assertEquals("number of outgoing transitions", 1, s.outgoing.size);
+ assertEquals("active triggers", 3, s.caughtTriggers.size);
+
+ val cp = gc.graph.nodes.filter[name.equals("CP1")].head
+ assertNotNull("cp found", cp)
+ assertEquals("number of incoming transitions", 1, cp.incoming.size);
+ assertEquals("number of outgoing transitions", 3, cp.outgoing.size);
+
+ val cts = cp.outgoing.filter[transition instanceof ContinuationTransition]
+ assertEquals("Exactly one continuation (=default) transition", 1, cts.size)
+ }
+
+ @Test
+ def void testChains() {
+ val tr = gc.graph.allLinks.filter[roomNameProvider.getFullPath((transition as Transition)).equals("State3_TRANS_tr1_FROM_tp1_TO_State3")].head
+ assertNotNull("transition found", tr)
+ assertEquals("one chain head", 1, tr.chainHeads.size)
+ assertEquals("correct chain head", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", roomNameProvider.getFullPath((tr.chainHeads.head.transition as Transition)))
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.xtend
new file mode 100644
index 000000000..13831a137
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.xtend
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.genmodel.fsm.tests
+
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.TriggerExtensions
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.junit.Before
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+
+import static extension org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions.*
+
+class TestTrigger extends FsmGenTestBase {
+
+ GraphContainer gc
+
+ @Before
+ def void SetUp() {
+ gc = getGraphContainer("TriggerExample.room", "TestActor")
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+
+ gc.withTriggersInStates
+ assertFalse("diagnostician has no errors", diagnostician.isFailed)
+ val s = gc.graph.allStateNodes.filter[name.equals("state0_0")].head
+ assertEquals("leave state triggers", 3, s.caughtTriggers.size)
+ }
+
+ @Test
+ def void testNoTrigger() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state0")].head
+ assertNotNull("state found", s)
+
+ assertEquals("non-leave state has no caught triggers", 0, s.caughtTriggers.size)
+ }
+
+ @Test
+ def void testTrigger_state0_0() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state0_0")].head
+ assertNotNull("state found", s)
+
+ assertEquals("leave state triggers", 3, s.caughtTriggers.size)
+
+ assertEquals("1st trigger", "in3".trigger , s.caughtTriggers.get(0).trigger)
+ assertEquals("1st trigger, transitions", 1, s.caughtTriggers.get(0).links.size)
+ assertEquals("2nd trigger", "in1".trigger , s.caughtTriggers.get(1).trigger)
+ assertEquals("2nd trigger, transitions", 1, s.caughtTriggers.get(1).links.size)
+ assertEquals("3rd trigger", "in2".trigger , s.caughtTriggers.get(2).trigger)
+ assertEquals("3rd trigger, transitions", 1, s.caughtTriggers.get(2).links.size)
+ }
+
+ @Test
+ def void testTrigger_state0_1() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state0_1")].head
+ assertNotNull("state found", s)
+
+ assertEquals("leave state triggers", 2, s.caughtTriggers.size)
+
+ assertEquals("1st trigger", "in2".trigger , s.caughtTriggers.get(0).trigger)
+ assertEquals("1st trigger, transitions", 1, s.caughtTriggers.get(0).links.size)
+ assertEquals("2nd trigger", "in1".trigger , s.caughtTriggers.get(1).trigger)
+ assertEquals("2nd trigger, transitions", 1, s.caughtTriggers.get(1).links.size)
+ }
+
+ @Test
+ def void testTrigger_state1_0() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state1_0")].head
+ assertNotNull("state found", s)
+
+ assertEquals("leave state triggers", 2, s.caughtTriggers.size)
+
+ assertEquals("1st trigger", "in1".trigger , s.caughtTriggers.get(0).trigger)
+ // note: the transition in the sub graph is unguarded and hides the top level one
+ assertEquals("1st trigger, transitions", 1, s.caughtTriggers.get(0).links.size)
+ assertEquals("2nd trigger", "in2".trigger , s.caughtTriggers.get(1).trigger)
+ assertEquals("2nd trigger, transitions", 1, s.caughtTriggers.get(1).links.size)
+ }
+
+ @Test
+ def void testTrigger_state1_1() {
+ val s = gc.graph.allStateNodes.filter[name.equals("state1_1")].head
+ assertNotNull("state found", s)
+
+ assertEquals("leave state triggers", 2, s.caughtTriggers.size)
+
+ assertEquals("1st trigger", "in1".trigger , s.caughtTriggers.get(0).trigger)
+ // note: the transition in the sub graph is guarded and two top level ones are also added
+ assertEquals("1st trigger, transitions", 3, s.caughtTriggers.get(0).links.size)
+ assertEquals("2nd trigger", "in2".trigger , s.caughtTriggers.get(1).trigger)
+ assertEquals("2nd trigger, transitions", 1, s.caughtTriggers.get(1).links.size)
+ }
+
+ def trigger(String msg) {
+ "p0" + TriggerExtensions.TRIGGER_SEP + msg
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java
new file mode 100644
index 000000000..0198fb95c
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2011 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:
+ * hrr@protos.de (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import com.google.inject.Injector;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.etrice.core.RoomStandaloneSetup;
+import org.eclipse.etrice.core.TestBase;
+import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder;
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.NullDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FSMGenModelTestsActivator;
+import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+
+@SuppressWarnings("all")
+public class FsmGenTestBase extends TestBase {
+ protected Resource res = null;
+
+ protected ActorClass actor;
+
+ protected IDiagnostician diagnostician = new NullDiagnostician();
+
+ @Extension
+ protected ExtendedFsmGenBuilder builder;
+
+ protected GraphContainer getGraphContainer(final String roomFile, final String actorName) {
+ GraphContainer _xblockexpression = null;
+ {
+ this.prepare(FSMGenModelTestsActivator.getInstance().getBundle());
+ this.res = this.getResource(roomFile);
+ EObject _get = this.res.getContents().get(0);
+ final Function1<ActorClass, Boolean> _function = new Function1<ActorClass, Boolean>() {
+ @Override
+ public Boolean apply(final ActorClass it) {
+ return Boolean.valueOf(it.getName().equals(actorName));
+ }
+ };
+ this.actor = IterableExtensions.<ActorClass>findFirst(((RoomModel) _get).getActorClasses(), _function);
+ final Injector injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
+ ExtendedFsmGenBuilder _extendedFsmGenBuilder = new ExtendedFsmGenBuilder(injector, this.diagnostician);
+ this.builder = _extendedFsmGenBuilder;
+ _xblockexpression = this.builder.createTransformedModel(this.actor);
+ }
+ return _xblockexpression;
+ }
+
+ protected void save(final GraphContainer gc, final String fileName) {
+ try {
+ final ResourceSetImpl rs = new ResourceSetImpl();
+ final URI uri = URI.createFileURI((("./output/" + fileName) + ".fsmgen"));
+ final Resource res = rs.createResource(uri);
+ res.getContents().add(gc);
+ res.save(CollectionLiterals.<Object, Object>newHashMap());
+ } catch (Throwable _e) {
+ throw Exceptions.sneakyThrow(_e);
+ }
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.java
new file mode 100644
index 000000000..c1ffb81b2
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.RefinedState;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.util.FSMHelpers;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestCodeInheritance extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Extension
+ private FSMHelpers fsmHelpers = new FSMHelpers();
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("CodeInheritanceExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ Assert.assertFalse("diagnostician has no errors", this.diagnostician.isFailed());
+ }
+
+ @Test
+ public void testActionCodes_BaseEntryExit() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("BaseEntryExit"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>findFirst(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = s.getStateGraphNode();
+ Assert.assertTrue("refined state", (_stateGraphNode instanceof RefinedState));
+ StateGraphNode _stateGraphNode_1 = s.getStateGraphNode();
+ final RefinedState rs = ((RefinedState) _stateGraphNode_1);
+ Assert.assertEquals("entry code", "// derived entry\n", this.fsmHelpers.getDetailCode(rs.getEntryCode()));
+ Assert.assertNull("exit code", rs.getExitCode());
+ Assert.assertEquals("inherited entry", "// base entry\n", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedEntryCode(rs)));
+ Assert.assertEquals("inherited exit", "// base exit\n", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedExitCode(rs)));
+ }
+
+ @Test
+ public void testActionCodes_Base() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("Base"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>findFirst(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = s.getStateGraphNode();
+ Assert.assertTrue("refined state", (_stateGraphNode instanceof RefinedState));
+ StateGraphNode _stateGraphNode_1 = s.getStateGraphNode();
+ final RefinedState rs = ((RefinedState) _stateGraphNode_1);
+ Assert.assertNull("entry code", rs.getEntryCode());
+ Assert.assertEquals("exit code", "// derived exit\n", this.fsmHelpers.getDetailCode(rs.getExitCode()));
+ Assert.assertEquals("inherited entry", "", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedEntryCode(rs)));
+ Assert.assertEquals("inherited exit", "", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedExitCode(rs)));
+ }
+
+ @Test
+ public void testActionCodes_BaseSub() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("BaseSub"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>findFirst(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = s.getStateGraphNode();
+ Assert.assertTrue("refined state", (_stateGraphNode instanceof RefinedState));
+ StateGraphNode _stateGraphNode_1 = s.getStateGraphNode();
+ final RefinedState rs = ((RefinedState) _stateGraphNode_1);
+ Assert.assertEquals("entry code", "// derived entry\n", this.fsmHelpers.getDetailCode(rs.getEntryCode()));
+ Assert.assertNull("exit code", rs.getExitCode());
+ Assert.assertEquals("inherited entry", "", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedEntryCode(rs)));
+ Assert.assertEquals("inherited exit", "", this.fsmHelpers.getDetailCode(this.fsmHelpers.getInheritedExitCode(rs)));
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java
new file mode 100644
index 000000000..fc6734787
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.TrPoint;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestFlatFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("FlatFSMExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ }
+
+ @Test
+ public void testFlatFSMItemCounts() {
+ Assert.assertEquals("number of nodes", 6, this.gc.getGraph().getNodes().size());
+ Assert.assertEquals("number of links", 6, this.gc.getGraph().getLinks().size());
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof State));
+ }
+ };
+ Assert.assertEquals("number of states", 4, IterableExtensions.size(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function)));
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof TrPoint));
+ }
+ };
+ Assert.assertEquals("number of tr points", 1, IterableExtensions.size(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function_1)));
+ final Function1<Node, Boolean> _function_2 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof ChoicePoint));
+ }
+ };
+ Assert.assertEquals("number of choice points", 1, IterableExtensions.size(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function_2)));
+ }
+
+ @Test
+ public void testFlatFSMState1Connections() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1"));
+ }
+ };
+ final Node s1 = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s1);
+ Assert.assertEquals("incoming links", 1, s1.getIncoming().size());
+ Assert.assertEquals("outgoing links", 1, s1.getOutgoing().size());
+ }
+
+ @Test
+ public void testFlatFSMState3Connections() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state3"));
+ }
+ };
+ final Node s3 = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s3);
+ Assert.assertEquals("incoming links", 1, s3.getIncoming().size());
+ Assert.assertEquals("outgoing links", 0, s3.getOutgoing().size());
+ }
+
+ @Test
+ public void testFlatFSMCPConnections() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("cp0"));
+ }
+ };
+ final Node cp = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getChoicePointNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("choice point found", cp);
+ Assert.assertEquals("incoming links", 1, cp.getIncoming().size());
+ Assert.assertEquals("outgoing links", 2, cp.getOutgoing().size());
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java
new file mode 100644
index 000000000..8fbd53473
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.RefinedState;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestFlatInheritedFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("FlatInheritedFSMExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ }
+
+ @Test
+ public void testFlatInheritedFSMItemCounts() {
+ Assert.assertEquals("number of nodes", 6, this.gc.getGraph().getNodes().size());
+ Assert.assertEquals("number of links", 6, this.gc.getGraph().getLinks().size());
+ Assert.assertEquals("number of states", 6, IterableExtensions.size(FsmGenExtensions.getStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of tr points", 0, IterableExtensions.size(FsmGenExtensions.getTrPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of choice points", 0, IterableExtensions.size(FsmGenExtensions.getChoicePointNodes(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testFlatInheritedFSMState0Connections() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state0"));
+ }
+ };
+ final Node s = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("incoming links", 1, s.getIncoming().size());
+ Assert.assertEquals("outgoing links", 1, s.getOutgoing().size());
+ }
+
+ @Test
+ public void testHierFSMPointersIntoOriginalFSM() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1"));
+ }
+ };
+ final Node n = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function));
+ final Function1<State, Boolean> _function_1 = new Function1<State, Boolean>() {
+ @Override
+ public Boolean apply(final State it) {
+ return Boolean.valueOf(it.getName().equals("state1"));
+ }
+ };
+ final State s = IterableExtensions.<State>head(IterableExtensions.<State>filter(this.actor.getStateMachine().getStates(), _function_1));
+ Assert.assertNotNull("node found", n);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = n.getStateGraphNode();
+ Assert.assertTrue("RefinedState expected", (_stateGraphNode instanceof RefinedState));
+ Assert.assertEquals("correct target", s, n.getStateGraphNode());
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java
new file mode 100644
index 000000000..64b14a66c
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.SimpleState;
+import org.eclipse.etrice.core.fsm.fSM.State;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestHierFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("HierFSMExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ }
+
+ @Test
+ public void testHierFSMItemCounts() {
+ Assert.assertEquals("number of nodes", 3, this.gc.getGraph().getNodes().size());
+ Assert.assertEquals("number of links", 4, this.gc.getGraph().getLinks().size());
+ Assert.assertEquals("number of states", 3, IterableExtensions.size(FsmGenExtensions.getStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of tr points", 0, IterableExtensions.size(FsmGenExtensions.getTrPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of choice points", 0, IterableExtensions.size(FsmGenExtensions.getChoicePointNodes(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testHierFSMSubGraphItemCounts() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1"));
+ }
+ };
+ final Graph subGraph = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function)).getSubgraph();
+ Assert.assertEquals("number of nodes", 4, subGraph.getNodes().size());
+ Assert.assertEquals("number of links", 4, subGraph.getLinks().size());
+ Assert.assertEquals("number of states", 2, IterableExtensions.size(FsmGenExtensions.getStateNodes(subGraph)));
+ Assert.assertEquals("number of tr points", 2, IterableExtensions.size(FsmGenExtensions.getTrPointNodes(subGraph)));
+ Assert.assertEquals("number of choice points", 0, IterableExtensions.size(FsmGenExtensions.getChoicePointNodes(subGraph)));
+ }
+
+ @Test
+ public void testHierFSMState1_1Connections() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1"));
+ }
+ };
+ final Graph subGraph = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function)).getSubgraph();
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1_1"));
+ }
+ };
+ final Node s1_1 = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(subGraph), _function_1));
+ Assert.assertNotNull("state found", s1_1);
+ Assert.assertEquals("incoming links", 2, s1_1.getIncoming().size());
+ Assert.assertEquals("outgoing links", 1, s1_1.getOutgoing().size());
+ }
+
+ @Test
+ public void testHierFSMPointersIntoOriginalFSM() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1"));
+ }
+ };
+ final Node n = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(FsmGenExtensions.getStateNodes(this.gc.getGraph()), _function));
+ final Function1<State, Boolean> _function_1 = new Function1<State, Boolean>() {
+ @Override
+ public Boolean apply(final State it) {
+ return Boolean.valueOf(it.getName().equals("state1"));
+ }
+ };
+ final State s = IterableExtensions.<State>head(IterableExtensions.<State>filter(this.actor.getStateMachine().getStates(), _function_1));
+ Assert.assertNotNull("node found", n);
+ Assert.assertNotNull("state found", s);
+ StateGraphNode _stateGraphNode = n.getStateGraphNode();
+ Assert.assertTrue("State expected", (_stateGraphNode instanceof SimpleState));
+ Assert.assertEquals("correct target", s, n.getStateGraphNode());
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
new file mode 100644
index 000000000..466923419
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import com.google.common.base.Objects;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestHierInheritedFSM extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ private GraphContainer gc2;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("HierInheritedFSMExample.room", "TestActor");
+ this.gc2 = this.getGraphContainer("HierInheritedFSMExample.room", "TestActor2");
+ Assert.assertNotNull("graph context was created", this.gc);
+ Assert.assertNotNull("graph context was created", this.gc2);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.save(this.gc, "HierInheritedFSMExample");
+ this.save(this.gc2, "HierInheritedFSMExample2");
+ }
+
+ @Test
+ public void testHierInheritedFSMItemCounts() {
+ Assert.assertEquals("number of nodes", 4, this.gc.getGraph().getNodes().size());
+ Assert.assertEquals("number of links", 6, this.gc.getGraph().getLinks().size());
+ Assert.assertEquals("number of states", 4, IterableExtensions.size(FsmGenExtensions.getStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of tr points", 0, IterableExtensions.size(FsmGenExtensions.getTrPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of choice points", 0, IterableExtensions.size(FsmGenExtensions.getChoicePointNodes(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testHierInheritedFSMDeepItemCounts() {
+ Assert.assertEquals("number of nodes", 12, IteratorExtensions.size(FsmGenExtensions.getAllNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of links", 14, IteratorExtensions.size(FsmGenExtensions.getAllLinks(this.gc.getGraph())));
+ Assert.assertEquals("number of states", 10, IteratorExtensions.size(FsmGenExtensions.getAllStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of tr points", 2, IteratorExtensions.size(FsmGenExtensions.getAllTrPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("number of choice points", 0, IteratorExtensions.size(FsmGenExtensions.getAllChoicePointNodes(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testHierInheritedFSMLinks() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1_0"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("incoming links", 2, s.getIncoming().size());
+ Assert.assertEquals("outgoing links", 1, s.getOutgoing().size());
+ }
+
+ @Test
+ public void testOriginRefs() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ String _name = it.getStateGraphNode().getName();
+ return Boolean.valueOf(Objects.equal(_name, "state0"));
+ }
+ };
+ Iterable<Node> _filter = IterableExtensions.<Node>filter(this.gc2.getGraph().getNodes(), _function);
+ final Procedure1<Iterable<Node>> _function_1 = new Procedure1<Iterable<Node>>() {
+ @Override
+ public void apply(final Iterable<Node> it) {
+ Assert.assertEquals(1, IterableExtensions.size(it));
+ Assert.assertEquals("RefinedState:TestActor2$state0", EcoreUtil.getURI(IterableExtensions.<Node>head(it).getStateGraphNode()).fragment());
+ }
+ };
+ ObjectExtensions.<Iterable<Node>>operator_doubleArrow(_filter, _function_1);
+ final Function1<Link, Boolean> _function_2 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ String _name = it.getTransition().getName();
+ return Boolean.valueOf(Objects.equal(_name, "tr3"));
+ }
+ };
+ Iterable<Link> _filter_1 = IterableExtensions.<Link>filter(this.gc2.getGraph().getLinks(), _function_2);
+ final Procedure1<Iterable<Link>> _function_3 = new Procedure1<Iterable<Link>>() {
+ @Override
+ public void apply(final Iterable<Link> it) {
+ Assert.assertEquals(1, IterableExtensions.size(it));
+ Assert.assertEquals("RefinedTransition:TestActor2$tr3", EcoreUtil.getURI(IterableExtensions.<Link>head(it).getTransition()).fragment());
+ }
+ };
+ ObjectExtensions.<Iterable<Link>>operator_doubleArrow(_filter_1, _function_3);
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.java
new file mode 100644
index 000000000..27cf9e006
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.java
@@ -0,0 +1,174 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.etrice.core.fsm.fSM.CPBranchTransition;
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
+import org.eclipse.etrice.core.fsm.fSM.Transition;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.etrice.core.room.DataClass;
+import org.eclipse.etrice.core.room.DataType;
+import org.eclipse.etrice.core.room.VarDecl;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestMultipleConnectedChoicepoint extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("MultipleConnectedChoicepointExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.builder.withCommonData(this.builder.withChainHeads(this.builder.withTriggersInStates(this.gc)));
+ Assert.assertFalse("diagnostician has no errors", this.diagnostician.isFailed());
+ }
+
+ @Test
+ public void testObjectNumbers() {
+ Assert.assertEquals("Number of states", 6, IteratorExtensions.size(FsmGenExtensions.getAllStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of choice points", 1, IteratorExtensions.size(FsmGenExtensions.getAllChoicePointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of transition points", 0, IteratorExtensions.size(FsmGenExtensions.getAllTransitionPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of entry points", 1, IteratorExtensions.size(FsmGenExtensions.getAllEntryPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of exit points", 1, IteratorExtensions.size(FsmGenExtensions.getAllExitPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of initial transitions", 1, IteratorExtensions.size(FsmGenExtensions.getAllInitialTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of triggered transitions", 5, IteratorExtensions.size(FsmGenExtensions.getAllTriggeredTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of continuation transitions", 3, IteratorExtensions.size(FsmGenExtensions.getAllContinuationTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of cpbranch transitions", 1, IteratorExtensions.size(FsmGenExtensions.getAllCPBranchTranisitionLinks(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testChainsAndTriggers() {
+ Assert.assertEquals("transition chains", 6, IteratorExtensions.size(FsmGenExtensions.getAllChainHeads(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testData() {
+ final Function1<Link, Boolean> _function = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr0"));
+ }
+ };
+ Link tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(this.gc.getGraph().getLinks(), _function));
+ Assert.assertNotNull("transition found", tr);
+ TransitionBase _transition = tr.getTransition();
+ Assert.assertTrue("transition is TriggeredTransition", (_transition instanceof TriggeredTransition));
+ EObject _commonData = tr.getCommonData();
+ VarDecl data = ((VarDecl) _commonData);
+ DataType _type = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC2", data.getRefType().getType().getName());
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(it.getStateGraphNode().getName().equals("state1"));
+ }
+ };
+ final Node s = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function_1));
+ Assert.assertNotNull("state found", s);
+ final Function1<Link, Boolean> _function_2 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr2"));
+ }
+ };
+ tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(s.getSubgraph().getLinks(), _function_2));
+ TransitionBase _transition_1 = tr.getTransition();
+ Assert.assertTrue("transition is TriggeredTransition", (_transition_1 instanceof TriggeredTransition));
+ EObject _commonData_1 = tr.getCommonData();
+ data = ((VarDecl) _commonData_1);
+ DataType _type_1 = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type_1 instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC2", data.getRefType().getType().getName());
+ final Function1<Link, Boolean> _function_3 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr3"));
+ }
+ };
+ tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(s.getSubgraph().getLinks(), _function_3));
+ TransitionBase _transition_2 = tr.getTransition();
+ Assert.assertTrue("transition is TriggeredTransition", (_transition_2 instanceof TriggeredTransition));
+ EObject _commonData_2 = tr.getCommonData();
+ data = ((VarDecl) _commonData_2);
+ DataType _type_2 = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type_2 instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC4", data.getRefType().getType().getName());
+ final Function1<Link, Boolean> _function_4 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr1"));
+ }
+ };
+ tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(this.gc.getGraph().getLinks(), _function_4));
+ Assert.assertNotNull("transition found", tr);
+ TransitionBase _transition_3 = tr.getTransition();
+ Assert.assertTrue("transition is TriggeredTransition", (_transition_3 instanceof TriggeredTransition));
+ EObject _commonData_3 = tr.getCommonData();
+ data = ((VarDecl) _commonData_3);
+ DataType _type_3 = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type_3 instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC3", data.getRefType().getType().getName());
+ final Function1<Link, Boolean> _function_5 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr3"));
+ }
+ };
+ tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(this.gc.getGraph().getLinks(), _function_5));
+ Assert.assertNotNull("transition found", tr);
+ TransitionBase _transition_4 = tr.getTransition();
+ Assert.assertTrue("transition is ContinuationTransition", (_transition_4 instanceof ContinuationTransition));
+ EObject _commonData_4 = tr.getCommonData();
+ data = ((VarDecl) _commonData_4);
+ DataType _type_4 = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type_4 instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC", data.getRefType().getType().getName());
+ final Function1<Link, Boolean> _function_6 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(((Transition) _transition).getName().equals("tr4"));
+ }
+ };
+ tr = IterableExtensions.<Link>head(IterableExtensions.<Link>filter(this.gc.getGraph().getLinks(), _function_6));
+ Assert.assertNotNull("transition found", tr);
+ TransitionBase _transition_5 = tr.getTransition();
+ Assert.assertTrue("transition is CPBranchTransition", (_transition_5 instanceof CPBranchTransition));
+ EObject _commonData_5 = tr.getCommonData();
+ data = ((VarDecl) _commonData_5);
+ DataType _type_5 = data.getRefType().getType();
+ Assert.assertTrue("data is DataClass", (_type_5 instanceof DataClass));
+ Assert.assertEquals("data is of type", "DC", data.getRefType().getType().getName());
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.java
new file mode 100644
index 000000000..099db3f80
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.java
@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
+import org.eclipse.etrice.core.fsm.fSM.SimpleState;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.Transition;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.etrice.core.naming.RoomNameProvider;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestStatesInheritance extends FsmGenTestBase {
+ private RoomNameProvider roomNameProvider = new RoomNameProvider();
+
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("StatesInheritanceExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.builder.withCommonData(this.builder.withChainHeads(this.builder.withTriggersInStates(this.gc)));
+ Assert.assertFalse("diagnostician has no errors", this.diagnostician.isFailed());
+ }
+
+ @Test
+ public void testNoTrigger() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("State3"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("non-leave state has no caught triggers", 0, s.getCaughtTriggers().size());
+ }
+
+ @Test
+ public void testObjectNumbers() {
+ Assert.assertEquals("Number of states", 11, IteratorExtensions.size(FsmGenExtensions.getAllStateNodes(this.gc.getGraph())));
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ StateGraphNode _stateGraphNode = it.getStateGraphNode();
+ return Boolean.valueOf((_stateGraphNode instanceof SimpleState));
+ }
+ };
+ Assert.assertEquals("Number of states", 9, IteratorExtensions.size(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function)));
+ Assert.assertEquals("Number of choice points", 1, IteratorExtensions.size(FsmGenExtensions.getAllChoicePointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of transition points", 5, IteratorExtensions.size(FsmGenExtensions.getAllTransitionPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of entry points", 2, IteratorExtensions.size(FsmGenExtensions.getAllEntryPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of exit points", 1, IteratorExtensions.size(FsmGenExtensions.getAllExitPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of initial transitions", 3, IteratorExtensions.size(FsmGenExtensions.getAllInitialTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of triggered transitions", 17, IteratorExtensions.size(FsmGenExtensions.getAllTriggeredTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of continuation transitions", 4, IteratorExtensions.size(FsmGenExtensions.getAllContinuationTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of cpbranch transitions", 3, IteratorExtensions.size(FsmGenExtensions.getAllCPBranchTranisitionLinks(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testChainsAndTriggers() {
+ Assert.assertEquals("transition chains", 20, IteratorExtensions.size(FsmGenExtensions.getAllChainHeads(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testGraph() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(TestStatesInheritance.this.roomNameProvider.getFullPath(it.getStateGraphNode()).equals("State3_State3"));
+ }
+ };
+ Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state exists", s);
+ Assert.assertEquals("number of incoming transitions", 3, s.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 2, s.getOutgoing().size());
+ Assert.assertEquals("active triggers", 6, s.getCaughtTriggers().size());
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(TestStatesInheritance.this.roomNameProvider.getFullPath(it.getStateGraphNode()).equals("State2"));
+ }
+ };
+ s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function_1));
+ Assert.assertNotNull("state exists", s);
+ Assert.assertEquals("number of incoming transitions", 4, s.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 1, s.getOutgoing().size());
+ Assert.assertEquals("active triggers", 3, s.getCaughtTriggers().size());
+ final Function1<Node, Boolean> _function_2 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(it.getStateGraphNode().getName().equals("CP1"));
+ }
+ };
+ final Node cp = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllChoicePointNodes(this.gc.getGraph()), _function_2));
+ Assert.assertNotNull("cp exists", cp);
+ Assert.assertEquals("number of incoming transitions", 1, cp.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 4, cp.getOutgoing().size());
+ final Function1<Link, Boolean> _function_3 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf((_transition instanceof ContinuationTransition));
+ }
+ };
+ final Iterable<Link> cts = IterableExtensions.<Link>filter(cp.getOutgoing(), _function_3);
+ Assert.assertEquals("Exactly one continuation (=default) transition", 1, IterableExtensions.size(cts));
+ }
+
+ @Test
+ public void testChains() {
+ final Function1<Link, Boolean> _function = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(TestStatesInheritance.this.roomNameProvider.getFullPath(((Transition) _transition)).equals("State3_TRANS_tr1_FROM_tp1_TO_State3"));
+ }
+ };
+ Link tr = IteratorExtensions.<Link>head(IteratorExtensions.<Link>filter(FsmGenExtensions.getAllLinks(this.gc.getGraph()), _function));
+ Assert.assertNotNull("transition", tr);
+ Assert.assertEquals("one chain head", 1, tr.getChainHeads().size());
+ TransitionBase _transition = IterableExtensions.<Link>head(tr.getChainHeads()).getTransition();
+ Assert.assertEquals("chain name", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", this.roomNameProvider.getFullPath(((Transition) _transition)));
+ final Function1<Link, Boolean> _function_1 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(TestStatesInheritance.this.roomNameProvider.getFullPath(((Transition) _transition)).equals("State3_TRANS_tr8_FROM_tp6_TO_State2"));
+ }
+ };
+ tr = IteratorExtensions.<Link>head(IteratorExtensions.<Link>filter(FsmGenExtensions.getAllLinks(this.gc.getGraph()), _function_1));
+ Assert.assertNotNull("transition", tr);
+ Assert.assertEquals("one chain head", 1, tr.getChainHeads().size());
+ TransitionBase _transition_1 = IterableExtensions.<Link>head(tr.getChainHeads()).getTransition();
+ Assert.assertEquals("chain name", "TRANS_tr12_FROM_State5_TO_State3_tp6_BY_aport", this.roomNameProvider.getFullPath(((Transition) _transition_1)));
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.java
new file mode 100644
index 000000000..ee2c0d9f7
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.java
@@ -0,0 +1,146 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
+import org.eclipse.etrice.core.fsm.fSM.Transition;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.etrice.core.naming.RoomNameProvider;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestStatesTriggers extends FsmGenTestBase {
+ private RoomNameProvider roomNameProvider = new RoomNameProvider();
+
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("StatesTriggersExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.builder.withCommonData(this.builder.withChainHeads(this.builder.withTriggersInStates(this.gc)));
+ Assert.assertFalse("diagnostician has no errors", this.diagnostician.isFailed());
+ }
+
+ @Test
+ public void testNoTrigger() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("State3"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("non-leave state has no caught triggers", 0, s.getCaughtTriggers().size());
+ }
+
+ @Test
+ public void testObjectNumbers() {
+ Assert.assertEquals("Number of states", 7, IteratorExtensions.size(FsmGenExtensions.getAllStateNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of choice points", 1, IteratorExtensions.size(FsmGenExtensions.getAllChoicePointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of transition points", 4, IteratorExtensions.size(FsmGenExtensions.getAllTransitionPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of entry points", 1, IteratorExtensions.size(FsmGenExtensions.getAllEntryPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of exit points", 1, IteratorExtensions.size(FsmGenExtensions.getAllExitPointNodes(this.gc.getGraph())));
+ Assert.assertEquals("Number of initial transitions", 2, IteratorExtensions.size(FsmGenExtensions.getAllInitialTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of triggered transitions", 11, IteratorExtensions.size(FsmGenExtensions.getAllTriggeredTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of continuation transitions", 3, IteratorExtensions.size(FsmGenExtensions.getAllContinuationTranisitionLinks(this.gc.getGraph())));
+ Assert.assertEquals("Number of cpbranch transitions", 2, IteratorExtensions.size(FsmGenExtensions.getAllCPBranchTranisitionLinks(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testChainsAndTriggers() {
+ Assert.assertEquals("transition chains", 13, IteratorExtensions.size(FsmGenExtensions.getAllChainHeads(this.gc.getGraph())));
+ }
+
+ @Test
+ public void testGraph() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("State3"));
+ }
+ };
+ Node s = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function));
+ final Function1<Node, Boolean> _function_1 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("State3"));
+ }
+ };
+ s = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(s.getSubgraph().getNodes(), _function_1));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("number of incoming transitions", 3, s.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 2, s.getOutgoing().size());
+ Assert.assertEquals("active triggers", 6, s.getCaughtTriggers().size());
+ final Function1<Node, Boolean> _function_2 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("State2"));
+ }
+ };
+ s = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function_2));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("number of incoming transitions", 4, s.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 1, s.getOutgoing().size());
+ Assert.assertEquals("active triggers", 3, s.getCaughtTriggers().size());
+ final Function1<Node, Boolean> _function_3 = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("CP1"));
+ }
+ };
+ final Node cp = IterableExtensions.<Node>head(IterableExtensions.<Node>filter(this.gc.getGraph().getNodes(), _function_3));
+ Assert.assertNotNull("cp found", cp);
+ Assert.assertEquals("number of incoming transitions", 1, cp.getIncoming().size());
+ Assert.assertEquals("number of outgoing transitions", 3, cp.getOutgoing().size());
+ final Function1<Link, Boolean> _function_4 = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf((_transition instanceof ContinuationTransition));
+ }
+ };
+ final Iterable<Link> cts = IterableExtensions.<Link>filter(cp.getOutgoing(), _function_4);
+ Assert.assertEquals("Exactly one continuation (=default) transition", 1, IterableExtensions.size(cts));
+ }
+
+ @Test
+ public void testChains() {
+ final Function1<Link, Boolean> _function = new Function1<Link, Boolean>() {
+ @Override
+ public Boolean apply(final Link it) {
+ TransitionBase _transition = it.getTransition();
+ return Boolean.valueOf(TestStatesTriggers.this.roomNameProvider.getFullPath(((Transition) _transition)).equals("State3_TRANS_tr1_FROM_tp1_TO_State3"));
+ }
+ };
+ final Link tr = IteratorExtensions.<Link>head(IteratorExtensions.<Link>filter(FsmGenExtensions.getAllLinks(this.gc.getGraph()), _function));
+ Assert.assertNotNull("transition found", tr);
+ Assert.assertEquals("one chain head", 1, tr.getChainHeads().size());
+ TransitionBase _transition = IterableExtensions.<Link>head(tr.getChainHeads()).getTransition();
+ Assert.assertEquals("correct chain head", "TRANS_tr5_FROM_tp0_TO_State3_tp1_BY_afct", this.roomNameProvider.getFullPath(((Transition) _transition)));
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.java b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.java
new file mode 100644
index 000000000..222a967be
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2017 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:
+ * Henrik Rentz-Reichert (initial contribution)
+ */
+package org.eclipse.etrice.core.genmodel.fsm.tests;
+
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.TriggerExtensions;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.genmodel.fsm.tests.FsmGenTestBase;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestTrigger extends FsmGenTestBase {
+ private GraphContainer gc;
+
+ @Before
+ public void SetUp() {
+ this.gc = this.getGraphContainer("TriggerExample.room", "TestActor");
+ Assert.assertNotNull("graph context was created", this.gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(this.gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.builder.withTriggersInStates(this.gc);
+ Assert.assertFalse("diagnostician has no errors", this.diagnostician.isFailed());
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state0_0"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertEquals("leave state triggers", 3, s.getCaughtTriggers().size());
+ }
+
+ @Test
+ public void testNoTrigger() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state0"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("non-leave state has no caught triggers", 0, s.getCaughtTriggers().size());
+ }
+
+ @Test
+ public void testTrigger_state0_0() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state0_0"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("leave state triggers", 3, s.getCaughtTriggers().size());
+ Assert.assertEquals("1st trigger", this.trigger("in3"), s.getCaughtTriggers().get(0).getTrigger());
+ Assert.assertEquals("1st trigger, transitions", 1, s.getCaughtTriggers().get(0).getLinks().size());
+ Assert.assertEquals("2nd trigger", this.trigger("in1"), s.getCaughtTriggers().get(1).getTrigger());
+ Assert.assertEquals("2nd trigger, transitions", 1, s.getCaughtTriggers().get(1).getLinks().size());
+ Assert.assertEquals("3rd trigger", this.trigger("in2"), s.getCaughtTriggers().get(2).getTrigger());
+ Assert.assertEquals("3rd trigger, transitions", 1, s.getCaughtTriggers().get(2).getLinks().size());
+ }
+
+ @Test
+ public void testTrigger_state0_1() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state0_1"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("leave state triggers", 2, s.getCaughtTriggers().size());
+ Assert.assertEquals("1st trigger", this.trigger("in2"), s.getCaughtTriggers().get(0).getTrigger());
+ Assert.assertEquals("1st trigger, transitions", 1, s.getCaughtTriggers().get(0).getLinks().size());
+ Assert.assertEquals("2nd trigger", this.trigger("in1"), s.getCaughtTriggers().get(1).getTrigger());
+ Assert.assertEquals("2nd trigger, transitions", 1, s.getCaughtTriggers().get(1).getLinks().size());
+ }
+
+ @Test
+ public void testTrigger_state1_0() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1_0"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("leave state triggers", 2, s.getCaughtTriggers().size());
+ Assert.assertEquals("1st trigger", this.trigger("in1"), s.getCaughtTriggers().get(0).getTrigger());
+ Assert.assertEquals("1st trigger, transitions", 1, s.getCaughtTriggers().get(0).getLinks().size());
+ Assert.assertEquals("2nd trigger", this.trigger("in2"), s.getCaughtTriggers().get(1).getTrigger());
+ Assert.assertEquals("2nd trigger, transitions", 1, s.getCaughtTriggers().get(1).getLinks().size());
+ }
+
+ @Test
+ public void testTrigger_state1_1() {
+ final Function1<Node, Boolean> _function = new Function1<Node, Boolean>() {
+ @Override
+ public Boolean apply(final Node it) {
+ return Boolean.valueOf(FsmGenExtensions.getName(it).equals("state1_1"));
+ }
+ };
+ final Node s = IteratorExtensions.<Node>head(IteratorExtensions.<Node>filter(FsmGenExtensions.getAllStateNodes(this.gc.getGraph()), _function));
+ Assert.assertNotNull("state found", s);
+ Assert.assertEquals("leave state triggers", 2, s.getCaughtTriggers().size());
+ Assert.assertEquals("1st trigger", this.trigger("in1"), s.getCaughtTriggers().get(0).getTrigger());
+ Assert.assertEquals("1st trigger, transitions", 3, s.getCaughtTriggers().get(0).getLinks().size());
+ Assert.assertEquals("2nd trigger", this.trigger("in2"), s.getCaughtTriggers().get(1).getTrigger());
+ Assert.assertEquals("2nd trigger, transitions", 1, s.getCaughtTriggers().get(1).getLinks().size());
+ }
+
+ public String trigger(final String msg) {
+ return (("p0" + TriggerExtensions.TRIGGER_SEP) + msg);
+ }
+}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/models/states.room b/tests/org.eclipse.etrice.core.genmodel.tests/models/states.room
deleted file mode 100644
index 22ba965f2..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/models/states.room
+++ /dev/null
@@ -1,108 +0,0 @@
-RoomModel states {
-
- PrimitiveType int32: ptInteger -> 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.core.genmodel.tests/org.eclipse.etrice.core.genmodel.tests.launch b/tests/org.eclipse.etrice.core.genmodel.tests/org.eclipse.etrice.core.genmodel.tests.launch
index c16a57ec4..06c1560bc 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/org.eclipse.etrice.core.genmodel.tests.launch
+++ b/tests/org.eclipse.etrice.core.genmodel.tests/org.eclipse.etrice.core.genmodel.tests.launch
@@ -11,7 +11,7 @@
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="false"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
@@ -33,8 +33,8 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<booleanAttribute key="run_in_ui_thread" value="false"/>
-<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,javax.inject@default:default,javax.xml@default:default,org.antlr.runtime@default:default,org.apache.log4j@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi@-1:true,org.eclipse.pde.junit.runtime@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.genmodel.fsm@default:default,org.eclipse.etrice.core.genmodel.tests@default:default,org.eclipse.etrice.core.genmodel@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.logging@default:false"/>
+<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu@default:default,javax.inject@default:default,javax.xml@default:default,org.antlr.runtime@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.jxpath@default:default,org.apache.log4j@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.fx.osgi@default:false,org.eclipse.help@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.pde.junit.runtime@default:default,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.genmodel.fsm2@default:default,org.eclipse.etrice.core.genmodel.fsm@default:default,org.eclipse.etrice.core.genmodel.tests@default:default,org.eclipse.etrice.core.genmodel@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.logging@default:false"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestCodeInheritance.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestCodeInheritance.java
deleted file mode 100644
index d62d3eaa5..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestCodeInheritance.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.core.genmodel;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-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.core.fsm.fSM.FSMPackage;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.util.FSMHelpers;
-import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.ExpandedRefinedState;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-public class TestCodeInheritance extends TestInstanceModelBuilderBase {
-
- private Root root;
- private HashMap<EClass, ArrayList<EObject>> baseInstances;
- private HashMap<EClass, ArrayList<EObject>> derivedInstances;
- private ExpandedActorClass base;
- private ExpandedActorClass derived;
- private FSMHelpers fsmHelpers = new FSMHelpers();
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("code_inheritance.room");
- base = getActor("Base");
- derived = getActor("Deriv");
- baseInstances = collectInstances(base);
- derivedInstances = collectInstances(derived);
- }
-
- private ExpandedActorClass getActor(String name) {
- for (ExpandedActorClass xpac : root.getXpActorClasses()) {
- if (xpac.getActorClass().getName().equals(name))
- return xpac;
- }
- return null;
- }
-
- private State getState(ExpandedActorClass xpac, String name) {
- for (State s : xpac.getStateMachine().getStates()) {
- if (s.getName().equals(name))
- return s;
- }
- return null;
- }
-
- @Test
- public void testNumbers() {
- assertEquals("number of states", 6, baseInstances.get(FSMPackage.eINSTANCE.getSimpleState()).size());
- assertNull("number of choice points", baseInstances.get(FSMPackage.eINSTANCE.getChoicePoint()));
- assertNull("number of transition points", baseInstances.get(FSMPackage.eINSTANCE.getTransitionPoint()));
- assertNull("number of entry points", baseInstances.get(FSMPackage.eINSTANCE.getEntryPoint()));
- assertNull("number of exit points", baseInstances.get(FSMPackage.eINSTANCE.getExitPoint()));
- assertEquals("number of initial transitions", 3, baseInstances.get(FSMPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 3, baseInstances.get(FSMPackage.eINSTANCE.getTriggeredTransition()).size());
- assertNull("number of continuation transitions", baseInstances.get(FSMPackage.eINSTANCE.getContinuationTransition()));
- assertNull("number of branch transitions", baseInstances.get(FSMPackage.eINSTANCE.getCPBranchTransition()));
-
- assertEquals("number of states", 4, derivedInstances.get(FSMPackage.eINSTANCE.getSimpleState()).size());
- assertEquals("number of states", 3, derivedInstances.get(FsmGenPackage.eINSTANCE.getExpandedRefinedState()).size());
- assertNull("number of choice points", derivedInstances.get(FSMPackage.eINSTANCE.getChoicePoint()));
- assertNull("number of transition points", derivedInstances.get(FSMPackage.eINSTANCE.getTransitionPoint()));
- assertNull("number of entry points", derivedInstances.get(FSMPackage.eINSTANCE.getEntryPoint()));
- assertNull("number of exit points", derivedInstances.get(FSMPackage.eINSTANCE.getExitPoint()));
- assertEquals("number of initial transitions", 4, derivedInstances.get(FSMPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 3, derivedInstances.get(FSMPackage.eINSTANCE.getTriggeredTransition()).size());
- assertNull("number of continuation transitions", derivedInstances.get(FSMPackage.eINSTANCE.getContinuationTransition()));
- assertNull("number of branch transitions", derivedInstances.get(FSMPackage.eINSTANCE.getCPBranchTransition()));
- }
-
- @Test
- public void testActionCodes() {
- State s = getState(derived, "BaseEntryExit");
- assertTrue("is ExpandedRefinedState", s instanceof ExpandedRefinedState);
- ExpandedRefinedState rs = (ExpandedRefinedState) s;
- assertEquals("entry code", "// derived entry\n", fsmHelpers.getDetailCode(rs.getEntryCode()));
- assertNull("exit code", rs.getExitCode());
- assertEquals("inherited entry", "// base entry\n", fsmHelpers.getDetailCode(rs.getInheritedEntry()));
- assertEquals("inherited exit", "// base exit\n", fsmHelpers.getDetailCode(rs.getInheritedExit()));
-
- s = getState(derived, "Base");
- assertTrue("is ExpandedRefinedState", s instanceof ExpandedRefinedState);
- rs = (ExpandedRefinedState) s;
- assertNull("entry code", rs.getEntryCode());
- assertEquals("exit code", "// derived exit\n", fsmHelpers.getDetailCode(rs.getExitCode()));
- assertEquals("inherited entry", "", fsmHelpers.getDetailCode(rs.getInheritedEntry()));
- assertEquals("inherited exit", "", fsmHelpers.getDetailCode(rs.getInheritedExit()));
-
- s = getState(derived, "BaseSub");
- assertTrue("is ExpandedRefinedState", s instanceof ExpandedRefinedState);
- rs = (ExpandedRefinedState) s;
- assertEquals("entry code", "// derived entry\n", fsmHelpers.getDetailCode(rs.getEntryCode()));
- assertNull("exit code", rs.getExitCode());
- assertEquals("inherited entry", "", fsmHelpers.getDetailCode(rs.getInheritedEntry()));
- assertEquals("inherited exit", "", fsmHelpers.getDetailCode(rs.getInheritedExit()));
- }
-
-}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestInstanceModelBuilderBase.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestInstanceModelBuilderBase.java
index 9b8643f70..dd88aaab5 100644
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestInstanceModelBuilderBase.java
+++ b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestInstanceModelBuilderBase.java
@@ -29,30 +29,18 @@ 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.fsm.fSM.StateGraphItem;
+import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.base.ILogger;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.IDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
import org.eclipse.etrice.core.naming.RoomNameProvider;
+import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
-import org.eclipse.etrice.core.room.RoomModel;
-import org.eclipse.etrice.core.fsm.fSM.StateGraphItem;
-import org.eclipse.etrice.core.genmodel.builder.GeneratorModelBuilder;
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 {
@@ -112,7 +100,7 @@ public class TestInstanceModelBuilderBase {
}
protected Root buildInstanceModel(String modelName) {
- GeneratorModelBuilder builder = new GeneratorModelBuilder(new Logger(), new Diagnostician());
+ GeneratorModelBuilder builder = new GeneratorModelBuilder(new NullLogger(), new Diagnostician());
LinkedList<RoomModel> models = getModels(modelName);
ArrayList<RoomModel> importedModels = new ArrayList<>();
Root root = builder.createGeneratorModel(models, importedModels, false);
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestMultipleConnectedChoicepoint.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestMultipleConnectedChoicepoint.java
deleted file mode 100644
index 49b4fc59b..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestMultipleConnectedChoicepoint.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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:
- * Henrik Rentz-Reichert (initial contribution)
- *
- *******************************************************************************/
-
-package org.eclipse.etrice.core.genmodel;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.fsm.fSM.CPBranchTransition;
-import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
-import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
-import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.fSM.Transition;
-import org.eclipse.etrice.core.fsm.fSM.TriggeredTransition;
-import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.TransitionChain;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.eclipse.etrice.core.room.DataClass;
-import org.eclipse.etrice.core.room.VarDecl;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author Henrik Rentz-Reichert
- *
- */
-public class TestMultipleConnectedChoicepoint extends
- TestInstanceModelBuilderBase {
-
- private Root root;
- private ExpandedActorClass xpac;
- private RoomNameProvider roomNameProvider = new RoomNameProvider();
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("cpmult.room");
- xpac = getTestee();
- instances = collectInstances(xpac);
- }
-
- private ExpandedActorClass getTestee() {
- for (ExpandedActorClass xpac : root.getXpActorClasses()) {
- if (xpac.getActorClass().getName().equals("CPMult"))
- return xpac;
- }
- return null;
- }
-
- private Transition getTransition(String name) {
- for (Transition tr : xpac.getStateMachine().getTransitions()) {
- if (tr.getName().equals(name))
- return tr;
- }
- return null;
- }
-
- private Transition getState1Transition(String name) {
- for (State s : xpac.getStateMachine().getStates()) {
- if (s.getName().equals("state1")) {
- for (Transition tr : s.getSubgraph().getTransitions()) {
- if (tr.getName().equals(name))
- return tr;
- }
- }
- }
- return null;
- }
-
- @Test
- public void testNumbers() {
- assertEquals("number of states", 6, instances.get(FSMPackage.eINSTANCE.getSimpleState()).size());
- assertEquals("number of choice points", 1, instances.get(FSMPackage.eINSTANCE.getChoicePoint()).size());
- assertNull("number of transition points", instances.get(FSMPackage.eINSTANCE.getTransitionPoint()));
- assertEquals("number of entry points", 1, instances.get(FSMPackage.eINSTANCE.getEntryPoint()).size());
- assertEquals("number of exit points", 1, instances.get(FSMPackage.eINSTANCE.getExitPoint()).size());
- assertEquals("number of initial transitions", 1, instances.get(FSMPackage.eINSTANCE.getInitialTransition()).size());
- assertEquals("number of triggered transitions", 5, instances.get(FSMPackage.eINSTANCE.getTriggeredTransition()).size());
- assertEquals("number of continuation transitions", 3, instances.get(FSMPackage.eINSTANCE.getContinuationTransition()).size());
- assertEquals("number of branch transitions", 1, instances.get(FSMPackage.eINSTANCE.getCPBranchTransition()).size());
- }
-
- @Test
- public void testXPACGeneral() {
- EList<TransitionChain> chains = xpac.getTransitionChains();
- assertEquals("number of chains", 6, chains.size());
- assertEquals("number of triggers", 4, xpac.getTriggers().size());
- }
-
- @Test
- public void testGraph() {
- ArrayList<EObject> cps = instances.get(FSMPackage.eINSTANCE.getChoicePoint());
- ChoicePoint cp = (ChoicePoint) cps.get(0);
- assertEquals("choicepoint name", "cp0", roomNameProvider.getFullPath(cp));
- assertEquals("number of incoming transitions", 2, xpac.getIncomingTransitions(cp).size());
- assertEquals("number of outgoing transitions", 2, xpac.getOutgoingTransitions(cp).size());
- }
-
- @Test
- public void testData() {
- Transition tr = getTransition("tr0");
- VarDecl data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is TriggeredTransition", tr instanceof TriggeredTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC2", data.getRefType().getType().getName());
-
- tr = getState1Transition("tr2");
- data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is TriggeredTransition", tr instanceof TriggeredTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC2", data.getRefType().getType().getName());
-
- tr = getState1Transition("tr3");
- data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is TriggeredTransition", tr instanceof TriggeredTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC4", data.getRefType().getType().getName());
-
- tr = getTransition("tr1");
- data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is TriggeredTransition", tr instanceof TriggeredTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC3", data.getRefType().getType().getName());
-
- tr = getTransition("tr3");
- data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is ContinuationTransition", tr instanceof ContinuationTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC", data.getRefType().getType().getName());
-
- tr = getTransition("tr4");
- data = (VarDecl) xpac.getData(tr);
- assertTrue("transition is CPBranchTransition", tr instanceof CPBranchTransition);
- assertTrue("data is DataClass", data.getRefType().getType() instanceof DataClass);
- assertEquals("data of "+tr.getName(), "DC", data.getRefType().getType().getName());
- }
-
-}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStates.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStates.java
deleted file mode 100644
index 87ca6e00f..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStates.java
+++ /dev/null
@@ -1,117 +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.core.genmodel;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
-import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.TransitionChain;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.junit.Before;
-import org.junit.Test;
-import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
-import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.fSM.Transition;
-
-public class TestStates extends TestInstanceModelBuilderBase {
-
- private Root root;
- private RoomNameProvider roomNameProvider = new RoomNameProvider();
-
- @Before
- public void setUp() {
- prepare();
-
- root = buildInstanceModel("states.room");
- instances = collectInstances(root.getXpActorClasses().get(0));
- }
-
- @Test
- public void testNumbers() {
- checkSize(7, FSMPackage.eINSTANCE.getSimpleState());
- checkSize(1, FSMPackage.eINSTANCE.getChoicePoint());
- checkSize(2, FSMPackage.eINSTANCE.getTransitionPoint());
- checkSize(1, FSMPackage.eINSTANCE.getEntryPoint());
- checkSize(1, FSMPackage.eINSTANCE.getExitPoint());
- checkSize(2, FSMPackage.eINSTANCE.getInitialTransition());
- checkSize(9, FSMPackage.eINSTANCE.getTriggeredTransition());
- checkSize(3, FSMPackage.eINSTANCE.getContinuationTransition());
- checkSize(2, FSMPackage.eINSTANCE.getCPBranchTransition());
- }
-
- @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(FSMPackage.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(FSMPackage.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(FSMPackage.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.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesAndTriggers.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesAndTriggers.java
deleted file mode 100644
index 942986758..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesAndTriggers.java
+++ /dev/null
@@ -1,142 +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.core.genmodel;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
-import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
-import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.fSM.Transition;
-import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.TransitionChain;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.eclipse.etrice.core.room.Port;
-import org.eclipse.etrice.core.room.SAP;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestStatesAndTriggers extends TestInstanceModelBuilderBase {
-
- private Root root;
- private ExpandedActorClass xpac;
- private RoomNameProvider roomNameProvider = new RoomNameProvider();
-
- @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() {
- checkSize(7, FSMPackage.eINSTANCE.getSimpleState());
- checkSize(1, FSMPackage.eINSTANCE.getChoicePoint());
- checkSize(4, FSMPackage.eINSTANCE.getTransitionPoint());
- checkSize(1, FSMPackage.eINSTANCE.getEntryPoint());
- checkSize(1, FSMPackage.eINSTANCE.getExitPoint());
- checkSize(2, FSMPackage.eINSTANCE.getInitialTransition());
- checkSize(11, FSMPackage.eINSTANCE.getTriggeredTransition());
- checkSize(3, FSMPackage.eINSTANCE.getContinuationTransition());
- checkSize(2, FSMPackage.eINSTANCE.getCPBranchTransition());
- }
-
- @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(FSMPackage.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(FSMPackage.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(FSMPackage.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().getInterfacePorts().get(0);
- Port sub = xpac.getActorClass().getInternalPorts().get(0);
- SAP timer = xpac.getActorClass().getServiceAccessPoints().get(0);
- SAP timeout = xpac.getActorClass().getServiceAccessPoints().get(1);
-
- assertEquals("port name", "fct", fct.getName());
- assertEquals("port name", "subp", sub.getName());
- assertEquals("sap name", "timer", timer.getName());
- assertEquals("sap name", "timeout", timeout.getName());
-
- assertEquals("port local id", 0, xpac.getInterfaceItemLocalId(sub));
- assertEquals("port local id", 1, xpac.getInterfaceItemLocalId(fct));
- assertEquals("sap local id", 2, xpac.getInterfaceItemLocalId(timer));
- assertEquals("sap local id", 3, xpac.getInterfaceItemLocalId(timeout));
- }
-}
diff --git a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesInheritance.java b/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesInheritance.java
deleted file mode 100644
index 7aa0d9230..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestStatesInheritance.java
+++ /dev/null
@@ -1,142 +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.core.genmodel;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
-import org.eclipse.etrice.core.fsm.fSM.ContinuationTransition;
-import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.fSM.Transition;
-import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
-import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.TransitionChain;
-import org.eclipse.etrice.core.naming.RoomNameProvider;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestStatesInheritance extends TestInstanceModelBuilderBase {
-
- private Root root;
- private ExpandedActorClass xpac;
- private RoomNameProvider roomNameProvider = new RoomNameProvider();
-
- @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() {
- checkSize(9, FSMPackage.eINSTANCE.getSimpleState());
- checkSize(1, FSMPackage.eINSTANCE.getChoicePoint());
- checkSize(5, FSMPackage.eINSTANCE.getTransitionPoint());
- checkSize(2, FSMPackage.eINSTANCE.getEntryPoint());
- checkSize(1, FSMPackage.eINSTANCE.getExitPoint());
- checkSize(3, FSMPackage.eINSTANCE.getInitialTransition());
- checkSize(17, FSMPackage.eINSTANCE.getTriggeredTransition());
- checkSize(4, FSMPackage.eINSTANCE.getContinuationTransition());
- checkSize(3, FSMPackage.eINSTANCE.getCPBranchTransition());
- }
-
- @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(FSMPackage.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(FSMPackage.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(FSMPackage.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.core.room.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
index c6acb3d89..249e68142 100644
--- a/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.etrice.core.room.tests/META-INF/MANIFEST.MF
@@ -17,3 +17,4 @@ Require-Bundle: org.eclipse.etrice.core.room;bundle-version="1.1.1",
org.eclipse.emf.ecore
Bundle-Activator: org.eclipse.etrice.core.CoreTestsActivator
Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.etrice.core
diff --git a/tests/org.eclipse.etrice.core.room.tests/org.eclipse.etrice.core.room.tests.launch b/tests/org.eclipse.etrice.core.room.tests/org.eclipse.etrice.core.room.tests.launch
index 6cb9c65b8..e7e2c69f0 100644
--- a/tests/org.eclipse.etrice.core.room.tests/org.eclipse.etrice.core.room.tests.launch
+++ b/tests/org.eclipse.etrice.core.room.tests/org.eclipse.etrice.core.room.tests.launch
@@ -36,9 +36,15 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="false"/>
+<<<<<<< Upstream, based on origin/master
<stringAttribute key="selected_target_plugins" value="com.google.guava*15.0.0.v201403281430@default:default,com.google.guava*21.0.0.v20170206-1425@default:default,com.google.inject@default:default,javax.inject@default:default,javax.xml@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.antlr.runtime*4.3.0.v201502022030@default:default,org.apache.log4j@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi@-1:true,org.eclipse.xtend.core@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.room.tests@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.logging@default:false"/>
<booleanAttribute key="show_selected_only" value="true"/>
+=======
+<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu@default:default,javax.inject@default:default,javax.xml@default:default,org.antlr.runtime@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.jxpath@default:default,org.apache.log4j@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.win32.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources.win32.x86_64@default:false,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.win32.win32.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.xtend.core@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.logging@default:false,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.etrice.core.common@default:default,org.eclipse.etrice.core.fsm@default:default,org.eclipse.etrice.core.genmodel.fsm@default:default,org.eclipse.etrice.core.room.tests@default:default,org.eclipse.etrice.core.room@default:default,org.eclipse.etrice.logging@default:false"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+>>>>>>> ff1be2e Bug 511330 - [core.genmodel.fsm] introduce simplified generator model for state machines
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
index fa3d16e23..c65deeb25 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestAnnotations.java
@@ -28,7 +28,7 @@ public class TestAnnotations extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("AnnotationExample.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
index ee8f39db1..1f358ba29 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBase.java
@@ -28,6 +28,7 @@ import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CancelableDiagnostician;
import org.eclipse.xtext.validation.CheckMode;
import org.eclipse.xtext.validation.impl.ConcreteSyntaxEValidator;
+import org.osgi.framework.Bundle;
import com.google.common.collect.Maps;
@@ -41,9 +42,9 @@ public class TestBase {
private String basePath;
- protected void prepare() {
+ protected void prepare(Bundle bundle) {
try {
- URL modelsDir = CoreTestsActivator.getInstance().getBundle().getEntry("models");
+ URL modelsDir = bundle.getEntry("models");
URL fileURL = FileLocator.toFileURL(modelsDir);
basePath = fileURL.getFile();
} catch (IOException e) {
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
index ee1dc26fc..d5d7ae50b 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBindings.java
@@ -33,7 +33,7 @@ public class TestBindings extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("TestBindings.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
index f0044dd58..262029e7a 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestBug505406.java
@@ -29,7 +29,7 @@ public class TestBug505406 extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("bug505406.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
index 8030130c0..769ffc253 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestCases.java
@@ -31,7 +31,7 @@ public class TestCases extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("test.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
index 163223420..f4af08991 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestDynamicActors.java
@@ -34,7 +34,7 @@ public class TestDynamicActors extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("TestDynamicActors.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
index adc68f457..1b50a282c 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestEnumerations.java
@@ -32,7 +32,7 @@ public class TestEnumerations extends TestBase {
@Before
public void SetUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
res = getResource("EnumExample.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
index b448a38a8..b94063609 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestFragments.java
@@ -31,7 +31,7 @@ public class TestFragments extends TestBase {
@Before
public void setUp() {
- prepare();
+ prepare(CoreTestsActivator.getInstance().getBundle());
resource = getResource("ChoicePointTest.room");
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
index 170c8aa5b..bc7f587b7 100644
--- a/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
+++ b/tests/org.eclipse.etrice.core.room.tests/src/org/eclipse/etrice/core/TestNames.xtend
@@ -25,12 +25,12 @@ import org.junit.Test
class TestNames extends TestBase {
val Map<EObject, Boolean> nameErrorMap = Maps.newHashMap
- Resource res;
+ Resource res
@Before
def void SetUp() {
- prepare();
- res = getResource("NamesAreUnique.room");
+ prepare(CoreTestsActivator.getInstance().getBundle())
+ res = getResource("NamesAreUnique.room")
val model = res.contents.head
val diag = getDiag(model)
@@ -61,7 +61,7 @@ class TestNames extends TestBase {
val items = newArrayList(ac, dc)
items += ac.eContents
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 15, items.size);
+ Assert.assertEquals("Unexpected item count", 15, items.size)
items.forEach[
Assert.assertFalse("expected no name error: " + it, it.hasNameErrorMessage)
]
@@ -75,7 +75,7 @@ class TestNames extends TestBase {
val items = newArrayList(ac, dc)
items += ac.eContents
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 9, items.size);
+ Assert.assertEquals("Unexpected item count", 9, items.size)
items.forEach[
Assert.assertFalse("expected no name error: " + it, it.hasNameErrorMessage)
]
@@ -89,7 +89,7 @@ class TestNames extends TestBase {
val items = newArrayList()
items += ac.eContents.filter[!(it instanceof ExternalPort)]
items += dc.eContents
- Assert.assertEquals("Unexpected item count", 13, items.size);
+ Assert.assertEquals("Unexpected item count", 13, items.size)
items.forEach[
Assert.assertTrue("expected name error: " + it, it.hasNameErrorMessage)
]
@@ -109,7 +109,7 @@ class TestNames extends TestBase {
items += lc.eContents
items += sc.eContents
items += enum.eContents
- Assert.assertEquals("Unexpected item count", 16, items.size);
+ Assert.assertEquals("Unexpected item count", 16, items.size)
items.forEach[
Assert.assertTrue("expected name error: " + it, it.hasNameErrorMessage)
]
@@ -121,6 +121,6 @@ class TestNames extends TestBase {
protected def boolean isNameErrorMessage(Diagnostic diag) {
val message = diag.message
- return diag.severity >= Diagnostic.ERROR && (message.contains("Duplicate name") || (message.contains("Name") && message.contains("is already assigned to")));
+ return diag.severity >= Diagnostic.ERROR && (message.contains("Duplicate name") || (message.contains("Name") && message.contains("is already assigned to")))
}
}
diff --git a/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java b/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
new file mode 100644
index 000000000..37641c0ed
--- /dev/null
+++ b/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
@@ -0,0 +1,156 @@
+/**
+ * Copyright (c) 2015 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:
+ * Juergen Haug (initial contribution)
+ */
+package org.eclipse.etrice.core;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Maps;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.function.Consumer;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.etrice.core.CoreTestsActivator;
+import org.eclipse.etrice.core.TestBase;
+import org.eclipse.etrice.core.room.ExternalPort;
+import org.eclipse.xtext.validation.AbstractValidationDiagnostic;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestNames extends TestBase {
+ private final Map<EObject, Boolean> nameErrorMap = Maps.<EObject, Boolean>newHashMap();
+
+ private Resource res;
+
+ @Before
+ public void SetUp() {
+ this.prepare(CoreTestsActivator.getInstance().getBundle());
+ this.res = this.getResource("NamesAreUnique.room");
+ final EObject model = IterableExtensions.<EObject>head(this.res.getContents());
+ final Diagnostic diag = this.getDiag(model);
+ final Consumer<Diagnostic> _function = (Diagnostic it) -> {
+ if ((it instanceof AbstractValidationDiagnostic)) {
+ final EObject obj = ((AbstractValidationDiagnostic)it).getSourceEObject();
+ Boolean nameError = this.nameErrorMap.get(obj);
+ boolean _equals = Objects.equal(nameError, null);
+ if (_equals) {
+ nameError = Boolean.valueOf(false);
+ }
+ this.nameErrorMap.put(obj, Boolean.valueOf(((nameError).booleanValue() || this.isNameErrorMessage(it))));
+ }
+ };
+ diag.getChildren().forEach(_function);
+ }
+
+ @Test
+ public void RoomClassNames() {
+ Assert.assertTrue(this.hasNameErrorMessage(this.res.getEObject("ActorClass:ClassDuplicate1")));
+ Assert.assertTrue(this.hasNameErrorMessage(this.res.getEObject("LogicalSystem:ClassDuplicate1")));
+ Assert.assertTrue(this.hasNameErrorMessage(this.res.getEObject("AnnotationType:ClassDuplicate1")));
+ Assert.assertTrue(this.hasNameErrorMessage(this.res.getEObject("EnumerationType:ClassDuplicate1")));
+ Assert.assertTrue(this.hasNameErrorMessage(this.res.getEObject("PrimitiveType:ClassDuplicate1")));
+ }
+
+ @Test
+ public void BaseClassNames() {
+ final EObject ac = this.res.getEObject("ActorClass:Base");
+ final EObject dc = this.res.getEObject("DataClass:DBase");
+ final ArrayList<EObject> items = CollectionLiterals.<EObject>newArrayList(ac, dc);
+ EList<EObject> _eContents = ac.eContents();
+ Iterables.<EObject>addAll(items, _eContents);
+ EList<EObject> _eContents_1 = dc.eContents();
+ Iterables.<EObject>addAll(items, _eContents_1);
+ Assert.assertEquals("Unexpected item count", 15, items.size());
+ final Consumer<EObject> _function = (EObject it) -> {
+ Assert.assertFalse(("expected no name error: " + it), this.hasNameErrorMessage(it));
+ };
+ items.forEach(_function);
+ }
+
+ @Test
+ public void OverrideNames() {
+ final EObject ac = this.res.getEObject("ActorClass:Override");
+ final EObject dc = this.res.getEObject("DataClass:DOverride");
+ final ArrayList<EObject> items = CollectionLiterals.<EObject>newArrayList(ac, dc);
+ EList<EObject> _eContents = ac.eContents();
+ Iterables.<EObject>addAll(items, _eContents);
+ EList<EObject> _eContents_1 = dc.eContents();
+ Iterables.<EObject>addAll(items, _eContents_1);
+ Assert.assertEquals("Unexpected item count", 9, items.size());
+ final Consumer<EObject> _function = (EObject it) -> {
+ Assert.assertFalse(("expected no name error: " + it), this.hasNameErrorMessage(it));
+ };
+ items.forEach(_function);
+ }
+
+ @Test
+ public void InheritedNames() {
+ final EObject ac = this.res.getEObject("ActorClass:Sub");
+ final EObject dc = this.res.getEObject("DataClass:DSub");
+ final ArrayList<EObject> items = CollectionLiterals.<EObject>newArrayList();
+ final Function1<EObject, Boolean> _function = (EObject it) -> {
+ return Boolean.valueOf((!(it instanceof ExternalPort)));
+ };
+ Iterable<EObject> _filter = IterableExtensions.<EObject>filter(ac.eContents(), _function);
+ Iterables.<EObject>addAll(items, _filter);
+ EList<EObject> _eContents = dc.eContents();
+ Iterables.<EObject>addAll(items, _eContents);
+ Assert.assertEquals("Unexpected item count", 13, items.size());
+ final Consumer<EObject> _function_1 = (EObject it) -> {
+ Assert.assertTrue(("expected name error: " + it), this.hasNameErrorMessage(it));
+ };
+ items.forEach(_function_1);
+ }
+
+ @Test
+ public void FlatNames() {
+ final EObject ac = this.res.getEObject("ActorClass:Flat");
+ final EObject dc = this.res.getEObject("DataClass:DFlat");
+ final EObject lc = this.res.getEObject("DataClass:LFlat");
+ final EObject sc = this.res.getEObject("DataClass:SFlat");
+ final EObject enum_ = this.res.getEObject("DataClass:EnumFlat");
+ final ArrayList<EObject> items = CollectionLiterals.<EObject>newArrayList();
+ final Function1<EObject, Boolean> _function = (EObject it) -> {
+ return Boolean.valueOf((!(it instanceof ExternalPort)));
+ };
+ Iterable<EObject> _filter = IterableExtensions.<EObject>filter(ac.eContents(), _function);
+ Iterables.<EObject>addAll(items, _filter);
+ EList<EObject> _eContents = dc.eContents();
+ Iterables.<EObject>addAll(items, _eContents);
+ EList<EObject> _eContents_1 = lc.eContents();
+ Iterables.<EObject>addAll(items, _eContents_1);
+ EList<EObject> _eContents_2 = sc.eContents();
+ Iterables.<EObject>addAll(items, _eContents_2);
+ EList<EObject> _eContents_3 = enum_.eContents();
+ Iterables.<EObject>addAll(items, _eContents_3);
+ Assert.assertEquals("Unexpected item count", 16, items.size());
+ final Consumer<EObject> _function_1 = (EObject it) -> {
+ Assert.assertTrue(("expected name error: " + it), this.hasNameErrorMessage(it));
+ };
+ items.forEach(_function_1);
+ }
+
+ private boolean hasNameErrorMessage(final EObject obj) {
+ return (this.nameErrorMap.containsKey(obj) && (this.nameErrorMap.get(obj)).booleanValue());
+ }
+
+ protected boolean isNameErrorMessage(final Diagnostic diag) {
+ final String message = diag.getMessage();
+ return ((diag.getSeverity() >= Diagnostic.ERROR) && (message.contains("Duplicate name") || (message.contains("Name") && message.contains("is already assigned to"))));
+ }
+}
diff --git a/tests/org.eclipse.etrice.generator.c.tests/.gitignore b/tests/org.eclipse.etrice.generator.c.tests/.gitignore
index b45c5f774..57f15dea9 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/.gitignore
+++ b/tests/org.eclipse.etrice.generator.c.tests/.gitignore
@@ -1 +1,7 @@
-src-gen/ \ No newline at end of file
+src-gen/
+bin
+models
+output
+results
+src-gen
+log
diff --git a/tests/org.eclipse.etrice.generator.c.tests/org.eclipse.etrice.generator.c.tests make.xml.launch b/tests/org.eclipse.etrice.generator.c.tests/org.eclipse.etrice.generator.c.tests make.xml.launch
new file mode 100644
index 000000000..82407cfc0
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.c.tests/org.eclipse.etrice.generator.c.tests make.xml.launch
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.c.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES">
+<mapEntry key="com.google.guava" value="${target_platform_plugin_location:com.google.guava}"/>
+<mapEntry key="com.google.inject" value="${target_platform_plugin_location:com.google.inject}"/>
+<mapEntry key="eclipse.home" value="${eclipse_home}"/>
+<mapEntry key="eclipse.pdebuild.home" value="${target_platform_plugin_location:org.eclipse.pde.build}"/>
+<mapEntry key="eclipse.pdebuild.scripts" value="${target_platform_plugin_location:org.eclipse.pde.build}/scripts/"/>
+<mapEntry key="eclipse.pdebuild.templates" value="${target_platform_plugin_location:org.eclipse.pde.build}/templates/"/>
+<mapEntry key="eclipse.running" value="true"/>
+<mapEntry key="javax.inject" value="${target_platform_plugin_location:javax.inject}"/>
+<mapEntry key="org.antlr.runtime" value="${target_platform_plugin_location:org.antlr.runtime}"/>
+<mapEntry key="org.apache.log4j" value="${target_platform_plugin_location:org.apache.log4j}"/>
+<mapEntry key="org.eclipse.emf.common" value="${target_platform_plugin_location:org.eclipse.emf.common}"/>
+<mapEntry key="org.eclipse.emf.ecore" value="${target_platform_plugin_location:org.eclipse.emf.ecore}"/>
+<mapEntry key="org.eclipse.emf.ecore.xmi" value="${target_platform_plugin_location:org.eclipse.emf.ecore.xmi}"/>
+<mapEntry key="org.eclipse.equinox.common" value="${target_platform_plugin_location:org.eclipse.equinox.common}"/>
+<mapEntry key="org.eclipse.xtend.lib" value="${target_platform_plugin_location:org.eclipse.xtend.lib}"/>
+<mapEntry key="org.eclipse.xtext" value="${target_platform_plugin_location:org.eclipse.xtext}"/>
+<mapEntry key="org.eclipse.xtext.common.types" value="${target_platform_plugin_location:org.eclipse.xtext.common.types}"/>
+<mapEntry key="org.eclipse.xtext.util" value="${target_platform_plugin_location:org.eclipse.xtext.util}"/>
+<mapEntry key="org.eclipse.xtext.xbase.lib" value="${target_platform_plugin_location:org.eclipse.xtext.xbase.lib}"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.generator.c.tests/make.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-v"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.generator.common.tests/common.xml b/tests/org.eclipse.etrice.generator.common.tests/common.xml
new file mode 100644
index 000000000..90d29d8a0
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/common.xml
@@ -0,0 +1,219 @@
+
+<?xml version="1.0"?>
+<project name="org.eclipse.etrice.generator.common.tests">
+
+ <target name="testing" depends="copyModels">
+
+ <!-- add test here, testid==testSuiteFileName -->
+ <test testid="ActorCommunicationTest" models="${models.path}/ActorCommunicationTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="ChoicePointTest" models="${models.path}/ChoicePointTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="ChoicePointTestExtended" models="${models.path}/ChoicePointTestExtended.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DataDrivenTest" models="${models.path}/DataDrivenTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="EnumTest" models="${models.path}/EnumTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="CompileTests" models="${models.path}/CompileTests.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="HandlerTest" models="${models.path}/HandlerTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="OperationInheritanceTest" models="${models.path}/OperationInheritanceTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="PingPongThreadTest" models="${models.path}/PingPongThreadTest.etmap" />
+ <test testid="PingPongThreadReplPortTest" models="${models.path}/PingPongThreadReplPortTest.etmap" />
+
+
+ <echo>done with ${ant.project.name}</echo>
+ </target>
+
+ <target name="copyModels" depends="setVars">
+ <copy todir="${models.path}">
+ <fileset dir="../org.eclipse.etrice.generator.common.tests/models"/>
+ </copy>
+ <copy todir="${models.path}" >
+ <fileset dir="${modellib.path}/model">
+ <include name="*.room"/>
+ <include name="*.etphys"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- ################################################################ -->
+
+ <!-- global properties -->
+ <!-- test.results, target.platform -->
+
+ <!-- private properties-->
+ <property name="models.path" value="./models"/>
+ <property name="testlog.path" value="./log/testlog"/>
+ <property name="output" value="./output"/>
+ <property name="bin.path" value="./bin"/>
+
+ <property name="run.msTimout" value="5000"/>
+
+ <!-- show ALL used variables -->
+ <target name="showVars">
+ <echo> ant.project.name = ${ant.project.name} </echo>
+ <echo> runtime.path = ${runtime.path} </echo>
+ <echo> testlog.path = ${testlog.path} </echo>
+ <echo> test.results = ${test.results} </echo>
+ <echo> output = ${output} </echo>
+ <echo> bin.path = ${bin.path} </echo>
+ <echo> target.platform = ${target.platform} </echo>
+ <echo> modellib.path = ${modellib.path} </echo>
+ <echo> models.path = ${models.path} </echo>
+ <echo> basedir = ${basedir} </echo>
+
+ <echo> org.eclipse.emf.ecore = ${org.eclipse.emf.ecore} </echo>
+ <echo> org.eclipse.emf.common = ${org.eclipse.emf.common} </echo>
+ <echo> org.eclipse.emf.ecore.xmi = ${org.eclipse.emf.ecore.xmi} </echo>
+ <echo> com.google.inject = ${com.google.inject} </echo>
+ <echo> com.google.guava = ${com.google.guava} </echo>
+ <echo> org.eclipse.equinox.common = ${org.eclipse.equinox.common} </echo>
+ <echo> org.eclipse.xtext = ${org.eclipse.xtext} </echo>
+ <echo> org.eclipse.xtext.util = ${org.eclipse.xtext.util} </echo>
+ <echo> org.eclipse.xtext.common.types = ${org.eclipse.xtext.common.types} </echo>
+ <echo> org.eclipse.xtend.lib = ${org.eclipse.xtend.lib} </echo>
+ <echo> org.eclipse.xtext.xbase.lib = ${org.eclipse.xtext.xbase.lib} </echo>
+ <echo> org.apache.log4j = ${org.apache.log4j} </echo>
+ <echo> org.antlr.runtime = ${org.antlr.runtime} </echo>
+ <echo> javax.inject = ${javax.inject} </echo>
+
+ <pathconvert property="classpathProp" refid="etrice.clspath"/>
+ <echo> etrice.clspath = ${classpathProp} </echo>
+ </target>
+
+ <!-- set global properties if not set-->
+ <target name="set_local_tr" unless="test.results">
+ <property name="test.results" value="./results"/>
+ </target>
+ <target name="set_local_tp" unless="target.platform">
+ <property name="target.platform" value="${eclipse.home}"/>
+ </target>
+
+ <target name="setVars" depends="set_local_tp,set_local_tr,set_etrice_clspath,showVars"/>
+
+ <target name="set_etrice_clspath">
+ <path id="etrice.clspath">
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.c/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.java/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.cpp/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.etunit.converter/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.fsm/bin" />
+ <pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.gnuplot/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.common/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.fsm/bin" />
+ <pathelement location="../../plugins/org.eclipse.etrice.core.room/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.etphys/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.etmap/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.config/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.core.genmodel/bin" />
+ <pathelement location="../../plugins/org.eclipse.etrice.core.genmodel.fsm/bin" />
+ <pathelement location="../../plugins/org.eclipse.etrice.core.genmodel/bin"/>
+
+ <!-- resolve dependencies using Oomph util in properties of launch config -->
+ <pathelement location="${org.eclipse.emf.ecore}"/>
+ <pathelement location="${org.eclipse.emf.common}"/>
+ <pathelement location="${org.eclipse.emf.ecore.xmi}"/>
+ <pathelement location="${com.google.inject}"/>
+ <pathelement location="${com.google.guava}"/>
+ <pathelement location="${org.eclipse.equinox.common}"/>
+ <pathelement location="${org.eclipse.xtext}"/>
+ <pathelement location="${org.eclipse.xtext.util}"/>
+ <pathelement location="${org.eclipse.xtext.common.types}"/>
+ <pathelement location="${org.eclipse.xtend.lib}"/>
+ <pathelement location="${org.eclipse.xtext.xbase.lib}"/>
+ <pathelement location="${org.apache.log4j}"/>
+ <pathelement location="${org.antlr.runtime}"/>
+ <pathelement location="${javax.inject}"/>
+
+ <!-- resolve if used from Buckminster Ant task -->
+ <fileset dir="${target.platform}/plugins/">
+ <include name="org.eclipse.emf.ecore_2.1*.jar" />
+ <include name="org.eclipse.emf.common_2.1*.jar" />
+ <include name="org.eclipse.emf.ecore.xmi_2.1*.jar" />
+ <include name="com.google.inject_*.jar" />
+ <include name="com.google.guava_1*.jar" />
+ <include name="org.eclipse.equinox.common_3.*.jar" />
+ <include name="org.apache.log4j_1.2*.jar" />
+ <include name="org.antlr.runtime_3.2*.jar" />
+ <include name="javax.inject_1.0*.jar" />
+
+ <!-- Xtext 2.6 -->
+ <include name="org.eclipse.xtext_2.6*.jar" />
+ <include name="org.eclipse.xtext.util_2.6*.jar" />
+ <include name="org.eclipse.xtext.common.types_2.6*.jar" />
+ <include name="org.eclipse.xtend.lib_2.6*.jar" />
+ <include name="org.eclipse.xtext.xbase.lib_2.6*.jar" />
+
+ <!-- Xtext 2.7 -->
+ <include name="org.eclipse.xtext_2.7*.jar" />
+ <include name="org.eclipse.xtext.util_2.7*.jar" />
+ <include name="org.eclipse.xtext.common.types_2.7*.jar" />
+ <include name="org.eclipse.xtend.lib_2.7*.jar" />
+ <include name="org.eclipse.xtext.xbase.lib_2.7*.jar" />
+
+ <!-- Xtext 2.8 -->
+ <include name="org.eclipse.xtext_2.8*.jar" />
+ <include name="org.eclipse.xtext.util_2.8*.jar" />
+ <include name="org.eclipse.xtext.common.types_2.8*.jar" />
+ <include name="org.eclipse.xtend.lib_2.8*.jar" />
+ <include name="org.eclipse.xtext.xbase.lib_2.8*.jar" />
+
+ <!-- Xtext 2.10 -->
+ <include name="org.eclipse.xtext_2.10*.jar" />
+ <include name="org.eclipse.xtext.util_2.10*.jar" />
+ <include name="org.eclipse.xtext.common.types_2.10*.jar" />
+ <include name="org.eclipse.xtend.lib_2.10*.jar" />
+ <include name="org.eclipse.xtext.xbase.lib_2.10*.jar" />
+ </fileset>
+ </path>
+ </target>
+
+ <!--
+ clean: deletes all folders created by this script
+ -->
+ <target name="clean" depends="setVars">
+ <delete dir="${testlog.path}"/>
+ <!--deletes resulst from other script on server <delete dir="${test.results}"/>-->
+ <delete dir="${output}"/>
+ <delete dir="${bin.path}"/>
+ <delete dir="${models.path}"/>
+ <delete dir="log"/>
+ <delete dir="src-gen"/>
+ </target>
+
+ <macrodef name="convert">
+ <attribute name="testId"/>
+ <sequential>
+ <java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="-suite"/>
+ <arg value="${ant.project.name}.@{testId}"/>
+ <arg value="${testlog.path}/@{testId}.etu"/>
+ <classpath refid="etrice.clspath"/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="convertPre">
+ <attribute name="testId"/>
+ <sequential>
+ <java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="-presuite"/>
+ <arg value="${ant.project.name}."/>
+ <arg value="${testlog.path}/@{testId}.etu"/>
+ <classpath refid="etrice.clspath"/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <!--
+ copy_results: copies the *.xml results to their final destination
+ -->
+ <macrodef name="copyResult">
+ <attribute name="testId"/>
+ <attribute name="targetId" default=""/>
+ <sequential>
+ <mkdir dir="${test.results}"/>
+ <move file="${testlog.path}/@{testId}.xml" tofile="${test.results}/@{targetId}@{testId}.xml"/>
+ </sequential>
+ </macrodef>
+
+</project> \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
index 9b51b0972..8948c557d 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
@@ -122,7 +122,7 @@ RoomModel ActorCommunicationTest {
}
action {
- //"System.out.println(\"Finish data\");"
+ //"System.out.println(\"Finish transitionData\");"
"data_finish_flag = true;"
"EXPECT_ORDER_END(data_caseId,\"<|MODEL_LOCATION|>\", 10);"
"etUnit_closeTestCase(data_caseId);"
@@ -178,18 +178,18 @@ RoomModel ActorCommunicationTest {
action {
"counter = data_counter.in1;"
- //"System.out.println(\"Async data \"+counter);"
+ //"System.out.println(\"Async transitionData \"+counter);"
"EXPECT_ORDER(data_counter.caseId,\"<|MODEL_LOCATION|>\", counter + 1050);"
}
}
Transition tr1: Idle -> Idle {
triggers {
<in1: event_counter guard {
- "data % 2 == 0 && data < 10"
+ "transitionData % 2 == 0 && transitionData < 10"
}>
}
action {
- "counter = data;"
+ "counter = transitionData;"
//"System.out.println(\"Async event \"+counter);"
"EXPECT_ORDER(data_counter.caseId,\"<|MODEL_LOCATION|>\", counter + 1000);"
@@ -198,7 +198,7 @@ RoomModel ActorCommunicationTest {
Transition tr2: Idle -> state0 {
triggers {
<in1: event_counter guard {
- "data == 10"
+ "transitionData == 10"
}>
}
action {
@@ -230,19 +230,19 @@ RoomModel ActorCommunicationTest {
Transition tr0: state0 -> state0 {
triggers {
<in1: event_counter guard {
- "data < 10"
+ "transitionData < 10"
}>
}
action {
- //"System.out.println(\"event \"+data);"
- "EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", data+100);"
+ //"System.out.println(\"event \"+transitionData);"
+ "EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", transitionData+100);"
}
}
Transition tr1: state0 -> state1 {
triggers {
<in1: event_counter guard {
- "data == 10"
+ "transitionData == 10"
}>
}
action {
@@ -254,7 +254,7 @@ RoomModel ActorCommunicationTest {
<caseId: event_counter>
}
action {
- "caseId = data;"
+ "caseId = transitionData;"
}
}
State state0
@@ -296,7 +296,7 @@ RoomModel ActorCommunicationTest {
action {
"counter = data_counter.in1;"
- //"System.out.println(\"data \"+counter);"
+ //"System.out.println(\"transitionData \"+counter);"
"EXPECT_ORDER(data_counter.caseId, \"<|MODEL_LOCATION|>\", counter);"
}
}
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
index fe184e51e..4eebae58f 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
@@ -29,7 +29,7 @@ RoomModel ChoicePointTestExtended {
<testInitialCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
}
}
Transition tr1: waiting -> waiting {
@@ -37,7 +37,7 @@ RoomModel ChoicePointTestExtended {
<setCaseId: navPort>
}
action {
- "caseId = id;"
+ "caseId = transitionData;"
}
}
State testSubState {
@@ -59,7 +59,7 @@ RoomModel ChoicePointTestExtended {
<testTrCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
}
}
@@ -68,7 +68,7 @@ RoomModel ChoicePointTestExtended {
<testTrCP0: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
}
}
Transition tr7: my tp0 -> cp cp0 {
@@ -76,7 +76,7 @@ RoomModel ChoicePointTestExtended {
<testTrCP1: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
}
}
@@ -120,7 +120,7 @@ RoomModel ChoicePointTestExtended {
Transition tr4: my tp1 -> simpleState {
triggers {
<toNode: navPort guard {
- "id == 1"
+ "transitionData == 1"
}>
}
}
@@ -129,7 +129,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(10);"
"navPort.onMessage(100);"
@@ -140,7 +140,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(100);"
@@ -151,7 +151,7 @@ RoomModel ChoicePointTestExtended {
<testCP1: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(101);"
@@ -162,7 +162,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(10);"
"navPort.onMessage(100);"
@@ -173,7 +173,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(100);"
@@ -184,7 +184,7 @@ RoomModel ChoicePointTestExtended {
<testCP1: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(101);"
@@ -193,14 +193,14 @@ RoomModel ChoicePointTestExtended {
Transition tr13: my tp1 -> subState {
triggers {
<toNode: navPort guard {
- "id == 2"
+ "transitionData == 2"
}>
}
}
Transition tr14: my tp1 -> tp1 of exitPoints {
triggers {
<toNode: navPort guard {
- "id == 3"
+ "transitionData == 3"
}>
}
}
@@ -208,7 +208,7 @@ RoomModel ChoicePointTestExtended {
Transition tr16: my tp1 -> choicePoint {
triggers {
<toNode: navPort guard {
- "id==4"
+ "transitionData == 4"
}>
}
}
@@ -218,7 +218,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(10);"
"navPort.onMessage(100);"
@@ -239,7 +239,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(100);"
@@ -250,7 +250,7 @@ RoomModel ChoicePointTestExtended {
<testCP1: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(101);"
@@ -280,7 +280,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort0>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(10);"
"navPort.onMessage(100);"
@@ -291,7 +291,7 @@ RoomModel ChoicePointTestExtended {
<testCP0: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(100);"
@@ -302,7 +302,7 @@ RoomModel ChoicePointTestExtended {
<testCP1: testPort1>
}
action {
- "testValue = value;"
+ "testValue = transitionData;"
""
"navPort.onProtocol(11);"
"navPort.onMessage(101);"
@@ -406,7 +406,7 @@ RoomModel ChoicePointTestExtended {
<resultCP: navPort>
}
action {
- "check(value);"
+ "check(transitionData);"
}
}
Transition tr7: testTr -> testTr1 {
@@ -414,7 +414,7 @@ RoomModel ChoicePointTestExtended {
<resultCP: navPort>
}
action {
- "check(value);"
+ "check(transitionData);"
}
}
Transition tr8: testTr1 -> testTr2 {
@@ -422,7 +422,7 @@ RoomModel ChoicePointTestExtended {
<resultCP: navPort>
}
action {
- "check(value);"
+ "check(transitionData);"
}
}
Transition tr1: testTr2 -> triggerTest {
@@ -430,7 +430,7 @@ RoomModel ChoicePointTestExtended {
<onNode: navPort>
}
action {
- "check(id);"
+ "check(transitionData);"
}
}
Transition tr4: testPath -> testPath {
@@ -438,7 +438,7 @@ RoomModel ChoicePointTestExtended {
<onMessage: navPort>
}
action {
- "check(id);"
+ "check(transitionData);"
}
}
Transition tr5: testPath -> onCP {
@@ -446,7 +446,7 @@ RoomModel ChoicePointTestExtended {
<resultCP: navPort>
}
action {
- "check(value);"
+ "check(transitionData);"
}
}
Transition tr9: onCP -> triggerTest {
@@ -454,7 +454,7 @@ RoomModel ChoicePointTestExtended {
<onNode: navPort>
}
action {
- "check(id);"
+ "check(transitionData);"
}
}
Transition tr10: triggerTest -> testPath {
@@ -462,7 +462,7 @@ RoomModel ChoicePointTestExtended {
<onProtocol: navPort>
}
action {
- "check(id);"
+ "check(transitionData);"
}
}
State testInitial {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
index e17ab03dd..516c50d1e 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
@@ -93,7 +93,7 @@ RoomModel ContinuationTransitionTest {
}
Transition continuationExit: exitPoint of substate -> endExit {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, transitionData);"
}
}
Transition tr0: startEntry2 -> entryPoint of substate {
@@ -106,7 +106,7 @@ RoomModel ContinuationTransitionTest {
subgraph {
Transition continuationEntry: my entryPoint -> cp choicePoint {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition triggerExit: startExit1 -> my exitPoint {
@@ -116,7 +116,7 @@ RoomModel ContinuationTransitionTest {
}
Transition continuationCpElse: cp choicePoint -> startExit1 {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition continuationCpCond: cp choicePoint -> startExit2 {
@@ -124,7 +124,7 @@ RoomModel ContinuationTransitionTest {
"true"
}
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition triggerChoicePoint: my startChoicePoint -> cp choicePoint {
@@ -166,7 +166,7 @@ RoomModel ContinuationTransitionTest {
}
Transition continuationExit: exitPoint of substate -> endExit {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, transitionData);"
}
}
Transition tr0: startEntry2 -> entryPoint of substate {
@@ -179,7 +179,7 @@ RoomModel ContinuationTransitionTest {
subgraph {
Transition continuationEntry: my entryPoint -> cp choicePoint {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition triggerExit: startExit1 -> my exitPoint {
@@ -189,7 +189,7 @@ RoomModel ContinuationTransitionTest {
}
Transition continuationCpElse: cp choicePoint -> startExit1 {
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition continuationCpCond: cp choicePoint -> startExit2 {
@@ -197,7 +197,7 @@ RoomModel ContinuationTransitionTest {
"true"
}
action {
- "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, data);"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 1, transitionData);"
}
}
Transition triggerChoicePoint: my startChoicePoint -> cp choicePoint {
@@ -311,7 +311,7 @@ RoomModel ContinuationTransitionTest {
}
Transition tr1: cp cp0 -> state1 {
action {
- "int x = data1;"
+ "int x = transitionData;"
}
}
Transition tr2: cp cp0 -> state2 {
@@ -319,7 +319,7 @@ RoomModel ContinuationTransitionTest {
"true"
}
action {
- "int x = data1;"
+ "int x = transitionData;"
}
}
ChoicePoint cp0
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
index a3297bce9..2ff8d6533 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
@@ -29,7 +29,12 @@ RoomModel DetailExpressionTestModel {
triggers {
<out1: cPortEvent guard {
"/* TODO activate action code editor */"
+<<<<<<< Upstream, based on origin/master
"rPortData.in1 == numberArray[3] && accessibleMessageData && infoData.flag && actorOp(32) && rPortEvent.regularOp(32) && cPortEvent.conjugatedOp(32)"
+=======
+ "rPortData.in1 == numberArray[3] &&"
+ "transitionData && infoData.flag"
+>>>>>>> ff1be2e Bug 511330 - [core.genmodel.fsm] introduce simplified generator model for state machines
}>
}
action
@@ -53,7 +58,7 @@ RoomModel DetailExpressionTestModel {
"int port = infoData.nested.tcpPort;"
""
"// transition event data"
- "int data = (accessibleMessageData)? 1 : 0;"
+ "int data = (transitionData)? 1 : 0;"
""
"// -- not supported yet by code translation --"
"// getReplication():"
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
index 381ad7633..a43e615f2 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
@@ -43,7 +43,7 @@ RoomModel HandlerTest {
Transition tr1: my tp1 -> my tp1 {
triggers {
<msg1: TestPort1 guard {
- "p1==3"
+ "transitionData==3"
}>
}
action {
@@ -58,7 +58,7 @@ RoomModel HandlerTest {
Transition tr9: state0 -> cp cp1 {
triggers {
<msg1: TestPort1 guard {
- "p1==4"
+ "transitionData==4"
}>
}
action {
@@ -68,7 +68,7 @@ RoomModel HandlerTest {
Transition tr5: my tp1 -> my tp1 {
triggers {
<msg2: TestPort1 guard {
- "p1==4"
+ "transitionData==4"
}>
}
action {
@@ -78,7 +78,7 @@ RoomModel HandlerTest {
Transition tr7: my tp0 -> state0 {
triggers {
<msg1: TestPort1 guard {
- "p1==7"
+ "transitionData==7"
}>
}
action {
@@ -88,7 +88,7 @@ RoomModel HandlerTest {
Transition tr6: my tp0 -> my tp0 {
triggers {
<msg1: TestPort1 guard {
- "p1==12"
+ "transitionData==12"
}>
}
action {
@@ -102,7 +102,7 @@ RoomModel HandlerTest {
}
Transition tr10: cp cp1 -> state0 {
cond {
- "p1!=4"
+ "transitionData!=4"
}
action {
"EXPECT_ORDER(caseId, \"<|MODEL_LOCATION|>\", 115);"
@@ -164,7 +164,7 @@ RoomModel HandlerTest {
Transition tr5: my tp0 -> my tp0 {
triggers {
<msg1: TestPort1 guard {
- "p1==5"
+ "transitionData==5"
}>
}
action {
@@ -179,7 +179,7 @@ RoomModel HandlerTest {
Transition tr6: state1 -> state1 {
triggers {
<msg1: TestPort1 guard {
- "p1==8"
+ "transitionData==8"
}>
}
action {
@@ -189,7 +189,7 @@ RoomModel HandlerTest {
Transition tr7: my tp1 -> state1 {
triggers {
<msg2: TestPort1 guard {
- "p1==5"
+ "transitionData==5"
}>
}
action {
@@ -199,7 +199,7 @@ RoomModel HandlerTest {
Transition tr8: my tp1 -> state2 {
triggers {
<msg2: TestPort1 guard {
- "p1==6"
+ "transitionData==6"
}>
}
action {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room
new file mode 100644
index 000000000..67e47ef7e
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room
@@ -0,0 +1,605 @@
+RoomModel SendingDataTestCpp {
+
+ import room.basic.etunit.* from "../Tests.room"
+ import room.basic.types.* from "../Types.room"
+ import room.basic.language.* from "../Language.room"
+
+ ActorClass SendingDataTop {
+ @TestInstance
+ Structure {
+ ActorRef mrPing: MrPing
+ ActorRef mrPong: MrPong
+ Binding mrPong.PingPongPort and mrPing.PingPongPort
+ }
+ Behavior { }
+ }
+
+ ActorClass MrPong {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ Port extTest: PCExternal
+ }
+ Structure {
+ external Port PingPongPort
+ external Port extTest
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: reply -> reply {
+ triggers {
+ <pingInt16: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt16(transitionData);"
+ }
+ }
+ Transition tr1: reply -> reply {
+ triggers {
+ <pingInt8: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt8(transitionData);"
+ }
+ }
+ Transition init: initial -> reply { }
+ Transition tr2: reply -> reply {
+ triggers {
+ <pingInt32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt32(transitionData);"
+ }
+ }
+ Transition tr3: reply -> reply {
+ triggers {
+ <pingFloat32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat32(transitionData);"
+ }
+ }
+ Transition tr4: reply -> reply {
+ triggers {
+ <pingFloat64: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat64(transitionData);"
+ }
+ }
+ Transition tr7: reply -> cp cp0 {
+ triggers {
+ <pingInt32Ref: PingPongPort guard {
+ "(*transitionData)!=0"
+ }>
+ }
+ }
+ Transition tr8: cp cp0 -> reply {
+ action {
+ "PingPongPort.pongInt32((*transitionData)+10);"
+ }
+ }
+ Transition tr6: cp cp0 -> reply {
+ cond {
+ "(*transitionData)!=5"
+ }
+ action {
+ "PingPongPort.pongInt32(*transitionData);"
+ }
+ }
+ Transition tr9: reply -> reply {
+ triggers {
+ <pingComplex: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr11: reply -> reply {
+ triggers {
+ <pingComplexRef: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplex(*transitionData);"
+ }
+ }
+ Transition tr5: reply -> reply {
+ triggers {
+ <pingInt64: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt64(transitionData);"
+ }
+ }
+ Transition tr10: reply -> reply {
+ triggers {
+ <pingInt16Ref: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt16(*transitionData);"
+ }
+ }
+ Transition tr12: reply -> cp cp1 {
+ triggers {
+ <pingComplexRef: PingPongPort guard {
+ "transitionData->i8ValPPD == 5"
+ }>
+ }
+ action {
+ "PingPongPort.pongComplex(*transitionData);"
+ }
+ }
+ Transition tr13: cp cp1 -> reply {
+ action {
+ "PingPongPort.pongComplex(*transitionData);"
+ }
+ }
+ Transition tr14: cp cp1 -> reply {
+ cond {
+ "transitionData->i8ValPPD==7"
+ }
+ action {
+ "PingPongPort.pongComplex(*transitionData);"
+ }
+ }
+ Transition tr15: reply -> reply {
+ triggers {
+ <pingComplexDerived: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplexDerived(transitionData);"
+ }
+ }
+ Transition tr16: my tp0 -> my tp0 {
+ triggers {
+ <in1: extTest>
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp1
+ TransitionPoint tp0
+ State reply
+ }
+ }
+ }
+
+ ActorClass MrPing {
+ Interface {
+ conjugated Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ Attribute i8Val: int8="5"
+ Attribute i16Val:int16="19"
+ Attribute i32Val: int32 = "4711"
+ Attribute i64Val: int64 = "11470815"
+ Attribute i32Array [ 10 ]: int32 = "{0,1,2,3,4,5,6,7,8,9}"
+ Attribute f32Val: float32="3.14f"
+ Attribute f64Val: float64="7.987654321"
+ Attribute data: PingPongData
+ Attribute dataD: PingPongDataDerived
+ Attribute counter:int32
+ Attribute caseId: int32
+ Attribute lang: languageIndicator
+ Attribute resultlist [ 23 ]: int16 = "{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}"
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> tp0 of state0 {
+ action {
+ "caseId = etUnit_openAll(\"log/testlog\", \"SendingDataTestCpp\", \"org.eclipse.etrice.generator.common.tests.SendingDataTest\", \"SendingDataTest_case\");"
+ "EXPECT_ORDER_START(caseId,resultlist,23);"
+ "EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 1);"
+ "/* send the default values */"
+ ""
+ "PingPongPort.pingInt8(i8Val);"
+ "PingPongPort.pingInt16(i16Val);"
+ "PingPongPort.pingInt32(i32Val);"
+ "PingPongPort.pingInt64(i64Val);"
+ "PingPongPort.pingFloat32(f32Val);"
+ "PingPongPort.pingFloat64(f64Val);"
+ "PingPongPort.pingInt16Ref(&i16Val);"
+ "PingPongPort.pingInt32Ref(&i32Val);"
+ "i8Val++;"
+ "i16Val++;"
+ "i32Val++;"
+ "i64Val++;"
+ "f32Val+=10.1;"
+ "f64Val+=20.2;"
+ "PingPongPort.pingInt8(i8Val);"
+ "PingPongPort.pingInt16(i16Val);"
+ "PingPongPort.pingInt32(i32Val);"
+ "PingPongPort.pingInt64(i64Val);"
+ "PingPongPort.pingFloat32(f32Val);"
+ "PingPongPort.pingFloat64(f64Val);"
+ "PingPongPort.pingInt16Ref(&i16Val);"
+ "PingPongPort.pingInt32Ref(&i32Val);"
+ }
+ }
+ Transition tr0: tp1 of state0 -> tp0 of state1
+ Transition tr1: tp1 of state1 -> test_finished
+ State state0 {
+ subgraph {
+ Transition tr0: my tp0 -> receiveFirst7 {
+ action {
+ "counter=0;"
+ }
+ }
+ Transition tr1: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt8: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==5){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr2: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt16: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==19){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 3);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr3: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==4711){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 4);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr4: receiveFirst7 -> receiveSecond7 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "counter==7"
+ }>
+ }
+ action {
+ "counter=0;"
+ "if (lang == 1){"
+ "/* Java cannot send references of primitive types */"
+ "\tif (transitionData==4711){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "} "
+ "if (lang == 2){"
+ "/* C */"
+ "\tif (transitionData==4712){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "}"
+ }
+ }
+ Transition tr6: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==11470815){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 5);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr5: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongFloat32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>3)&&(transitionData<4)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 6);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr7: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongFloat64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>7)&&(transitionData<8)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 7);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr8: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt8: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==6){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 10);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr9: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt16: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==20){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 11);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr10: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==4712){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 12);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr11: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==11470816){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 13);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr12: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongFloat32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>13)&&(transitionData<14)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 14);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr13: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongFloat64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>28)&&(transitionData<29)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 15);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr14: receiveSecond7 -> my tp1 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "counter==7"
+ }>
+ }
+ action {
+ "if (transitionData==4712){\t"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 17);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr15: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt16: PingPongPort guard {
+ "counter==6"
+ }>
+ }
+ action {
+ "counter++;"
+ "if (lang == 1){"
+ "/* Java cannot send references of primitive types */"
+ "\tif (transitionData==19){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "} "
+ "if (lang == 2){"
+ "/* C */"
+ "\tif (transitionData==20){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "}"
+ }
+ }
+ Transition tr16: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt16: PingPongPort guard {
+ "counter==6"
+ }>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==20){\t"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 16);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State receiveFirst7
+ State receiveSecond7
+ }
+ }
+ State test_finished {
+ entry {
+ "EXPECT_ORDER_END(caseId,\"<|MODEL_LOCATION|>\", 23);"
+ "etUnit_closeAll(caseId);"
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State state1 {
+ subgraph {
+ Transition tr0: my tp0 -> state0 {
+ action {
+ "counter=0;"
+ "/* send default values */"
+ "PingPongPort.pingComplex(data);"
+ "PingPongPort.pingComplexRef(&data);"
+ }
+ }
+ Transition tr1: state0 -> state1 {
+ triggers {
+ <pongComplex: PingPongPort guard {
+ "counter==1"
+ }>
+ }
+ action {
+ "counter=0;"
+ "if (transitionData.i8ValPPD==10){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 19);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "if (transitionData.complexVal.i32Val2PPDD==80){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 20);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "dataD.i8ValPPD=11;"
+ "PingPongPort.pingComplexDerived(dataD);"
+ }
+ }
+ Transition tr2: state0 -> state0 {
+ triggers {
+ <pongComplex: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData.i8ValPPD==10){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 18);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr3: state1 -> my tp1 {
+ triggers {
+ <pongComplexDerived: PingPongPort>
+ }
+ action {
+ "if (transitionData.i8ValPPD==11){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 21);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "if (transitionData.i32Val3PPDe==150){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 22);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message pingInt8(d: int8)
+ Message pingInt16(d: int16)
+ Message pingInt32(d: int32)
+ Message pingInt64(d: int64)
+ Message pingFloat32(d: float32)
+ Message pingFloat64(d: float64)
+ Message pingInt16Ref(d: int16 ref)
+ Message pingInt32Ref(d: int32 ref)
+ Message pingComplex(d: PingPongData)
+ Message pingComplexRef(d: PingPongData ref)
+ Message pingComplexDerived(d:PingPongDataDerived)
+ }
+ outgoing {
+ Message pongInt8(d: int8)
+ Message pongInt16(d: int16)
+ Message pongInt32(d: int32)
+ Message pongInt64(d:int64)
+ Message pongFloat32(d: float32)
+ Message pongFloat64(d: float64)
+ Message pongComplex(d: PingPongData)
+ Message pongComplexDerived(d: PingPongDataDerived)
+ }
+ }
+
+ ProtocolClass PCExternal {
+ usercode1 {
+ "typedef int extMsg;"
+ }
+ incoming {
+ Message in1(can: DExtMsg)
+ }
+ }
+
+ DataClass PingPongData {
+ Attribute i8ValPPD: int8 = "10"
+ Attribute i8ValRefPPD: int8 ref
+ Attribute i32ArrayPPD [ 3 ]: int32 = "{200,300,400}"
+ Attribute i8ArrayRefPPD [ 2 ]: int8 ref
+ Attribute complexVal: PingPongDataDeep
+ }
+
+ DataClass PingPongDataDeep {
+ Attribute i32Val1PPDD: int32
+ Attribute i32Val2PPDD: int32 = "80"
+ }
+
+ DataClass PingPongDataDerived extends PingPongData {
+ Attribute i32Val3PPDe: int32 = "150"
+ }
+
+ ExternalType DExtMsg -> "extMsg"
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room
new file mode 100644
index 000000000..e71238b9b
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room
@@ -0,0 +1,586 @@
+RoomModel SendingDataTestJava {
+
+ import room.basic.etunit.* from "../Tests.room"
+ import room.basic.types.* from "../Types.room"
+ import room.basic.language.* from "../Language.room"
+
+ ActorClass SendingDataTop {
+ @TestInstance
+ Structure {
+ ActorRef mrPing: MrPing
+ ActorRef mrPong: MrPong
+ Binding mrPong.PingPongPort and mrPing.PingPongPort
+ }
+ Behavior { }
+ }
+
+ ActorClass MrPong {
+ Interface {
+ Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ }
+ Behavior {
+ StateMachine {
+ Transition tr0: reply -> reply {
+ triggers {
+ <pingInt16: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt16(transitionData);"
+ }
+ }
+ Transition tr1: reply -> reply {
+ triggers {
+ <pingInt8: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt8(transitionData);"
+ }
+ }
+ Transition init: initial -> reply { }
+ Transition tr2: reply -> reply {
+ triggers {
+ <pingInt32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt32(transitionData);"
+ }
+ }
+ Transition tr3: reply -> reply {
+ triggers {
+ <pingFloat32: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat32(transitionData);"
+ }
+ }
+ Transition tr4: reply -> reply {
+ triggers {
+ <pingFloat64: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongFloat64(transitionData);"
+ }
+ }
+ Transition tr7: reply -> cp cp0 {
+ triggers {
+ <pingInt32Ref: PingPongPort guard {
+ "transitionData!=0"
+ }>
+ }
+ }
+ Transition tr8: cp cp0 -> reply {
+ action {
+ "PingPongPort.pongInt32(transitionData+10);"
+ }
+ }
+ Transition tr6: cp cp0 -> reply {
+ cond {
+ "transitionData!=5"
+ }
+ action {
+ "PingPongPort.pongInt32(transitionData);"
+ }
+ }
+ Transition tr9: reply -> reply {
+ triggers {
+ <pingComplex: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr11: reply -> reply {
+ triggers {
+ <pingComplexRef: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr5: reply -> reply {
+ triggers {
+ <pingInt64: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt64(transitionData);"
+ }
+ }
+ Transition tr10: reply -> reply {
+ triggers {
+ <pingInt16Ref: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongInt16(transitionData);"
+ }
+ }
+ Transition tr12: reply -> cp cp1 {
+ triggers {
+ <pingComplexRef: PingPongPort guard {
+ "transitionData.i8Val == 5"
+ }>
+ }
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr13: cp cp1 -> reply {
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr14: cp cp1 -> reply {
+ cond {
+ "transitionData.i8Val==7"
+ }
+ action {
+ "PingPongPort.pongComplex(transitionData);"
+ }
+ }
+ Transition tr15: reply -> reply {
+ triggers {
+ <pingComplexDerived: PingPongPort>
+ }
+ action {
+ "PingPongPort.pongComplexDerived(transitionData);"
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp1
+ State reply
+ }
+ }
+ }
+
+ ActorClass MrPing {
+ Interface {
+ conjugated Port PingPongPort: PingPongProtocol
+ }
+ Structure {
+ external Port PingPongPort
+ Attribute i8Val: int8="5"
+ Attribute i16Val:int16="19"
+ Attribute i32Val: int32 = "4711"
+ Attribute i64Val: int64 = "11470815"
+ Attribute i32Array [ 10 ]: int32="{0,1,2,3,4,5,6,7,8,9}"
+ Attribute f32Val: float32="3.14"
+ Attribute f64Val: float64="7.987654321"
+ Attribute data: PingPongData
+ Attribute dataD: PingPongDataDerived
+ Attribute counter:int32
+ Attribute caseId: int32
+ Attribute lang: languageIndicator
+ Attribute resultlist [ 18 ]: int16 = "{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}"
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> tp0 of state0 {
+ action {
+ "caseId = etUnit_openAll(\"log/testlog\", \"SendingDataTestJava\", \"org.eclipse.etrice.generator.common.tests.SendingDataTest\", \"SendingDataTest_case\");"
+ "EXPECT_ORDER_START(caseId,resultlist,23);"
+ "EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 1);"
+ "// send the default values"
+ ""
+ "PingPongPort.pingInt8(i8Val);"
+ "PingPongPort.pingInt16(i16Val);"
+ "PingPongPort.pingInt32(i32Val);"
+ "PingPongPort.pingInt64(i64Val);"
+ "PingPongPort.pingFloat32(f32Val);"
+ "PingPongPort.pingFloat64(f64Val);"
+ "PingPongPort.pingInt16Ref(i16Val);"
+ "PingPongPort.pingInt32Ref(i32Val);"
+ "i8Val++;"
+ "i16Val++;"
+ "i32Val++;"
+ "i64Val++;"
+ "f32Val+=10.1;"
+ "f64Val+=20.2;"
+ "PingPongPort.pingInt8(i8Val);"
+ "PingPongPort.pingInt16(i16Val);"
+ "PingPongPort.pingInt32(i32Val);"
+ "PingPongPort.pingInt64(i64Val);"
+ "PingPongPort.pingFloat32(f32Val);"
+ "PingPongPort.pingFloat64(f64Val);"
+ "PingPongPort.pingInt16Ref(i16Val);"
+ "PingPongPort.pingInt32Ref(i32Val);"
+ }
+ }
+ Transition tr0: tp1 of state0 -> tp0 of state1
+ Transition tr1: tp1 of state1 -> test_finished
+ State state0 {
+ subgraph {
+ Transition tr0: my tp0 -> receiveFirst7 {
+ action {
+ "counter=0;"
+ }
+ }
+ Transition tr1: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt8: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==5){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr2: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt16: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==19){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 3);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr3: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==4711){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 4);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr4: receiveFirst7 -> receiveSecond7 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "counter==7"
+ }>
+ }
+ action {
+ "counter=0;"
+ "if (lang == 1){"
+ "// Java cannot send references of primitive types"
+ "\tif (transitionData==4711){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "} "
+ "if (lang == 2){"
+ "// C"
+ "\tif (transitionData==4712){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "}"
+ }
+ }
+ Transition tr6: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==11470815){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 5);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr5: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongFloat32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>3)&&(transitionData<4)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 6);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr7: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongFloat64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>7)&&(transitionData<8)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 7);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr8: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt8: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==6){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 10);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr9: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt16: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==20){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 11);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr10: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==4712){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 12);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr11: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==11470816){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 13);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr12: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongFloat32: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>13)&&(transitionData<14)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 14);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr13: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongFloat64: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if ((transitionData>28)&&(transitionData<29)){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 15);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr14: receiveSecond7 -> my tp1 {
+ triggers {
+ <pongInt32: PingPongPort guard {
+ "counter==7"
+ }>
+ }
+ action {
+ "if (transitionData==4712){\t"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 17);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr15: receiveFirst7 -> receiveFirst7 {
+ triggers {
+ <pongInt16: PingPongPort guard {
+ "counter==6"
+ }>
+ }
+ action {
+ "counter++;"
+ "if (lang == 1){"
+ "// Java cannot send references of primitive types"
+ "\tif (transitionData==19){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "} "
+ "if (lang == 2){"
+ "// C"
+ "\tif (transitionData==20){\t"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
+ "\t}else{"
+ "\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "\t}"
+ "}"
+ }
+ }
+ Transition tr16: receiveSecond7 -> receiveSecond7 {
+ triggers {
+ <pongInt16: PingPongPort guard {
+ "counter==6"
+ }>
+ }
+ action {
+ "counter++;"
+ "if (transitionData==20){\t"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 16);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State receiveFirst7
+ State receiveSecond7
+ }
+ }
+ State test_finished {
+ entry {
+ "EXPECT_ORDER_END(caseId,\"<|MODEL_LOCATION|>\", 23);"
+ "etUnit_closeAll(caseId);"
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State state1 {
+ subgraph {
+ Transition tr0: my tp0 -> state0 {
+ action {
+ "counter=0;"
+ "// send default values"
+ "PingPongPort.pingComplex(data);"
+ "PingPongPort.pingComplexRef(data);"
+ }
+ }
+ Transition tr1: state0 -> state1 {
+ triggers {
+ <pongComplex: PingPongPort guard {
+ "counter==1"
+ }>
+ }
+ action {
+ "counter=0;"
+ "if (transitionData.i8Val==10){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 19);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "if (transitionData.complexVal.i32Val2==80){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 20);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "dataD.i8Val=11;"
+ "PingPongPort.pingComplexDerived(dataD);"
+ }
+ }
+ Transition tr2: state0 -> state0 {
+ triggers {
+ <pongComplex: PingPongPort>
+ }
+ action {
+ "counter++;"
+ "if (transitionData.i8Val==10){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 18);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ Transition tr3: state1 -> my tp1 {
+ triggers {
+ <pongComplexDerived: PingPongPort>
+ }
+ action {
+ "if (transitionData.i8Val==11){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 21);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ ""
+ "if (transitionData.i32Val3==150){"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 22);"
+ "}else{"
+ "\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "}"
+ }
+ }
+ EntryPoint tp0
+ ExitPoint tp1
+ State state0
+ State state1
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PingPongProtocol {
+ incoming {
+ Message pingInt8(d: int8)
+ Message pingInt16(d: int16)
+ Message pingInt32(d: int32)
+ Message pingInt64(d: int64)
+ Message pingFloat32(d: float32)
+ Message pingFloat64(d: float64)
+ Message pingInt16Ref(d: int16 ref)
+ Message pingInt32Ref(d: int32 ref)
+ Message pingComplex(d: PingPongData)
+ Message pingComplexRef(d: PingPongData ref)
+ Message pingComplexDerived(d:PingPongDataDerived)
+ }
+ outgoing {
+ Message pongInt8(d: int8)
+ Message pongInt16(d: int16)
+ Message pongInt32(d: int32)
+ Message pongInt64(d:int64)
+ Message pongFloat32(d: float32)
+ Message pongFloat64(d: float64)
+ Message pongComplex(d: PingPongData)
+ Message pongComplexDerived(d: PingPongDataDerived)
+ }
+ }
+
+ DataClass PingPongData {
+ Attribute i8Val: int8 = "10"
+ Attribute i8ValRef: int8 ref
+ Attribute i32Array [ 3 ]: int32 = "{200,300,400}"
+ Attribute i8ArrayRef [ 2 ]: int8 ref
+ Attribute complexVal: PingPongDataDeep
+ }
+
+ DataClass PingPongDataDeep {
+ Attribute i32Val1: int32
+ Attribute i32Val2: int32 = "80"
+ }
+
+ DataClass PingPongDataDerived extends PingPongData {
+ Attribute i32Val3: int32 = "150"
+ }
+}
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore b/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore
index b45c5f774..57f15dea9 100644
--- a/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/.gitignore
@@ -1 +1,7 @@
-src-gen/ \ No newline at end of file
+src-gen/
+bin
+models
+output
+results
+src-gen
+log
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/org.eclipse.etrice.generator.cpp.tests make.xml.launch b/tests/org.eclipse.etrice.generator.cpp.tests/org.eclipse.etrice.generator.cpp.tests make.xml.launch
new file mode 100644
index 000000000..dd7cac532
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/org.eclipse.etrice.generator.cpp.tests make.xml.launch
@@ -0,0 +1,38 @@
+
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.generator.cpp.tests/make.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.cpp.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES">
+<mapEntry key="com.google.guava" value="${target_platform_plugin_location:com.google.guava}"/>
+<mapEntry key="com.google.inject" value="${target_platform_plugin_location:com.google.inject}"/>
+<mapEntry key="eclipse.home" value="${eclipse_home}"/>
+<mapEntry key="eclipse.pdebuild.home" value="${target_platform_plugin_location:org.eclipse.pde.build}"/>
+<mapEntry key="eclipse.pdebuild.scripts" value="${target_platform_plugin_location:org.eclipse.pde.build}/scripts/"/>
+<mapEntry key="eclipse.pdebuild.templates" value="${target_platform_plugin_location:org.eclipse.pde.build}/templates/"/>
+<mapEntry key="eclipse.running" value="true"/>
+<mapEntry key="javax.inject" value="${target_platform_plugin_location:javax.inject}"/>
+<mapEntry key="org.antlr.runtime" value="${target_platform_plugin_location:org.antlr.runtime}"/>
+<mapEntry key="org.apache.log4j" value="${target_platform_plugin_location:org.apache.log4j}"/>
+<mapEntry key="org.eclipse.emf.common" value="${target_platform_plugin_location:org.eclipse.emf.common}"/>
+<mapEntry key="org.eclipse.emf.ecore" value="${target_platform_plugin_location:org.eclipse.emf.ecore}"/>
+<mapEntry key="org.eclipse.emf.ecore.xmi" value="${target_platform_plugin_location:org.eclipse.emf.ecore.xmi}"/>
+<mapEntry key="org.eclipse.equinox.common" value="${target_platform_plugin_location:org.eclipse.equinox.common}"/>
+<mapEntry key="org.eclipse.xtend.lib" value="${target_platform_plugin_location:org.eclipse.xtend.lib}"/>
+<mapEntry key="org.eclipse.xtext" value="${target_platform_plugin_location:org.eclipse.xtext}"/>
+<mapEntry key="org.eclipse.xtext.common.types" value="${target_platform_plugin_location:org.eclipse.xtext.common.types}"/>
+<mapEntry key="org.eclipse.xtext.util" value="${target_platform_plugin_location:org.eclipse.xtext.util}"/>
+<mapEntry key="org.eclipse.xtext.xbase.lib" value="${target_platform_plugin_location:org.eclipse.xtext.xbase.lib}"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="clean,all,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.generator.cpp.tests/make.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.generator.fsmtest.tests/org.eclipse.etrice.generator.fsmtest.tests.launch b/tests/org.eclipse.etrice.generator.fsmtest.tests/org.eclipse.etrice.generator.fsmtest.tests.launch
index d0e2dcf62..0fb1006df 100644
--- a/tests/org.eclipse.etrice.generator.fsmtest.tests/org.eclipse.etrice.generator.fsmtest.tests.launch
+++ b/tests/org.eclipse.etrice.generator.fsmtest.tests/org.eclipse.etrice.generator.fsmtest.tests.launch
@@ -10,6 +10,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/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.fsmtest.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/.gitignore b/tests/org.eclipse.etrice.generator.java.tests/.gitignore
index b45c5f774..04ab4331e 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/.gitignore
+++ b/tests/org.eclipse.etrice.generator.java.tests/.gitignore
@@ -1 +1,10 @@
-src-gen/ \ No newline at end of file
+src-gen/
+bin
+models
+output
+results
+src-gen
+log
+/tmp/
+/firstOpt.obj
+/secondOpt.obj
diff --git a/tests/org.eclipse.etrice.generator.java.tests/make.xml b/tests/org.eclipse.etrice.generator.java.tests/make.xml
new file mode 100644
index 000000000..bb84b48e3
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/make.xml
@@ -0,0 +1,130 @@
+
+<?xml version="1.0"?>
+<!--
+ Ant makefile for building and running of tests.
+
+ Includes common.xml from org.eclipse.etrice.generator.common.tests
+-->
+<project name="org.eclipse.etrice.generator.java.tests" basedir="." default="all">
+
+ <target name="testing" depends="dynamicActorTests,common.testing">
+
+ <!-- add test here, testid==testSuiteFileName -->
+ <test testid="TCPTest" models="${models.path}/TCPTest.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DynamicConfigTest" models="${models.path}/DynamicConfigTest.etmap ${models.path}/DynamicConfigTest.config"/>
+ <test testid="StaticConfigTest" models="${models.path}/staticConfig/StaticConfigTest.etmap ${models.path}/staticConfig/StaticConfigTest.config" />
+ <test testid="SendingDataTestJava" models="${models.path}/sendingData/SendingDataTestJava.room ${models.path}/GenericPhysical.etphys" />
+
+ <echo>done with ${ant.project.name}</echo>
+ </target>
+
+ <target name="dynamicActorTests">
+ <property name="genOptions" value="-persistable -storeDataObj"/>
+
+ <test testid="DynamicActorTest1" genOptions="${genOptions}" models="${models.path}/DynamicActorTest1.etmap" />
+ <test testid="DynamicActorTest2" genOptions="${genOptions}" models="${models.path}/DynamicActorTest2.etmap" />
+ <test testid="DynamicActorTest3" genOptions="${genOptions}" models="${models.path}/DynamicActorTest3.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DynamicActorTest4" genOptions="${genOptions}" models="${models.path}/DynamicActorTest4.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DynamicActorTest5" genOptions="${genOptions}" models="${models.path}/DynamicActorTest5.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DynamicActorTest6" genOptions="${genOptions}" models="${models.path}/DynamicActorTest6.room ${models.path}/GenericPhysical.etphys" />
+ <test testid="DynamicActorTest7" genOptions="${genOptions}" models="${models.path}/DynamicActorTest7.etmap" />
+ <test testid="StoreRestore" genOptions="${genOptions}" models="${models.path}/StoreRestore.room ${models.path}/GenericPhysical.etphys" />
+ </target>
+
+ <target name="copyModels" depends="common.copyModels">
+ <copy todir="${models.path}">
+ <fileset dir="./targetModels"/>
+ </copy>
+ <move file="${models.path}/staticConfig/StaticConfigTest_Java.room" toFile="${models.path}/staticConfig//StaticConfigTest.room" />
+ </target>
+
+ <!-- ################################################################ -->
+
+ <import file="../org.eclipse.etrice.generator.common.tests/common.xml" as="common"/>
+
+ <property name="modellib.path" value="../../runtime/org.eclipse.etrice.modellib.java" />
+ <property name="runtime.path" value="../../runtime/org.eclipse.etrice.runtime.java" />
+
+ <target name="all" depends="clean,copyModels,testing"/>
+
+ <!-- test := generate 1 executable, build, run, process results -->
+ <macrodef name="test">
+ <attribute name="testId"/>
+ <attribute name="models"/>
+ <attribute name="genOptions" default=""/>
+ <sequential>
+ <standaloneGenerator testId="@{testId}" models="@{models}" genOptions="@{genOptions}"/>
+ <build testId="@{testId}"/>
+ <run testId="@{testId}"/>
+ <convert testId="@{testId}"/>
+ <copyResult testId="@{testId}" targetId="Java_"/>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="standaloneGenerator">
+ <attribute name="testId"/>
+ <attribute name="models"/>
+ <attribute name="genOptions" default=""/>
+ <sequential>
+ <mkdir dir="${output}"/>
+ <java output="${output}/generate.txt" error="${output}/generate_err.txt" classname="org.eclipse.etrice.generator.java.Main" fork="true" failonerror="true">
+ <arg line="@{models}"/>
+ <arg value="-genDir"/><arg value="src-gen/@{testId}"/>
+ <arg value="-msc_instr" />
+ <arg line="@{genOptions}" />
+ <classpath refid="etrice.clspath" />
+ </java>
+ </sequential>
+ </macrodef>
+
+ <!--
+ compile: compiles the generated Java sources
+ -->
+ <macrodef name="build">
+ <attribute name="testId"/>
+ <sequential>
+ <mkdir dir="${bin.path}/@{testId}" />
+ <!-- ./src/xxx is optional, create it anyway to avoid error -->
+ <mkdir dir="./src/@{testId}" />
+ <record name="${basedir}/output/compile.txt" action="start"/>
+ <javac destdir="${bin.path}/@{testId}" source="1.6" classpath="${runtime.path}/target/classes" debug="off" verbose="off">
+ <src>
+ <pathelement location="src-gen/@{testId}" />
+ <pathelement location="src/@{testId}" />
+ </src>
+ </javac>
+ <record name="${basedir}/output/compile.txt" action="stop"/>
+ </sequential>
+ </macrodef>
+
+ <!--
+ run: runs all executables
+ -->
+ <macrodef name="run">
+ <attribute name="testId"/>
+ <sequential>
+ <mkdir dir="${testlog.path}" />
+ <!-- get runner class -->
+ <local name="runner.class"/>
+ <fileset id="runnerFileSet" dir="./src-gen/@{testId}">
+ <include name="**/*Runner.java"/>
+ </fileset>
+ <pathconvert property="runner.class">
+ <string>${toString:runnerFileSet}</string>
+ <chainedmapper>
+ <globmapper from="*.java" to="*"/>
+ <packagemapper from="*" to="*"/>
+ </chainedmapper>
+ </pathconvert>
+ <!--<echo>path of runner.java: ${toString:runnerFileSet}</echo>
+ <echo>runner path converted to class: ${runner.class}</echo>-->
+
+ <echo>run @{testId}</echo>
+ <java output="${output}/run@{testId}.txt" classname="${runner.class}" fork="true" failonerror="true" timeout="${run.msTimout}">
+ <arg value="-run_as_test" />
+ <classpath path="./bin/@{testId};${runtime.path}/target/classes;" />
+ </java>
+ </sequential>
+ </macrodef>
+
+</project>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/org.eclipse.etrice.generator.java.tests make.xml.launch b/tests/org.eclipse.etrice.generator.java.tests/org.eclipse.etrice.generator.java.tests make.xml.launch
new file mode 100644
index 000000000..b6e1066d7
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/org.eclipse.etrice.generator.java.tests make.xml.launch
@@ -0,0 +1,44 @@
+
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.etrice.generator.java.tests/make.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.java.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES">
+<mapEntry key="com.google.guava" value="${target_platform_plugin_location:com.google.guava}"/>
+<mapEntry key="com.google.inject" value="${target_platform_plugin_location:com.google.inject}"/>
+<mapEntry key="eclipse.home" value="${eclipse_home}"/>
+<mapEntry key="eclipse.pdebuild.home" value="${target_platform_plugin_location:org.eclipse.pde.build}"/>
+<mapEntry key="eclipse.pdebuild.scripts" value="${target_platform_plugin_location:org.eclipse.pde.build}/scripts/"/>
+<mapEntry key="eclipse.pdebuild.templates" value="${target_platform_plugin_location:org.eclipse.pde.build}/templates/"/>
+<mapEntry key="eclipse.running" value="true"/>
+<mapEntry key="javax.inject" value="${target_platform_plugin_location:javax.inject}"/>
+<mapEntry key="org.antlr.runtime" value="${target_platform_plugin_location:org.antlr.runtime}"/>
+<mapEntry key="org.apache.log4j" value="${target_platform_plugin_location:org.apache.log4j}"/>
+<mapEntry key="org.eclipse.emf.common" value="${target_platform_plugin_location:org.eclipse.emf.common}"/>
+<mapEntry key="org.eclipse.emf.ecore" value="${target_platform_plugin_location:org.eclipse.emf.ecore}"/>
+<mapEntry key="org.eclipse.emf.ecore.xmi" value="${target_platform_plugin_location:org.eclipse.emf.ecore.xmi}"/>
+<mapEntry key="org.eclipse.equinox.common" value="${target_platform_plugin_location:org.eclipse.equinox.common}"/>
+<mapEntry key="org.eclipse.xtend.lib" value="${target_platform_plugin_location:org.eclipse.xtend.lib}"/>
+<mapEntry key="org.eclipse.xtext" value="${target_platform_plugin_location:org.eclipse.xtext}"/>
+<mapEntry key="org.eclipse.xtext.common.types" value="${target_platform_plugin_location:org.eclipse.xtext.common.types}"/>
+<mapEntry key="org.eclipse.xtext.util" value="${target_platform_plugin_location:org.eclipse.xtext.util}"/>
+<mapEntry key="org.eclipse.xtext.xbase.lib" value="${target_platform_plugin_location:org.eclipse.xtext.xbase.lib}"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="clean,all,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/org.eclipse.etrice.generator.java.tests/make.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-v"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest1.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest1.room
new file mode 100644
index 000000000..eef0c5cdc
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest1.room
@@ -0,0 +1,182 @@
+RoomModel DynamicActorTest1 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ LogicalSystem JavaGenTests {
+ SubSystemRef da1Test : SubSystem_DynamicActorTest1
+ }
+
+ SubSystemClass SubSystem_DynamicActorTest1 {
+ ActorRef appl : Appl
+
+ LogicalThread defaultThread
+ }
+
+ ActorClass Appl {
+ Structure {
+ ActorRef cont: Container
+ }
+ Behavior { }
+ }
+
+ ActorClass Container {
+ Structure {
+ conjugated Port p0: PC
+ Attribute caseId: int32
+ optional ActorRef opt: Optional
+
+ Binding p0 and opt.p0
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest1\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest1\", \"DynamicActorTest1_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+
+ StateMachine {
+ Transition init: initial -> CreateOptional2 { }
+ Transition tr0: CreateOptional2 -> CreateOptional1 {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da1Test/appl/cont/opt/sub2/deep_sub\"));"
+ "opt.destroyOptionalActor();"
+ }
+ }
+ Transition tr2: CreateOptional1 -> ReceivedHelloAgain {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da1Test/appl/cont/opt/sub1\"));"
+ "opt.destroyOptionalActor();"
+ }
+ }
+ State CreateOptional2 {
+ entry {
+ "opt.createOptionalActor(\"Optional2\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State CreateOptional1 {
+ entry {
+ "opt.createOptionalActor(\"Optional1\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State ReceivedHelloAgain {
+ entry {
+ "IRTObject opt = getChild(\"opt\");"
+ "int size = opt.getChildren().size();"
+ ""
+ "// we expect the RTSystemPort and the InterfaceItemBroker"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, size);"
+ ""
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ }
+ }
+ }
+
+ // the class that is referenced as optional by the Container
+ // since it is abstract it just serves as an interface
+ abstract ActorClass Optional {
+ Interface {
+ Port p0: PC
+ }
+ Structure { }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional1 extends Optional {
+ Structure {
+ ActorRef sub1: AC1
+ Binding p0 and sub1.p0
+ }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional2 extends Optional {
+ Structure {
+ ActorRef sub2: AC2
+ Binding p0 and sub2.p0
+ }
+ Behavior { }
+ }
+
+ // the following actor classes are part of the possible optional instance sub trees
+
+ ActorClass AC1 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"AC1:\"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef deep_sub: AC3
+ Binding p0 and deep_sub.p0
+ }
+ Behavior { }
+ }
+
+ ActorClass AC3 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"AC3:\"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ // a simple protocol that is used to demonstrate that actors are connected
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest2.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest2.room
new file mode 100644
index 000000000..5e646ac99
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest2.room
@@ -0,0 +1,236 @@
+RoomModel DynamicActorTest2 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ LogicalSystem JavaGenTests {
+ SubSystemRef da2Test : SubSystem_DynamicActorTest2
+ }
+
+ SubSystemClass SubSystem_DynamicActorTest2 {
+ ActorRef appl : Appl
+
+ LogicalThread defaultThread
+ }
+
+ ActorClass Appl {
+ Structure {
+ ActorRef cont: Container
+ }
+ Behavior { }
+ }
+
+ ActorClass Container {
+ Structure {
+ conjugated Port p0[*]: PC
+ Attribute caseId: int32
+ optional ActorRef optarray[*]: Optional
+
+ Binding p0 and optarray.p0
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest2\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest2\", \"DynamicActorTest2_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+
+ StateMachine {
+ Transition init: initial -> CreateOptional2 { }
+ Transition tr0: CreateOptional2 -> CreateOptional1 {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
+ }
+ }
+ Transition tr2: CreateOptional1 -> ReceivedHelloAgain {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
+ }
+ }
+ Transition tr1: ReceivedHelloAgain -> Destroy0 {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
+ }
+ }
+ Transition tr3: Destroy0 -> Destroy1Create2 {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
+ }
+ }
+ Transition tr4: Destroy1Create2 -> Done {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:1/sub2/deep_sub\"));"
+ }
+ }
+ State CreateOptional2 {
+ entry {
+ "optarray.createOptionalActor(\"Optional2\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State CreateOptional1 {
+ entry {
+ "optarray.createOptionalActor(\"Optional1\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State ReceivedHelloAgain
+ State Destroy0 {
+ entry {
+ "optarray.destroyOptionalActor(0);"
+ "p0.sayHello();"
+ }
+ }
+ State Destroy1Create2 {
+ entry {
+ "optarray.destroyOptionalActor(1);"
+ ""
+ "IRTObject opt = getChild(\"optarray\");"
+ "int size = opt.getChildren().size();"
+ ""
+ "// we expect the RTSystemPort and the InterfaceItemBroker"
+ "EXPECT_EQUAL_INT32(caseId, \"<|MODEL_LOCATION|>\", 2, size);"
+ ""
+ "optarray.createOptionalActor(\"Optional2\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State Done {
+ entry {
+ "IRTObject opt = getChild(\"optarray\");"
+ "int size = opt.getChildren().size();"
+ ""
+ "// we expect the RTSystemPort and the InterfaceItemBroker"
+ "// plus an instance of Optional2"
+ "// plus 3 sub ports of RTSystemPort"
+ "EXPECT_EQUAL_INT32(caseId, \"<MODEL_LOCATION|>\", 6, size);"
+ ""
+ "// we grab the leaf actor of the optional sub tree"
+ "IRTObject leafActor = getObject(\"/JavaGenTests/da2Test/appl/cont/optarray/optarray:1/sub2/deep_sub\");"
+ "size = leafActor.getChildren().size();"
+ ""
+ "// we expect an RTSystemPort and p0"
+ "EXPECT_EQUAL_INT32(caseId, \"<MODEL_LOCATION|>\", 2, size);"
+ ""
+ "EXPECT_TRUE(caseId, \"<MODEL_LOCATION|>\", leafActor.getInstancePath().equals(\"/JavaGenTests/da2Test/appl/cont/optarray:1/sub2/deep_sub\"));"
+ ""
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ }
+ }
+ }
+
+ // the class that is referenced as optional by the Container
+ // since it is abstract it just serves as an interface
+ abstract ActorClass Optional {
+ Interface {
+ Port p0: PC
+ }
+ Structure { }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional1 extends Optional {
+ Structure {
+ ActorRef sub1: AC1
+ Binding p0 and sub1.p0
+ }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional2 extends Optional {
+ Structure {
+ ActorRef sub2: AC2
+ Binding p0 and sub2.p0
+ }
+ Behavior { }
+ }
+
+ // the following actor classes are part of the possible optional instance sub trees
+
+ ActorClass AC1 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"AC1:\"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef deep_sub: AC3
+ Binding p0 and deep_sub.p0
+ }
+ Behavior { }
+ }
+
+ ActorClass AC3 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"AC3:\"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ // a simple protocol that is used to demonstrate that actors are connected
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest3.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest3.room
new file mode 100644
index 000000000..c6244399a
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest3.room
@@ -0,0 +1,235 @@
+RoomModel DynamicActorTest3 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ ActorClass Appl {
+ @TestInstance
+ Structure {
+ ActorRef cont: Controller
+ }
+ Behavior { }
+ }
+
+ ActorClass Controller {
+ Structure {
+ conjugated Port pwrk: PWorker
+ conjugated Port opt: PC
+ Attribute caseId: int32
+ ActorRef worker: Worker
+ Binding pwrk and worker.fct
+ Binding opt and worker.opt
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest3\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest3\", \"DynamicActorTest3_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+ StateMachine {
+ Transition init: initial -> createOpt1 { }
+ Transition tr0: createOpt1 -> SendHello {
+ triggers {
+ <ok: pwrk>
+ }
+ }
+ Transition tr1: SendHello -> TryCreateInvalid {
+ triggers {
+ <hello: opt>
+ }
+ action {
+ "System.out.println(\"controller received \"+transitionData);"
+ }
+ }
+ Transition tr2: createOpt1 -> UnexpectedError {
+ triggers {
+ <error: pwrk>
+ }
+ }
+ Transition tr3: TryCreateInvalid -> ExpectedError {
+ triggers {
+ <error: pwrk>
+ }
+ }
+ State createOpt1 {
+ entry {
+ "pwrk.create(\"Optional1\");"
+ }
+ }
+ State SendHello {
+ entry {
+ "opt.sayHello();"
+ }
+ }
+ State TryCreateInvalid {
+ entry {
+ "pwrk.create(\"Optional\");"
+ }
+ }
+ State UnexpectedError
+ State ExpectedError {
+ entry {
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass Worker {
+ Interface {
+ Port fct: PWorker
+ Port opt: PC
+ }
+ Structure {
+ external Port fct
+ optional ActorRef optRef: Optional
+ Binding opt and optRef.p0
+ }
+ Behavior {
+ // this method prints the passed message and then dumps the object tree consisting of actors and ports
+ Operation dumpTree(msg: string) {
+ "System.out.println(msg);"
+ "System.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());"
+ }
+
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <create: fct>
+ }
+ action {
+ "if (optRef.createOptionalActor(transitionData, getThread()))"
+ "\tfct.ok();"
+ "else"
+ "\tfct.error();"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ // the class that is referenced as optional by the Worker
+ // since it is abstract it just serves as an interface
+ abstract ActorClass Optional {
+ Interface {
+ Port p0: PC
+ }
+ Structure { }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional1 extends Optional {
+ Structure {
+ ActorRef sub1: AC1
+ Binding p0 and sub1.p0
+ }
+ Behavior { }
+ }
+
+ // a sub class of Optional which is valid as optional actor
+ ActorClass Optional2 extends Optional {
+ Structure {
+ ActorRef sub2: AC2
+ Binding p0 and sub2.p0
+ }
+ Behavior { }
+ }
+
+ // the following actor classes are part of the possible optional instance sub trees
+
+ ActorClass AC1 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ conjugated Port hlp: PC
+ ActorRef helper: AC3
+ Binding hlp and helper.p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> AskHelper {
+ triggers {
+ <sayHello: p0>
+ }
+ }
+ Transition tr1: AskHelper -> Ready {
+ triggers {
+ <hello: hlp>
+ }
+ action {
+ "System.out.println(\"helper said \"+transitionData);"
+ "p0.hello(\"this is AC1, instance \"+getInstancePath());"
+ }
+ }
+ State Ready
+ State AskHelper {
+ entry {
+ "hlp.sayHello();"
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef deep_sub: AC3
+ Binding p0 and deep_sub.p0
+ }
+ Behavior { }
+ }
+
+ ActorClass AC3 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"this is AC3, instance \"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ // a simple protocol that is used to demonstrate that actors are connected
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+
+ ProtocolClass PWorker {
+ incoming {
+ Message create(ac: string)
+ }
+ outgoing {
+ Message ok()
+ Message error()
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest4.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest4.room
new file mode 100644
index 000000000..7affbda90
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest4.room
@@ -0,0 +1,97 @@
+RoomModel DynamicActorTest4 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ ActorClass Appl {
+ @TestInstance
+ Structure {
+ ActorRef cont: Container
+ }
+ Behavior { }
+ }
+
+ ActorClass Container {
+ Structure {
+ conjugated Port p0: PC
+ Attribute caseId: int32
+ optional ActorRef opt: Optional
+
+ Binding p0 and opt.p0
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest4\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest4\", \"DynamicActorTest4_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+
+ // this method prints the passed message and then dumps the object tree consisting of actors and ports
+ Operation dumpTree(msg: string) {
+ "System.out.println(msg);"
+ "System.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());"
+ }
+
+ StateMachine {
+ Transition init: initial -> CreateOptional { }
+ Transition tr0: CreateOptional -> Done {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "System.out.println(transitionData+\"\\n\");"
+ "opt.destroyOptionalActor();"
+ "dumpTree(\"after deletion of Optional2\");"
+ }
+ }
+ State CreateOptional {
+ entry {
+ "opt.createOptionalActor(\"Optional\", getThread());"
+ "p0.sayHello();"
+ }
+ }
+ State Done {
+ entry {
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ }
+ }
+ }
+
+ // the class that is referenced as optional by the Container
+ // It has an external end port and implements the behavior itself
+ ActorClass Optional {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: p0>
+ }
+ action {
+ "p0.hello(\"this is AC1, instance \"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ // a simple protocol that is used to demonstrate that actors are connected
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest5.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest5.room
new file mode 100644
index 000000000..795306dc0
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest5.room
@@ -0,0 +1,149 @@
+RoomModel DynamicActorTest5 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ ActorClass Appl {
+ @TestInstance
+ Structure {
+ ActorRef cont: Container
+ }
+ Behavior { }
+ }
+
+ ActorClass Container {
+ Structure {
+ conjugated Port p0: PC
+ Attribute caseId: int32
+ optional ActorRef opt: Optional2
+
+ Binding p0 and opt.p0
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest5\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest5\", \"DynamicActorTest5_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+
+ // this method prints the passed message and then dumps the object tree consisting of actors and ports
+ Operation dumpTree(msg: string) {
+ "System.out.println(msg);"
+ "System.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());"
+ }
+
+ StateMachine {
+ Transition init: initial -> CreateOptional2 { }
+ Transition tr0: CreateOptional2 -> Done {
+ triggers {
+ <hello: p0>
+ }
+ action {
+ "dumpTree(\"after received hello\");"
+ ""
+ "System.out.println(\"received \"+transitionData);"
+ ""
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State CreateOptional2 {
+ entry {
+ "opt.createOptionalActor(\"Optional2\", getThread());"
+ "dumpTree(\"after creation of Optional2\");"
+ ""
+ "// at this point the port isn\'t connected since"
+ "// the init message isn\'t processed yet"
+ "// - so no peer port exists"
+ "p0.sayHello();"
+ }
+ }
+ State Done
+ }
+ }
+ }
+
+ ActorClass Optional1 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef sub1: AC1
+ Binding p0 and sub1.p0
+ }
+ Behavior { }
+ }
+
+ ActorClass Optional2 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef sub2: AC2
+ Binding p0 and sub2.p0
+ }
+ Behavior { }
+ }
+
+ // the following actor classes are part of the possible optional instance sub trees
+
+ ActorClass AC1 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ external Port p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ State Ready {
+ entry {
+ "p0.hello(\"this is AC1, instance \"+getInstancePath());"
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ ActorRef deep_sub: AC3
+ Binding p0 and deep_sub.p0
+ }
+ Behavior { }
+ }
+
+ ActorClass AC3 {
+ Interface {
+ Port p0: PC
+ }
+ Structure {
+ optional ActorRef nestedOpt: Optional1
+ Binding p0 and nestedOpt.p0
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ State Ready {
+ entry {
+ "nestedOpt.createOptionalActor(\"Optional1\", getThread());"
+ }
+ }
+ }
+ }
+ }
+
+ // a simple protocol that is used to demonstrate that actors are connected
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest6.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest6.room
new file mode 100644
index 000000000..502efa7b0
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest6.room
@@ -0,0 +1,243 @@
+RoomModel DynamicActorTest6 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ ActorClass Appl {
+ @TestInstance
+ Structure {
+ ActorRef ctrl: Controller
+ }
+ Behavior { }
+ }
+
+ ActorClass Controller {
+ Structure {
+ conjugated Port pcont: PCtrl
+ conjugated Port pout: PC
+ conjugated Port pin: PC
+ Attribute caseId: int32
+ ActorRef cont: Container
+ Binding pcont and cont.fct
+ Binding pout and cont.pin
+ Binding pin and cont.pout
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest6\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest6\", \"DynamicActorTest6_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+ StateMachine {
+ Transition init: initial -> CreateOptionals { }
+ Transition tr0: CreateOptionals -> Sending {
+ triggers {
+ <done: pcont>
+ }
+ }
+ Transition tr1: Sending -> Destroy {
+ triggers {
+ <hello: pin>
+ }
+ action {
+ "System.out.println(\"Controller received: \"+transitionData);"
+ }
+ }
+ Transition tr2: Destroy -> CreateAgain {
+ triggers {
+ <done: pcont>
+ }
+ }
+ Transition tr3: CreateAgain -> SendAgain {
+ triggers {
+ <done: pcont>
+ }
+ }
+ Transition tr4: SendAgain -> Done {
+ triggers {
+ <hello: pin>
+ }
+ action {
+ "System.out.println(\"Controller received: \"+transitionData);"
+ }
+ }
+ State CreateOptionals {
+ entry {
+ "pcont.createOpts();"
+ }
+ }
+ State Sending {
+ entry {
+ "pout.sayHello();"
+ }
+ }
+ State Done {
+ entry {
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State Destroy {
+ entry {
+ "pcont.destroyOpts();"
+ }
+ }
+ State CreateAgain {
+ entry {
+ "pcont.createOpts();"
+ }
+ }
+ State SendAgain {
+ entry {
+ "pout.sayHello();"
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass Container {
+ Interface {
+ Port fct: PCtrl
+ Port pout: PC
+ Port pin: PC
+ }
+ Structure {
+ external Port fct
+ optional ActorRef opt1: Optional1
+ optional ActorRef opt2: Optional2
+ Binding opt1.pout and opt2.pin
+ Binding pin and opt1.pin
+ Binding pout and opt2.pout
+ }
+ Behavior {
+ // this method prints the passed message and then dumps the object tree consisting of actors and ports
+ Operation dumpTree(msg: string) {
+ "System.out.println(msg);"
+ "System.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());"
+ }
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <createOpts: fct>
+ }
+ action {
+ "opt1.createOptionalActor(\"Optional1\", getThread());"
+ "opt2.createOptionalActor(\"Optional2\", getThread());"
+ "dumpTree(\"after creation of op1 and opt2\");"
+ "fct.done();"
+ }
+ }
+ Transition tr1: Ready -> Ready {
+ triggers {
+ <destroyOpts: fct>
+ }
+ action {
+ "opt1.destroyOptionalActor();"
+ "opt2.destroyOptionalActor();"
+ "fct.done();"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ActorClass Optional1 {
+ Interface {
+ Port pout: PC
+ Port pin: PC
+ }
+ Structure {
+ ActorRef sub1: AC1
+ Binding pin and sub1.pin
+ Binding pout and sub1.pout
+ }
+ Behavior { }
+ }
+
+ ActorClass Optional2 {
+ Interface {
+ Port pout: PC
+ conjugated Port pin: PC
+ }
+ Structure {
+ ActorRef sub2: AC2
+ Binding pout and sub2.pout
+ Binding pin and sub2.pin
+ }
+ Behavior { }
+ }
+
+ ActorClass AC1 {
+ Interface {
+ Port pout: PC
+ Port pin: PC
+ }
+ Structure {
+ external Port pout
+ external Port pin
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <sayHello: pin>
+ }
+ action {
+ "pout.hello(\"this is AC1, instance \"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ActorClass AC2 {
+ Interface {
+ Port pout: PC
+ conjugated Port pin: PC
+ }
+ Structure {
+ external Port pout
+ external Port pin
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <hello: pin>
+ }
+ action {
+ "System.out.println(\"AC2 received \"+transitionData);"
+ ""
+ "pout.hello(\"AC2: forwarding \"+transitionData);"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+
+ ProtocolClass PCtrl {
+ incoming {
+ Message createOpts()
+ Message destroyOpts()
+ }
+ outgoing {
+ Message done()
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest7.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest7.room
new file mode 100644
index 000000000..84cf22e12
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/DynamicActorTest7.room
@@ -0,0 +1,375 @@
+RoomModel DynamicActorTest7 {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+
+ LogicalSystem JavaGenTests {
+ SubSystemRef da7Test : SubSystem_DynamicActorTest7
+ }
+
+ SubSystemClass SubSystem_DynamicActorTest7 {
+ ActorRef main : Appl
+
+ LogicalThread defaultThread
+ }
+
+ ActorClass Appl {
+ Structure {
+ ActorRef cont: Container
+ }
+ Behavior { }
+ }
+
+ ActorClass Container {
+ Structure {
+ usercode1 {
+ "import java.io.File;"
+ }
+ usercode2 {
+ "private static final String FIRST_OPT_OBJ = \"firstOpt.obj\";"
+ "private static final String SECOND_OPT_OBJ = \"secondOpt.obj\";"
+ }
+ conjugated Port op: PStep
+ conjugated Port opa [*]: PStep
+
+ Attribute caseId: int32
+
+ optional ActorRef opt: Optional
+ optional ActorRef optarr [*]: Optional
+
+ Binding op and opt.fct
+ Binding opa and optarr.fct
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"DynamicActorTest7\", \"org.eclipse.etrice.generator.common.tests.DynamicActorTest7\", \"DynamicActorTest7_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+ Operation clean() {
+ "File f = new File(FIRST_OPT_OBJ);"
+ "if (f.exists())"
+ "\tf.delete();"
+ }
+ StateMachine {
+ Transition init: initial -> Init { }
+ Transition tr0: Init -> DestroyAndCreate {
+ triggers {
+ <hello: op>
+ }
+ action {
+ "System.out.println(\"received \"+transitionData);"
+ }
+ }
+ Transition tr1: DestroyAndCreate -> DestroyAndRestore {
+ triggers {
+ <hello: op>
+ }
+ action {
+ "System.out.println(\"received \"+transitionData);"
+ }
+ }
+ Transition tr2: DestroyAndRestore -> LoadInArray {
+ triggers {
+ <hello: op>
+ }
+ action {
+ "System.out.println(\"received \"+transitionData);"
+ }
+ }
+ Transition tr3: LoadInArray -> ReceivedHello {
+ triggers {
+ <hello: opa>
+ }
+ action {
+ "System.out.println(\"received \"+transitionData);"
+ }
+ }
+ Transition tr4: ReceivedHello -> Done {
+ triggers {
+ <hello: opa>
+ }
+ action {
+ "System.out.println(\"received \"+transitionData);"
+ }
+ }
+ State Init {
+ entry {
+ "clean();"
+ "FilePersistor.createAndLoad(opt, getThread(), FIRST_OPT_OBJ, \"Optional1\");"
+ "op.step();"
+ "op.step();"
+ "op.sayHello();"
+ }
+ }
+ State DestroyAndCreate {
+ entry {
+ "FilePersistor.saveAndDestroy(opt, FIRST_OPT_OBJ);"
+ "FilePersistor.createAndLoad(opt, getThread(), SECOND_OPT_OBJ, \"Optional2\");"
+ "op.step();"
+ "op.step();"
+ "op.sayHello();"
+ }
+ }
+ State DestroyAndRestore {
+ entry {
+ "FilePersistor.saveAndDestroy(opt, SECOND_OPT_OBJ);"
+ "FilePersistor.createAndLoad(opt, getThread(), FIRST_OPT_OBJ, \"Optional1\");"
+ "op.sayHello();"
+ }
+ }
+ State Done {
+ entry {
+ "IRTObject object = getObject(\"/JavaGenTests/da7Test/main/cont/optarr/optarr:0/sub\");"
+ "EXPECT_TRUE(caseId, \"object 0 of optarr is an instance of actor class Sub1\", object instanceof Sub1);"
+ ""
+ "Sub1 inst = (Sub1) object;"
+ "EXPECT_EQUAL_INT32(caseId, \"state\", Sub1.STATE_Step3_StepA, inst.getState());"
+ "EXPECT_EQUAL_INT32(caseId, \"current value of ival\", 123, inst.getIval());"
+ "EXPECT_EQUAL_INT16(caseId, \"current value of sval\", (short)456, inst.getSval());"
+ "EXPECT_EQUAL_INT8(caseId, \"current value of bval\", (byte)3, inst.getBval());"
+ "EXPECT_TRUE(caseId, \"changed string\", \"changed\".equals(inst.getSome()[1].getStr()));"
+ "EXPECT_EQUAL_FLOAT32(caseId, \"current vaue of\", 3.14159f, inst.getDerived().getSome().getFval()[2], 0.001f);"
+ "EXPECT_EQUAL_UINT8(caseId, \"current value of cval\", 'x', inst.getCval());"
+ ""
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State LoadInArray {
+ entry {
+ "FilePersistor.createAndLoad(optarr, getThread(), FIRST_OPT_OBJ, \"Optional1\");"
+ "FilePersistor.createAndLoad(optarr, getThread(), SECOND_OPT_OBJ, \"Optional2\");"
+ "opa.sayHello();"
+ }
+ }
+ State ReceivedHello
+ }
+ }
+ }
+
+ abstract ActorClass Optional {
+ Interface {
+ Port fct: PStep
+ }
+ Structure { }
+ Behavior { }
+ }
+
+ ActorClass Optional1 extends Optional {
+ Structure {
+ ActorRef ^sub: Sub1
+ Binding fct and ^sub.fct
+ }
+ Behavior { }
+ }
+
+ ActorClass Optional2 extends Optional {
+ Structure {
+ ActorRef ^sub: Sub2
+ Binding fct and ^sub.fct
+ }
+ Behavior { }
+ }
+
+ ActorClass Sub1Base {
+ Structure {
+ Attribute cval: char
+ }
+ }
+
+ ActorClass Sub1 extends Sub1Base {
+ Interface {
+ Port fct: PStep
+ }
+ Structure {
+ external Port fct
+ conjugated Port dp: PStep
+
+ Attribute ival: int32
+ Attribute sval: int16
+ Attribute bval: int8
+ Attribute some[3]: SomeData
+ Attribute other: OtherData
+ Attribute derived: DerivedData
+
+ ActorRef deep: DeepSub1
+ Binding dp and deep.fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Step1 { }
+ Transition tr0: Step1 -> Step2 {
+ triggers {
+ <step: fct>
+ }
+ action {
+ "dp.step();"
+ }
+ }
+ Transition tr1: Step2 -> Step3 {
+ triggers {
+ <step: fct>
+ }
+ action {
+ "dp.step();"
+ }
+ }
+ Transition tr2: my tp0 -> my tp0 {
+ triggers {
+ <sayHello: fct>
+ }
+ action {
+ "fct.hello(getClassName()+\", state=\"+stateStrings[getState()]+\", path= \"+getInstancePath());"
+ }
+ }
+ handler TransitionPoint tp0
+ State Step1 {
+ entry {
+ "ival = 1;"
+ "sval = 2;"
+ "bval = 3;"
+ "cval = 'x';"
+ }
+ }
+ State Step2 {
+ entry {
+ "ival = 123;"
+ "some[1].str = \"changed\";"
+ "derived.some.fval[2] = 3.14159f;"
+ }
+ }
+ State Step3 {
+ subgraph {
+ Transition init: initial -> StepA { }
+ Transition tr0: StepA -> StepB {
+ triggers {
+ <step: fct>
+ }
+ action {
+ "dp.step();"
+ }
+ }
+ Transition tr1: StepB -> StepC {
+ triggers {
+ <step: fct>
+ }
+ action {
+ "dp.step();"
+ }
+ }
+ State StepA {
+ entry {
+ "sval = 456;"
+ }
+ }
+ State StepB {
+ entry {
+ "bval = 13;"
+ }
+ }
+ State StepC
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass DeepSub1 {
+ Interface {
+ Port fct: PStep
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Step1 { }
+ Transition tr0: Step1 -> Step2 {
+ triggers {
+ <step: fct>
+ }
+ }
+ Transition tr1: Step2 -> Step3 {
+ triggers {
+ <step: fct>
+ }
+ }
+ Transition tr2: Step3 -> Step5 {
+ triggers {
+ <step: fct>
+ }
+ }
+ Transition tr3: Step5 -> Step6 {
+ triggers {
+ <step: fct>
+ }
+ }
+ Transition tr4: Step6 -> Step7 {
+ triggers {
+ <step: fct>
+ }
+ }
+ State Step1
+ State Step2
+ State Step3
+ State Step5
+ State Step6
+ State Step7
+ }
+ }
+ }
+
+ ActorClass Sub2 {
+ Interface {
+ Port fct: PStep
+ }
+ Structure {
+ external Port fct
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> Ready { }
+ Transition tr0: Ready -> Ready {
+ triggers {
+ <step: fct>
+ }
+ }
+ Transition tr1: Ready -> Ready {
+ triggers {
+ <sayHello: fct>
+ }
+ action {
+ "fct.hello(getClassName()+\", state=\"+stateStrings[getState()]+\", path= \"+getInstancePath());"
+ }
+ }
+ State Ready
+ }
+ }
+ }
+
+ ProtocolClass PStep {
+ incoming {
+ Message step()
+ Message sayHello()
+ }
+ outgoing {
+ Message hello(txt: string)
+ }
+ }
+
+ DataClass SomeData {
+ Attribute fval[3]: float32 = "1.0"
+ Attribute dval: float64 = "123.4"
+ Attribute str: string = "\"Text\""
+ }
+
+ DataClass OtherData {
+ Attribute some: SomeData
+ Attribute bval: boolean = "false"
+ }
+
+ DataClass DerivedData extends OtherData {
+ Attribute cval[3]: char = "{'a', 'b', 'c'}"
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/StoreRestore.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/StoreRestore.room
new file mode 100644
index 000000000..c8e56b9a9
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/StoreRestore.room
@@ -0,0 +1,217 @@
+RoomModel StoreRestore {
+
+ import room.basic.etunit.* from "Tests.room"
+
+ ActorClass StoreRestore_Top {
+ @TestInstance
+ Structure {
+ ActorRef tester: Tester
+ ActorRef testee: Testee
+ Binding tester.prt and testee.prt
+ }
+ Behavior { }
+ }
+
+ ActorClass Testee {
+ Interface {
+ Port prt: PC
+ }
+ Structure {
+ usercode1 { "import StoreRestore.ObjectHolder;" }
+
+ external Port prt
+
+ Attribute ival: int16
+ Attribute iarr [ 3 ]: int32
+ Attribute sdval: SomeData
+ Attribute sdarr [ 5 ]: SomeData
+ Attribute cdval: ComplexData
+ }
+ Behavior {
+ Operation doStore() {
+ "System.out.println(\"doStore()\");"
+ "IActorClassDataObject dataObject = newDataObject();"
+ "store(dataObject);"
+ "ObjectHolder.setObject(dataObject);"
+ }
+ Operation doRestore() {
+ "System.out.println(\"doRestore()\");"
+ "IActorClassDataObject dataObject = ObjectHolder.getObject();"
+ "restore(dataObject);"
+ }
+ StateMachine {
+ Transition tr0: my tp0 -> Restore {
+ triggers {
+ <restore: prt>
+ }
+ }
+ Transition init: initial -> Begin { }
+ Transition tr1: Begin -> Store {
+ triggers {
+ <step: prt>
+ }
+ }
+ Transition tr2: Store -> state2 {
+ triggers {
+ <step: prt>
+ }
+ }
+ Transition tr3: state2 -> state3 {
+ triggers {
+ <step: prt>
+ }
+ }
+ TransitionPoint tp0
+ State Begin {
+ entry {
+ "ival = 3;"
+ }
+ }
+ State Store {
+ entry {
+ "System.out.println(\"<|MODEL_LOCATION|>\");"
+ "setFinalAction(new SingleFinalAction() {"
+ "\tpublic void run() {"
+ "\t\tdoStore();"
+ "\t}"
+ "});"
+ }
+ }
+ State state2 {
+ entry {
+ "prt.valueIs(ival);"
+ ""
+ "ival = 123;"
+ }
+ }
+ State Restore {
+ entry {
+ "System.out.println(\"<|MODEL_LOCATION|>\");"
+ "setFinalAction(new SingleFinalAction() {"
+ "\tpublic void run() {"
+ "\t\tdoRestore();"
+ "\t}"
+ "});"
+ }
+ }
+ State state3 {
+ entry {
+ "ival = 456;"
+ ""
+ "prt.answer();"
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass Tester {
+ Interface {
+ conjugated Port prt: PC
+ }
+ Structure {
+ external Port prt
+
+ Attribute caseId: int32
+ Attribute counter: int32 = "0"
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"StoreRestore\", \"org.eclipse.etrice.generator.common.tests.StoreRestore\", \"StoreRestore_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+
+ StateMachine {
+ Transition init: initial -> Prepare { }
+ Transition tr1: Loop2 -> cp cp0 {
+ triggers {
+ <answer: prt>
+ }
+ }
+ Transition tr2: cp cp0 -> Done
+ Transition tr3: cp cp0 -> Loop {
+ cond {
+ "++counter<10"
+ }
+ }
+ Transition tr0: Prepare -> Prepare2 {
+ triggers {
+ <valueIs: prt>
+ }
+ action {
+ "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, transitionData);"
+ }
+ }
+ Transition tr4: Prepare2 -> Loop {
+ triggers {
+ <answer: prt>
+ }
+ }
+ Transition tr5: Loop -> Loop2 {
+ triggers {
+ <valueIs: prt>
+ }
+ action {
+ "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, transitionData);"
+ }
+ }
+ ChoicePoint cp0
+ State Prepare {
+ entry {
+ "prt.step();"
+ "prt.step();"
+ }
+ }
+ State Loop {
+ entry {
+ "prt.restore();"
+ ""
+ "prt.step();"
+ "prt.step();"
+ }
+ }
+ State Done {
+ entry {
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State Prepare2 {
+ entry {
+ "prt.step();"
+ }
+ }
+ State Loop2 {
+ entry {
+ "prt.step();"
+ }
+ }
+ }
+ }
+ }
+
+ ProtocolClass PC {
+ incoming {
+ Message step()
+ Message restore()
+ }
+ outgoing {
+ Message answer()
+ Message valueIs(val: int16)
+ }
+ }
+
+ DataClass SomeData {
+ Attribute ival: int16
+ Attribute iarr [ 3 ]: int32
+ }
+
+ DataClass ComplexData {
+ Attribute sdval: SomeData
+ Attribute sdarr [ 5 ]: SomeData
+ }
+
+ PrimitiveType int16: ptInteger -> 'short' (Short) default '0'
+ PrimitiveType int32: ptInteger -> 'int' (Integer) default '0'
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room
new file mode 100644
index 000000000..7508f94f1
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room
@@ -0,0 +1,160 @@
+RoomModel TCPTest {
+
+ import room.basic.etunit.* from "Tests.room"
+ import room.basic.types.* from "Types.room"
+ import room.basic.service.tcp.* from "TcpService.room"
+
+ ActorClass TCPTestTop {
+ @TestInstance
+ Structure {
+ ActorRef ref0: ATcpServer
+ ActorRef ref1 [ 5 ]: ATcpClient
+ ActorRef ref2: Tester
+ Binding ref2.p1 and ref0.PayloadPort
+ Binding ref2.p0 and ref0.ControlPort
+ Binding ref2.p2 and ref1.ControlPort
+ Binding ref2.p3 and ref1.PayloadPort
+ }
+ Behavior { }
+ }
+
+ ActorClass Tester {
+ Interface {
+ conjugated Port p0: PTcpControl
+ conjugated Port p1: PTcpPayload
+ conjugated Port p2 [*]: PTcpControl
+ conjugated Port p3 [5]: PTcpPayload
+ }
+ Structure {
+ external Port p0
+ external Port p1
+ external Port p2
+ external Port p3
+ Attribute controlData:DTcpControl
+ Attribute testData:DTcpPayload
+ Attribute counter:int32
+ Attribute resultPattern:int32
+ Attribute pattern:int32
+ Attribute caseId: int32
+ Attribute resultlist[3]: int16 = "{1,2,3}"
+
+ }
+ Behavior {
+ ctor {
+ "caseId = etUnit_openAll(\"log/testlog\", \"TCPTest\", \"org.eclipse.etrice.generator.common.tests.TCPTest\", \"TCPTest_case\");"
+ }
+ dtor {
+ "etUnit_closeAll(caseId);"
+ }
+ StateMachine {
+ Transition init: initial -> state0 {
+ action {
+ "EXPECT_ORDER_START(caseId,resultlist,3);"
+ "EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 1);"
+ "// open Server"
+ "controlData.setIPAddr(\"127.0.0.1\");"
+ "controlData.setTcpPort(4711);"
+ "p0.open(controlData);"
+ }
+ }
+ Transition tr0: state0 -> state1 {
+ triggers {
+ <established: p0>
+ }
+ action {
+ "// open 5 clients"
+ "for (int i=0;i<p2.getReplication();i++){"
+ "p2[i].open(controlData);"
+ "}"
+ "counter=0;"
+ }
+ }
+ Transition tr1: state1 -> cp cp0 {
+ triggers {
+ <established: p2>
+ }
+ action {
+ "counter++;"
+ }
+ }
+ Transition tr4: cp cp0 -> state1
+ Transition tr5: cp cp0 -> state2 {
+ cond {
+ "counter>=p2.getReplication()"
+ }
+ action {
+ "String s=new String (\"Test!\");"
+ "testData.setData(s.getBytes());"
+ "testData.setLength(s.length());"
+ "testData.setConnectionId(0);"
+ "for (int i=0; i<p3.getReplication();i++){"
+ "\tp3[i].send(testData);"
+ "}"
+ "counter=0;"
+ "resultPattern=0;"
+ }
+ }
+ Transition tr8: state2 -> cp cp2 {
+ triggers {
+ <receive: p3>
+ }
+ action {
+ "resultPattern+=p3.getIndexOf(ifitem);"
+ "//System.out.printf(\"c:%d, Idx:%d!\\n\", counter,p3.getIndexOf(ifitem));"
+ "counter++;"
+ }
+ }
+ Transition tr9: cp cp2 -> state2
+ Transition tr10: cp cp2 -> cp cp1 {
+ cond {
+ "counter>=p2.getReplication()"
+ }
+ action {
+ "int i;"
+ "p0.close();"
+ "// close all clients"
+ "p2.close();"
+ "pattern=0;"
+ "for (i=0;i<p2.getReplication();i++){"
+ "\tpattern+=i;"
+ "}"
+ }
+ }
+ Transition tr3: state2 -> state2 {
+ triggers {
+ <receive: p1>
+ }
+ action {
+ "p1.send(transitionData);"
+ }
+ }
+ Transition tr2: cp cp1 -> test_failed
+ Transition tr6: cp cp1 -> test_ok {
+ cond {
+ "pattern==resultPattern"
+ }
+ }
+ ChoicePoint cp0
+ ChoicePoint cp2
+ ChoicePoint cp1
+ State state0
+ State state1
+ State state2
+ State test_ok {
+ entry {
+ "EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
+ "EXPECT_ORDER_END(caseId,\"<|MODEL_LOCATION|>\", 3);"
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ State test_failed {
+ entry {
+ "EXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
+ "EXPECT_ORDER_END(caseId,\"<|MODEL_LOCATION|>\", 3);"
+ "etUnit_testFinished(caseId);"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.runtime.java.tests/org.eclipse.etrice.runtime.java.tests.launch b/tests/org.eclipse.etrice.runtime.java.tests/org.eclipse.etrice.runtime.java.tests.launch
index d9ad1884a..7a1d37c5c 100644
--- a/tests/org.eclipse.etrice.runtime.java.tests/org.eclipse.etrice.runtime.java.tests.launch
+++ b/tests/org.eclipse.etrice.runtime.java.tests/org.eclipse.etrice.runtime.java.tests.launch
@@ -10,6 +10,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/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.runtime.java.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.etrice.ui.behavior.tests/META-INF/MANIFEST.MF
index c8f7920c5..4d200de66 100644
--- a/tests/org.eclipse.etrice.ui.behavior.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/META-INF/MANIFEST.MF
@@ -17,7 +17,9 @@ Require-Bundle: org.eclipse.etrice.core.fsm;bundle-version="1.1.1",
org.eclipse.core.runtime,
org.junit;bundle-version="4.8.1",
org.eclipse.xtext;bundle-version="2.6.0",
- org.eclipse.graphiti;bundle-version="0.8.0"
+ org.eclipse.graphiti;bundle-version="0.8.0",
+ org.eclipse.etrice.core.room.tests;bundle-version="1.1.1",
+ org.eclipse.etrice.core.genmodel.fsm;bundle-version="1.1.1"
Import-Package: org.eclipse.xtext.xbase.lib
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior b/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior
new file mode 100644
index 000000000..510dfad28
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior
@@ -0,0 +1,341 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Base" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.1/@link //@children.1/@children.1/@link //@children.0/@children.4/@children.1/@link //@children.1/@children.2/@link //@children.0/@children.4/@children.2/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link" verticalGridUnit="10" version="0.13.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ActorClass:Base"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Base$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Base$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="tp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="40">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.2" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="100" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Base$b0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="260" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Base$b1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="entp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="6">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="11" height="11" x="25" y="25"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0">
+ <points x="27" y="33"/>
+ <points x="33" y="27"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0">
+ <points x="27" y="27"/>
+ <points x="33" y="33"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.3" referencedGraphicsAlgorithm="//@children.0/@children.4/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="22" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="extp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="15">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="11" height="11" x="25" y="25"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0" x="25" y="25">
+ <points x="5"/>
+ <points x="11" y="5"/>
+ <points x="5" y="11"/>
+ <points y="5"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.4" referencedGraphicsAlgorithm="//@children.0/@children.4/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="22" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp1"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="420" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.3" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Base$b2"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.2 //@connections.4" referencedGraphicsAlgorithm="//@children.0/@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b2"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="50" height="50" x="55" y="265">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="25" height="25" x="12" y="12"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ChoicePoint:Base$cp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2 //@connections.3" incomingConnections="//@connections.1" referencedGraphicsAlgorithm="//@children.0/@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="50" height="25" y="12" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="C"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Base$b1$sg"/>
+ </link>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/b1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="entp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="80">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="2" filled="false" transparency="0.0">
+ <points x="33" y="47"/>
+ <points x="47" y="33"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="2" filled="false" transparency="0.0">
+ <points x="33" y="33"/>
+ <points x="47" y="47"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="extp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="200">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="2" filled="true" transparency="0.0" x="30" y="30">
+ <points x="10"/>
+ <points x="20" y="10"/>
+ <points x="10" y="20"/>
+ <points y="10"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" verticalAlignment="ALIGNMENT_BOTTOM" value="tp1"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#InitialTransition:Base$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.3/@anchors.0" end="//@children.0/@children.6/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#TriggeredTransition:Base$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr0: &lt;x:p0>"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.6/@anchors.0" end="//@children.0/@children.5/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ContinuationTransition:Base$tr1"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr1: [else]"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.6/@anchors.0" end="//@children.0/@children.4/@children.1/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#CPBranchTransition:Base$tr2"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr2: [true]"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.4/@children.2/@anchors.0" end="//@children.0/@children.5/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ContinuationTransition:Base$tr3"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr3: "/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Derived.behavior b/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Derived.behavior
new file mode 100644
index 000000000..50f9fda19
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Derived.behavior
@@ -0,0 +1,452 @@
+<?xml version="1.0" encoding="ASCII"?>
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of Derived" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.1/@link //@children.1/@children.1/@link //@children.0/@children.4/@children.1/@link //@children.1/@children.2/@link //@children.0/@children.4/@children.2/@link //@children.1/@children.3/@link //@connections.0/@link //@connections.1/@link //@children.2/@link //@children.2/@children.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@connections.5/@link //@connections.6/@link" verticalGridUnit="10" version="0.13.0">
+ <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ActorClass:Derived"/>
+ </link>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Derived$sg"/>
+ </link>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="40" height="40" x="100" y="100">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.2" lineWidth="2" transparency="0.0" width="20" height="20" x="10" y="10"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Derived$sg"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2" referencedGraphicsAlgorithm="//@children.0/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="40" height="20" y="10" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="I"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="tp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="40">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.3" foreground="//@colors.3" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="100" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.4" foreground="//@colors.3" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Base$b0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.3" incomingConnections="//@connections.2" referencedGraphicsAlgorithm="//@children.0/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="260" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.4" foreground="//@colors.3" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#RefinedState:Derived$b1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.4/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="entp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="6">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" lineWidth="1" transparency="0.0" width="11" height="11" x="25" y="25"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0">
+ <points x="27" y="33"/>
+ <points x="33" y="27"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0">
+ <points x="27" y="27"/>
+ <points x="33" y="33"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.5" referencedGraphicsAlgorithm="//@children.0/@children.4/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="60" height="22" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="extp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="60" height="60" x="15">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" lineWidth="1" transparency="0.0" width="11" height="11" x="25" y="25"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0" x="25" y="25">
+ <points x="5"/>
+ <points x="11" y="5"/>
+ <points x="5" y="11"/>
+ <points y="5"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.6" referencedGraphicsAlgorithm="//@children.0/@children.4/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="60" height="22" font="//@fonts.0" verticalAlignment="ALIGNMENT_BOTTOM" value="tp1"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="420" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.4" foreground="//@colors.3" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="true" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.3" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#RefinedState:Derived$b2"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.4 //@connections.6" referencedGraphicsAlgorithm="//@children.0/@children.5/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="b2"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" visible="true" active="true">
+ <properties key="obj-type" value="trp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="50" height="50" x="55" y="265">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" lineWidth="2" transparency="0.0" width="25" height="25" x="12" y="12"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ChoicePoint:Base$cp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.4 //@connections.5" incomingConnections="//@connections.3" referencedGraphicsAlgorithm="//@children.0/@children.6/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children visible="true">
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="50" height="25" y="12" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="C"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Derived$b1$sg"/>
+ </link>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/b1"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="entp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="80">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="2" filled="false" transparency="0.0">
+ <points x="33" y="47"/>
+ <points x="47" y="33"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="2" filled="false" transparency="0.0">
+ <points x="33" y="33"/>
+ <points x="47" y="47"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.0"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" verticalAlignment="ALIGNMENT_BOTTOM" value="tp0"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="trp"/>
+ <properties key="item-kind" value="extp"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="80" height="80" x="200">
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" lineWidth="2" transparency="0.0" width="20" height="20" x="30" y="30"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="2" filled="true" transparency="0.0" x="30" y="30">
+ <points x="10"/>
+ <points x="20" y="10"/>
+ <points x="10" y="20"/>
+ <points y="10"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="//@connections.1"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" width="80" height="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" verticalAlignment="ALIGNMENT_BOTTOM" value="tp1"/>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="20" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.5" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Derived$b1$d11"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.1" incomingConnections="//@connections.0" referencedGraphicsAlgorithm="//@children.1/@children.3/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="d11"/>
+ </children>
+ </children>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="sg"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#StateGraph:Derived$b2$sg"/>
+ </link>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/b2"/>
+ </children>
+ <children xsi:type="pi:ContainerShape" active="true">
+ <properties key="obj-type" value="state"/>
+ <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="120" height="90" x="20" y="120">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.5" foreground="//@colors.2" lineWidth="1" transparency="0.0" width="60" height="30" x="30" y="30" cornerHeight="20" cornerWidth="20">
+ <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="15" height="8" x="35" y="3" cornerHeight="5" cornerWidth="5"/>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-3" y="-3"/>
+ <points x="-3" y="3"/>
+ <points x="-11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="3" y="-3"/>
+ <points x="3" y="3"/>
+ <points x="11" y="3"/>
+ </graphicsAlgorithmChildren>
+ <graphicsAlgorithmChildren xsi:type="al:Polygon" foreground="//@colors.2" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" x="30" y="24">
+ <points x="-2" y="-3"/>
+ <points x="-2" y="3"/>
+ <points x="2" y="3"/>
+ <points x="2" y="-3"/>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithmChildren>
+ </graphicsAlgorithm>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#SimpleState:Derived$b2$d21"/>
+ </link>
+ <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.2/@children.1/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <children>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="60" height="30" x="30" y="30" font="//@fonts.0" horizontalAlignment="ALIGNMENT_CENTER" value="d21"/>
+ </children>
+ </children>
+ </children>
+ <connections xsi:type="pi:FreeFormConnection" active="true" start="//@children.1/@children.1/@anchors.0" end="//@children.1/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ContinuationTransition:Derived$b1$tr0"/>
+ </link>
+ <connectionDecorators locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr0: "/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" active="true" start="//@children.1/@children.3/@anchors.0" end="//@children.1/@children.2/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#TriggeredTransition:Derived$b1$tr1"/>
+ </link>
+ <connectionDecorators locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.2" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr1: &lt;x:p0>"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.1/@anchors.0" end="//@children.0/@children.3/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#InitialTransition:Base$initial"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="init"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.3/@anchors.0" end="//@children.0/@children.6/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#TriggeredTransition:Base$tr0"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr0: &lt;x:p0>"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.6/@anchors.0" end="//@children.0/@children.5/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ContinuationTransition:Base$tr1"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr1: [else]"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.6/@anchors.0" end="//@children.0/@children.4/@children.1/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#CPBranchTransition:Base$tr2"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr2: [true]"/>
+ </connectionDecorators>
+ </connections>
+ <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="//@children.0/@children.4/@children.2/@anchors.0" end="//@children.0/@children.5/@anchors.0">
+ <properties key="obj-type" value="trans"/>
+ <graphicsAlgorithm xsi:type="al:Polyline" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0"/>
+ <link>
+ <businessObjects href="../InheritedStateMachine.room#ContinuationTransition:Base$tr3"/>
+ </link>
+ <connectionDecorators visible="true" locationRelative="true" location="1.0">
+ <graphicsAlgorithm xsi:type="al:Polygon" background="//@colors.1" foreground="//@colors.3" lineWidth="1" filled="true" transparency="0.0">
+ <points x="-15" y="5"/>
+ <points/>
+ <points x="-15" y="-5"/>
+ </graphicsAlgorithm>
+ </connectionDecorators>
+ <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
+ <graphicsAlgorithm xsi:type="al:Text" foreground="//@colors.3" lineWidth="1" filled="false" transparency="0.0" x="10" font="//@fonts.0" value="tr3: "/>
+ </connectionDecorators>
+ </connections>
+ <colors red="227" green="238" blue="249"/>
+ <colors red="255" green="255" blue="255"/>
+ <colors/>
+ <colors red="100" green="100" blue="100"/>
+ <colors red="230" green="230" blue="230"/>
+ <colors red="200" green="200" blue="200"/>
+ <fonts name="Arial" size="8"/>
+ <fonts name="Arial" size="9" bold="true"/>
+</pi:Diagram>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen b/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen
new file mode 100644
index 000000000..8e4ad56d6
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fsmgen:GraphContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fsmgen="http://www.eclipse.org/etrice/generator/fsm">
+ <graph>
+ <nodes outgoing="//@graph/@links.2 //@graph/@links.3" incoming="//@graph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ChoicePoint:Base$cp0"/>
+ </nodes>
+ <nodes>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
+ </nodes>
+ <nodes outgoing="//@graph/@links.1" incoming="//@graph/@links.0">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Base$b0"/>
+ </nodes>
+ <nodes>
+ <subgraph>
+ <nodes incoming="//@graph/@links.3">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </nodes>
+ <nodes outgoing="//@graph/@links.4">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </nodes>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:Base$b1$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Base$b1"/>
+ </nodes>
+ <nodes incoming="//@graph/@links.2 //@graph/@links.4">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Base$b2"/>
+ </nodes>
+ <links target="//@graph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#InitialTransition:Base$initial"/>
+ </links>
+ <links source="//@graph/@nodes.2" target="//@graph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TriggeredTransition:Base$tr0"/>
+ </links>
+ <links source="//@graph/@nodes.0" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr1"/>
+ </links>
+ <links source="//@graph/@nodes.0" target="//@graph/@nodes.3/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#CPBranchTransition:Base$tr2"/>
+ </links>
+ <links source="//@graph/@nodes.3/@subgraph/@nodes.1" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr3"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:Base$sg"/>
+ </graph>
+ <component href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ActorClass:Base"/>
+</fsmgen:GraphContainer>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/output/Derived.fsmgen b/tests/org.eclipse.etrice.ui.behavior.tests/output/Derived.fsmgen
new file mode 100644
index 000000000..a2a66226f
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/output/Derived.fsmgen
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fsmgen:GraphContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fsmgen="http://www.eclipse.org/etrice/generator/fsm">
+ <graph>
+ <nodes inherited="true" outgoing="//@graph/@links.2 //@graph/@links.3" incoming="//@graph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ChoicePoint:Base$cp0"/>
+ </nodes>
+ <nodes inherited="true">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.1" incoming="//@graph/@links.0">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Base$b0"/>
+ </nodes>
+ <nodes inherited="true">
+ <subgraph>
+ <nodes inherited="true" outgoing="//@graph/@nodes.3/@subgraph/@links.0" incoming="//@graph/@links.3">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.4" incoming="//@graph/@nodes.3/@subgraph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </nodes>
+ <nodes outgoing="//@graph/@nodes.3/@subgraph/@links.1" incoming="//@graph/@nodes.3/@subgraph/@links.0" inheritanceLevel="1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Derived$b1$d11"/>
+ </nodes>
+ <links source="//@graph/@nodes.3/@subgraph/@nodes.0" target="//@graph/@nodes.3/@subgraph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Derived$b1$tr0"/>
+ </links>
+ <links source="//@graph/@nodes.3/@subgraph/@nodes.2" target="//@graph/@nodes.3/@subgraph/@nodes.1">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TriggeredTransition:Derived$b1$tr1"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:Derived$b1$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:Derived$b1"/>
+ </nodes>
+ <nodes inherited="true" incoming="//@graph/@links.2 //@graph/@links.4">
+ <subgraph>
+ <nodes inheritanceLevel="1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Derived$b2$d21"/>
+ </nodes>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:Derived$b2$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:Derived$b2"/>
+ </nodes>
+ <links inherited="true" target="//@graph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#InitialTransition:Base$initial"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.2" target="//@graph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TriggeredTransition:Base$tr0"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.0" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr1"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.0" target="//@graph/@nodes.3/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#CPBranchTransition:Base$tr2"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.3/@subgraph/@nodes.1" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr3"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:Derived$sg"/>
+ </graph>
+ <component href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ActorClass:Derived"/>
+</fsmgen:GraphContainer>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/output/DoubleDerived.fsmgen b/tests/org.eclipse.etrice.ui.behavior.tests/output/DoubleDerived.fsmgen
new file mode 100644
index 000000000..57c3ec88f
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/output/DoubleDerived.fsmgen
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ASCII"?>
+<fsmgen:GraphContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:fsmgen="http://www.eclipse.org/etrice/generator/fsm">
+ <graph>
+ <nodes inherited="true" outgoing="//@graph/@links.2 //@graph/@links.3" incoming="//@graph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ChoicePoint:Base$cp0"/>
+ </nodes>
+ <nodes inherited="true">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.1" incoming="//@graph/@links.0">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:Base$b0"/>
+ </nodes>
+ <nodes inherited="true">
+ <subgraph>
+ <nodes inherited="true" outgoing="//@graph/@nodes.3/@subgraph/@links.0" incoming="//@graph/@links.3">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#EntryPoint:Base$b1$tp0"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@links.4" incoming="//@graph/@nodes.3/@subgraph/@links.1">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ExitPoint:Base$b1$tp1"/>
+ </nodes>
+ <nodes inherited="true" outgoing="//@graph/@nodes.3/@subgraph/@links.1" incoming="//@graph/@nodes.3/@subgraph/@links.0" inheritanceLevel="1">
+ <subgraph>
+ <nodes inheritanceLevel="2">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:DoubleDerived$b1$d11$dd111"/>
+ </nodes>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:DoubleDerived$b1$d11$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:DoubleDerived$b1$d11"/>
+ </nodes>
+ <nodes inheritanceLevel="2">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:DoubleDerived$b1$dd12"/>
+ </nodes>
+ <nodes inheritanceLevel="2">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:DoubleDerived$b1$dd13"/>
+ </nodes>
+ <links inherited="true" source="//@graph/@nodes.3/@subgraph/@nodes.0" target="//@graph/@nodes.3/@subgraph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Derived$b1$tr0"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.3/@subgraph/@nodes.2" target="//@graph/@nodes.3/@subgraph/@nodes.1">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TriggeredTransition:Derived$b1$tr1"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:DoubleDerived$b1$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:DoubleDerived$b1"/>
+ </nodes>
+ <nodes inherited="true" incoming="//@graph/@links.2 //@graph/@links.4">
+ <subgraph>
+ <nodes inherited="true" inheritanceLevel="1">
+ <subgraph>
+ <nodes inheritanceLevel="2">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:DoubleDerived$b2$d21$dd211"/>
+ </nodes>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:DoubleDerived$b2$d21$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:DoubleDerived$b2$d21"/>
+ </nodes>
+ <nodes inheritanceLevel="2">
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#SimpleState:DoubleDerived$b2$xt2"/>
+ </nodes>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:DoubleDerived$b2$sg"/>
+ </subgraph>
+ <stateGraphNode href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#RefinedState:DoubleDerived$b2"/>
+ </nodes>
+ <links inherited="true" target="//@graph/@nodes.2">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#InitialTransition:Base$initial"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.2" target="//@graph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#TriggeredTransition:Base$tr0"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.0" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr1"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.0" target="//@graph/@nodes.3/@subgraph/@nodes.0">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#CPBranchTransition:Base$tr2"/>
+ </links>
+ <links inherited="true" source="//@graph/@nodes.3/@subgraph/@nodes.1" target="//@graph/@nodes.4">
+ <transition href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ContinuationTransition:Base$tr3"/>
+ </links>
+ <stateGraph href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#StateGraph:DoubleDerived$sg"/>
+ </graph>
+ <component href="file:/C:/Users/hrentz.PROTOS/git/newfsmgen/org.eclipse.etrice/tests/org.eclipse.etrice.ui.behavior.tests/models/InheritedStateMachine.room#ActorClass:DoubleDerived"/>
+</fsmgen:GraphContainer>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.xtend b/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.xtend
new file mode 100644
index 000000000..455c952e4
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.xtend
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.ui.behavior.commands
+
+import com.google.common.collect.Sets
+import java.util.List
+import org.eclipse.emf.common.util.URI
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
+import org.eclipse.emf.ecore.util.EcoreUtil
+import org.eclipse.etrice.core.RoomStandaloneSetup
+import org.eclipse.etrice.core.TestBase
+import org.eclipse.etrice.core.fsm.fSM.StateGraphItem
+import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician
+import org.eclipse.etrice.core.genmodel.fsm.NullDiagnostician
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node
+import org.eclipse.etrice.core.room.ActorClass
+import org.eclipse.etrice.core.room.RoomModel
+import org.eclipse.etrice.ui.behavior.BehaviorTestActivator
+import org.junit.Test
+
+import static org.junit.Assert.assertEquals
+import static org.junit.Assert.assertFalse
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+
+class TestFSMGenModel extends TestBase {
+
+ val injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration()
+ protected IDiagnostician diagnostician = new NullDiagnostician
+ protected extension ExtendedFsmGenBuilder builder = new ExtendedFsmGenBuilder(injector, diagnostician)
+
+ protected def createResourceSetWithGc(String roomFile, String actorName) {
+ prepare(BehaviorTestActivator.^default.getBundle())
+ val res = getResource(roomFile)
+ val actor = (res.contents.get(0) as RoomModel).actorClasses.findFirst[name.equals(actorName)]
+
+ val gc = builder.createTransformedModel(actor) => [gc |
+ assertNotNull("graph context was created", gc)
+
+ val logger = new NullLogger
+ FsmGenChecker.check(gc, logger)
+ assertFalse("logger has no errors", logger.hasErrors)
+ save(gc, actor.name)
+ ]
+
+ res.resourceSet.createResource(URI.createURI('dummy://' + actorName + '.fsmgen')) => [
+ contents += gc
+ ]
+
+ return res.resourceSet
+ }
+
+ protected def save(GraphContainer gc, String fileName) {
+ val rs = new ResourceSetImpl
+ val uri = URI.createFileURI("./output/" + fileName + ".fsmgen")
+ val res = rs.createResource(uri)
+ res.contents.add(gc)
+ res.save(newHashMap)
+ }
+
+ @Test
+ def void testBaseClass() {
+ val rs = createResourceSetWithGc("InheritedStateMachine.room", "Base")
+ val actorClasses = EcoreUtil.getAllContents(rs, true).filter(ActorClass).filter[name == 'Base'].toList
+ val gc = rs.resources.map[contents].flatten.filter(GraphContainer).head
+
+ checkAgainstRoom(gc, actorClasses)
+ }
+
+ @Test
+ def void testDerivedClass() {
+ val rs = createResourceSetWithGc("InheritedStateMachine.room", "Derived")
+ val actorClasses = EcoreUtil.getAllContents(rs, true).filter(ActorClass).filter[name == 'Base' || name == 'Derived'].toList
+ val gc = rs.resources.map[contents].flatten.filter(GraphContainer).head
+
+ checkAgainstRoom(gc, actorClasses)
+ }
+
+ @Test
+ def void testDoubleDerivedClass() {
+ val rs = createResourceSetWithGc("InheritedStateMachine.room", "DoubleDerived")
+ val actorClasses = EcoreUtil.getAllContents(rs, true).filter(ActorClass).filter[name == 'Base' || name == 'Derived' || name == 'DoubleDerived'].toList
+ val gc = rs.resources.map[contents].flatten.filter(GraphContainer).head
+
+ checkAgainstRoom(gc, actorClasses)
+ }
+
+ def void checkAgainstRoom(GraphContainer gc, List<ActorClass> actorClasses) {
+ // genmodel should refer to latest fsm (check in-memory ref)
+ val genModelRefs = (EcoreUtil.getAllContents(gc, true).filter(Node).map[stateGraphNode] + EcoreUtil.getAllContents(gc, true).filter(Link).map[transition]).toSet
+ EcoreUtil.getAllContents(actorClasses.last, false).filter(StateGraphItem).forEach[
+ assertTrue('missing ' + EcoreUtil.getURI(it), genModelRefs.contains(it))
+ ]
+
+ // all fsm items should be in genmodel (check name)
+ // node, there are duplicate names in subgraphs => not complete
+ val stateGraphItemsNames = EcoreUtil.getAllContents(actorClasses, true).filter(StateGraphItem).map[name].toIterable.toSortedSet
+ val namesFromGenModel = genModelRefs.map[name].toSortedSet
+ assertEquals(stateGraphItemsNames, namesFromGenModel)
+ }
+
+ private def <T extends Comparable> toSortedSet(Iterable<T> iterable) {
+ Sets.<T>newTreeSet(iterable)
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java b/tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java
new file mode 100644
index 000000000..7535dfc38
--- /dev/null
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java
@@ -0,0 +1,177 @@
+/**
+ * Copyright (c) 2011 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:
+ * Juergen Haug (initial contribution)
+ */
+package org.eclipse.etrice.ui.behavior.commands;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Sets;
+import com.google.inject.Injector;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.etrice.core.RoomStandaloneSetup;
+import org.eclipse.etrice.core.TestBase;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphItem;
+import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
+import org.eclipse.etrice.core.fsm.fSM.TransitionBase;
+import org.eclipse.etrice.core.genmodel.fsm.ExtendedFsmGenBuilder;
+import org.eclipse.etrice.core.genmodel.fsm.FsmGenChecker;
+import org.eclipse.etrice.core.genmodel.fsm.IDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.NullDiagnostician;
+import org.eclipse.etrice.core.genmodel.fsm.NullLogger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
+import org.eclipse.etrice.core.room.ActorClass;
+import org.eclipse.etrice.core.room.RoomModel;
+import org.eclipse.etrice.ui.behavior.BehaviorTestActivator;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.Exceptions;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.IteratorExtensions;
+import org.eclipse.xtext.xbase.lib.ListExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
+import org.junit.Assert;
+import org.junit.Test;
+
+@SuppressWarnings("all")
+public class TestFSMGenModel extends TestBase {
+ private final Injector injector = new RoomStandaloneSetup().createInjectorAndDoEMFRegistration();
+
+ protected IDiagnostician diagnostician = new NullDiagnostician();
+
+ @Extension
+ protected ExtendedFsmGenBuilder builder = new ExtendedFsmGenBuilder(this.injector, this.diagnostician);
+
+ protected ResourceSet createResourceSetWithGc(final String roomFile, final String actorName) {
+ this.prepare(BehaviorTestActivator.getDefault().getBundle());
+ final Resource res = this.getResource(roomFile);
+ EObject _get = res.getContents().get(0);
+ final Function1<ActorClass, Boolean> _function = (ActorClass it) -> {
+ return Boolean.valueOf(it.getName().equals(actorName));
+ };
+ final ActorClass actor = IterableExtensions.<ActorClass>findFirst(((RoomModel) _get).getActorClasses(), _function);
+ GraphContainer _createTransformedModel = this.builder.createTransformedModel(actor);
+ final Procedure1<GraphContainer> _function_1 = (GraphContainer gc) -> {
+ Assert.assertNotNull("graph context was created", gc);
+ final NullLogger logger = new NullLogger();
+ FsmGenChecker.check(gc, logger);
+ Assert.assertFalse("logger has no errors", logger.hasErrors());
+ this.save(gc, actor.getName());
+ };
+ final GraphContainer gc = ObjectExtensions.<GraphContainer>operator_doubleArrow(_createTransformedModel, _function_1);
+ Resource _createResource = res.getResourceSet().createResource(URI.createURI((("dummy://" + actorName) + ".fsmgen")));
+ final Procedure1<Resource> _function_2 = (Resource it) -> {
+ EList<EObject> _contents = it.getContents();
+ _contents.add(gc);
+ };
+ ObjectExtensions.<Resource>operator_doubleArrow(_createResource, _function_2);
+ return res.getResourceSet();
+ }
+
+ protected void save(final GraphContainer gc, final String fileName) {
+ try {
+ final ResourceSetImpl rs = new ResourceSetImpl();
+ final URI uri = URI.createFileURI((("./output/" + fileName) + ".fsmgen"));
+ final Resource res = rs.createResource(uri);
+ res.getContents().add(gc);
+ res.save(CollectionLiterals.<Object, Object>newHashMap());
+ } catch (Throwable _e) {
+ throw Exceptions.sneakyThrow(_e);
+ }
+ }
+
+ @Test
+ public void testBaseClass() {
+ final ResourceSet rs = this.createResourceSetWithGc("InheritedStateMachine.room", "Base");
+ final Function1<ActorClass, Boolean> _function = (ActorClass it) -> {
+ String _name = it.getName();
+ return Boolean.valueOf(Objects.equal(_name, "Base"));
+ };
+ final List<ActorClass> actorClasses = IteratorExtensions.<ActorClass>toList(IteratorExtensions.<ActorClass>filter(Iterators.<ActorClass>filter(EcoreUtil.<Object>getAllContents(rs, true), ActorClass.class), _function));
+ final Function1<Resource, EList<EObject>> _function_1 = (Resource it) -> {
+ return it.getContents();
+ };
+ final GraphContainer gc = IterableExtensions.<GraphContainer>head(Iterables.<GraphContainer>filter(Iterables.<EObject>concat(ListExtensions.<Resource, EList<EObject>>map(rs.getResources(), _function_1)), GraphContainer.class));
+ this.checkAgainstRoom(gc, actorClasses);
+ }
+
+ @Test
+ public void testDerivedClass() {
+ final ResourceSet rs = this.createResourceSetWithGc("InheritedStateMachine.room", "Derived");
+ final Function1<ActorClass, Boolean> _function = (ActorClass it) -> {
+ return Boolean.valueOf((Objects.equal(it.getName(), "Base") || Objects.equal(it.getName(), "Derived")));
+ };
+ final List<ActorClass> actorClasses = IteratorExtensions.<ActorClass>toList(IteratorExtensions.<ActorClass>filter(Iterators.<ActorClass>filter(EcoreUtil.<Object>getAllContents(rs, true), ActorClass.class), _function));
+ final Function1<Resource, EList<EObject>> _function_1 = (Resource it) -> {
+ return it.getContents();
+ };
+ final GraphContainer gc = IterableExtensions.<GraphContainer>head(Iterables.<GraphContainer>filter(Iterables.<EObject>concat(ListExtensions.<Resource, EList<EObject>>map(rs.getResources(), _function_1)), GraphContainer.class));
+ this.checkAgainstRoom(gc, actorClasses);
+ }
+
+ @Test
+ public void testDoubleDerivedClass() {
+ final ResourceSet rs = this.createResourceSetWithGc("InheritedStateMachine.room", "DoubleDerived");
+ final Function1<ActorClass, Boolean> _function = (ActorClass it) -> {
+ return Boolean.valueOf(((Objects.equal(it.getName(), "Base") || Objects.equal(it.getName(), "Derived")) || Objects.equal(it.getName(), "DoubleDerived")));
+ };
+ final List<ActorClass> actorClasses = IteratorExtensions.<ActorClass>toList(IteratorExtensions.<ActorClass>filter(Iterators.<ActorClass>filter(EcoreUtil.<Object>getAllContents(rs, true), ActorClass.class), _function));
+ final Function1<Resource, EList<EObject>> _function_1 = (Resource it) -> {
+ return it.getContents();
+ };
+ final GraphContainer gc = IterableExtensions.<GraphContainer>head(Iterables.<GraphContainer>filter(Iterables.<EObject>concat(ListExtensions.<Resource, EList<EObject>>map(rs.getResources(), _function_1)), GraphContainer.class));
+ this.checkAgainstRoom(gc, actorClasses);
+ }
+
+ public void checkAgainstRoom(final GraphContainer gc, final List<ActorClass> actorClasses) {
+ final Function1<Node, StateGraphNode> _function = (Node it) -> {
+ return it.getStateGraphNode();
+ };
+ Iterator<StateGraphNode> _map = IteratorExtensions.<Node, StateGraphNode>map(Iterators.<Node>filter(EcoreUtil.<Object>getAllContents(gc, true), Node.class), _function);
+ final Function1<Link, TransitionBase> _function_1 = (Link it) -> {
+ return it.getTransition();
+ };
+ Iterator<TransitionBase> _map_1 = IteratorExtensions.<Link, TransitionBase>map(Iterators.<Link>filter(EcoreUtil.<Object>getAllContents(gc, true), Link.class), _function_1);
+ final Set<StateGraphItem> genModelRefs = IteratorExtensions.<StateGraphItem>toSet(Iterators.<StateGraphItem>concat(_map, _map_1));
+ final Procedure1<StateGraphItem> _function_2 = (StateGraphItem it) -> {
+ URI _uRI = EcoreUtil.getURI(it);
+ String _plus = ("missing " + _uRI);
+ Assert.assertTrue(_plus, genModelRefs.contains(it));
+ };
+ IteratorExtensions.<StateGraphItem>forEach(Iterators.<StateGraphItem>filter(EcoreUtil.<Object>getAllContents(IterableExtensions.<ActorClass>last(actorClasses), false), StateGraphItem.class), _function_2);
+ final Function1<StateGraphItem, String> _function_3 = (StateGraphItem it) -> {
+ return it.getName();
+ };
+ final TreeSet<String> stateGraphItemsNames = this.<String>toSortedSet(IteratorExtensions.<String>toIterable(IteratorExtensions.<StateGraphItem, String>map(Iterators.<StateGraphItem>filter(EcoreUtil.<Object>getAllContents(actorClasses, true), StateGraphItem.class), _function_3)));
+ final Function1<StateGraphItem, String> _function_4 = (StateGraphItem it) -> {
+ return it.getName();
+ };
+ final TreeSet<String> namesFromGenModel = this.<String>toSortedSet(IterableExtensions.<StateGraphItem, String>map(genModelRefs, _function_4));
+ Assert.assertEquals(stateGraphItemsNames, namesFromGenModel);
+ }
+
+ private <T extends Comparable> TreeSet<T> toSortedSet(final Iterable<T> iterable) {
+ return Sets.<T>newTreeSet(iterable);
+ }
+}

Back to the top