Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2017-11-10 05:22:25 -0500
committerHenrik Rentz-Reichert2017-11-10 14:57:25 -0500
commitb5b1401f30884bdc6c160f8500e3f29b6566c481 (patch)
treee4c3f9027ac047ac2e25922801a1bb6eb7d5bbd9 /tests
parent2e9666c1b52cef7d82be927d14e6dc8b57587a81 (diff)
downloadorg.eclipse.etrice-b5b1401f30884bdc6c160f8500e3f29b6566c481.tar.gz
org.eclipse.etrice-b5b1401f30884bdc6c160f8500e3f29b6566c481.tar.xz
org.eclipse.etrice-b5b1401f30884bdc6c160f8500e3f29b6566c481.zip
Bug 511330 - [core.genmodel.fsm] introduce simplified generator model
for state machines * bug fix in ui.behavior tests Change-Id: I0ee471ae6b0e7502ba2dbf63f9ec46b33d0610e6
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.core.common.tests/build.properties3
-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.room.tests/org.eclipse.etrice.core.room.tests.launch6
-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/models/SendingDataTest.room84
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room4
-rw-r--r--tests/org.eclipse.etrice.generator.cpp.tests/models/SendingDataTest.room84
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest1.room4
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest2.room10
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest3.room6
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest4.room2
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest5.room2
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest6.room8
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest7.room10
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/SendingDataTest.room84
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/StoreRestoreTest.room4
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/models/TCPTest.room318
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room318
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior6
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Derived.behavior16
-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/AbstractStateMachineTest.java29
-rw-r--r--tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java177
34 files changed, 500 insertions, 2243 deletions
diff --git a/tests/org.eclipse.etrice.core.common.tests/build.properties b/tests/org.eclipse.etrice.core.common.tests/build.properties
index d0cce7a46..5df6a2f43 100644
--- a/tests/org.eclipse.etrice.core.common.tests/build.properties
+++ b/tests/org.eclipse.etrice.core.common.tests/build.properties
@@ -1,5 +1,6 @@
source.. = src/,\
src-gen/,\
- models/
+ models/,\
+ xtend-gen/
bin.includes = META-INF/,\
.
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
deleted file mode 100644
index 0198fb95c..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/FsmGenTestBase.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * 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
deleted file mode 100644
index c1ffb81b2..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestCodeInheritance.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * 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
deleted file mode 100644
index fc6734787..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatFSM.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 8fbd53473..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestFlatInheritedFSM.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 64b14a66c..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierFSM.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 466923419..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestHierInheritedFSM.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 27cf9e006..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestMultipleConnectedChoicepoint.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 099db3f80..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesInheritance.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * 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
deleted file mode 100644
index ee2c0d9f7..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestStatesTriggers.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * 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
deleted file mode 100644
index 222a967be..000000000
--- a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/tests/TestTrigger.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * 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.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 e7e2c69f0..6cb9c65b8 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,15 +36,9 @@
<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/xtend-gen/org/eclipse/etrice/core/TestNames.java b/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
deleted file mode 100644
index 37641c0ed..000000000
--- a/tests/org.eclipse.etrice.core.room.tests/xtend-gen/org/eclipse/etrice/core/TestNames.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * 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/models/SendingDataTest.room b/tests/org.eclipse.etrice.generator.c.tests/models/SendingDataTest.room
index 8091671e9..d8d7fdd82 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/models/SendingDataTest.room
+++ b/tests/org.eclipse.etrice.generator.c.tests/models/SendingDataTest.room
@@ -30,7 +30,7 @@ RoomModel SendingDataTest {
<pingInt16: PingPongPort>
}
action {
- "PingPongPort.pongInt16(d);"
+ "PingPongPort.pongInt16(transitionData);"
}
}
Transition tr1: reply -> reply {
@@ -38,7 +38,7 @@ RoomModel SendingDataTest {
<pingInt8: PingPongPort>
}
action {
- "PingPongPort.pongInt8(d);"
+ "PingPongPort.pongInt8(transitionData);"
}
}
Transition init: initial -> reply { }
@@ -47,7 +47,7 @@ RoomModel SendingDataTest {
<pingInt32: PingPongPort>
}
action {
- "PingPongPort.pongInt32(d);"
+ "PingPongPort.pongInt32(transitionData);"
}
}
Transition tr3: reply -> reply {
@@ -55,7 +55,7 @@ RoomModel SendingDataTest {
<pingFloat32: PingPongPort>
}
action {
- "PingPongPort.pongFloat32(d);"
+ "PingPongPort.pongFloat32(transitionData);"
}
}
Transition tr4: reply -> reply {
@@ -63,27 +63,27 @@ RoomModel SendingDataTest {
<pingFloat64: PingPongPort>
}
action {
- "PingPongPort.pongFloat64(d);"
+ "PingPongPort.pongFloat64(transitionData);"
}
}
Transition tr7: reply -> cp cp0 {
triggers {
<pingInt32Ref: PingPongPort guard {
- "(*d)!=0"
+ "(*transitionData)!=0"
}>
}
}
Transition tr8: cp cp0 -> reply {
action {
- "PingPongPort.pongInt32((*d)+10);"
+ "PingPongPort.pongInt32((*transitionData)+10);"
}
}
Transition tr6: cp cp0 -> reply {
cond {
- "(*d)!=5"
+ "(*transitionData)!=5"
}
action {
- "PingPongPort.pongInt32(*d);"
+ "PingPongPort.pongInt32(*transitionData);"
}
}
Transition tr9: reply -> reply {
@@ -91,7 +91,7 @@ RoomModel SendingDataTest {
<pingComplex: PingPongPort>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr11: reply -> reply {
@@ -99,7 +99,7 @@ RoomModel SendingDataTest {
<pingComplexRef: PingPongPort>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr5: reply -> reply {
@@ -107,7 +107,7 @@ RoomModel SendingDataTest {
<pingInt64: PingPongPort>
}
action {
- "PingPongPort.pongInt64(d);"
+ "PingPongPort.pongInt64(transitionData);"
}
}
Transition tr10: reply -> reply {
@@ -115,30 +115,30 @@ RoomModel SendingDataTest {
<pingInt16Ref: PingPongPort>
}
action {
- "PingPongPort.pongInt16(*d);"
+ "PingPongPort.pongInt16(*transitionData);"
}
}
Transition tr12: reply -> cp cp1 {
triggers {
<pingComplexRef: PingPongPort guard {
- "d->i8ValPPD == 5"
+ "transitionData->i8ValPPD == 5"
}>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr13: cp cp1 -> reply {
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr14: cp cp1 -> reply {
cond {
- "d->i8ValPPD==7"
+ "transitionData->i8ValPPD==7"
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr15: reply -> reply {
@@ -146,7 +146,7 @@ RoomModel SendingDataTest {
<pingComplexDerived: PingPongPort>
}
action {
- "PingPongPort.pongComplexDerived(d);"
+ "PingPongPort.pongComplexDerived(transitionData);"
}
}
Transition tr16: my tp0 -> my tp0 {
@@ -230,7 +230,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==5){"
+ "if (transitionData==5){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -243,7 +243,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==19){"
+ "if (transitionData==19){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 3);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -256,7 +256,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4711){"
+ "if (transitionData==4711){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 4);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -273,7 +273,7 @@ RoomModel SendingDataTest {
"counter=0;"
"if (lang == 1){"
"/* Java cannot send references of primitive types */"
- "\tif (d==4711){\t"
+ "\tif (transitionData==4711){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -281,7 +281,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"/* C */"
- "\tif (d==4712){\t"
+ "\tif (transitionData==4712){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -295,7 +295,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470815){"
+ "if (transitionData==11470815){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 5);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -308,7 +308,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>3)&&(d<4)){"
+ "if ((transitionData>3)&&(transitionData<4)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 6);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -321,7 +321,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>7)&&(d<8)){"
+ "if ((transitionData>7)&&(transitionData<8)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 7);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -334,7 +334,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==6){"
+ "if (transitionData==6){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 10);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -347,7 +347,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){"
+ "if (transitionData==20){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 11);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -360,7 +360,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4712){"
+ "if (transitionData==4712){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 12);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -373,7 +373,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470816){"
+ "if (transitionData==11470816){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 13);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -386,7 +386,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>13)&&(d<14)){"
+ "if ((transitionData>13)&&(transitionData<14)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 14);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -399,7 +399,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>28)&&(d<29)){"
+ "if ((transitionData>28)&&(transitionData<29)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 15);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -413,7 +413,7 @@ RoomModel SendingDataTest {
}>
}
action {
- "if (d==4712){\t"
+ "if (transitionData==4712){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 17);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -430,7 +430,7 @@ RoomModel SendingDataTest {
"counter++;"
"if (lang == 1){"
"/* Java cannot send references of primitive types */"
- "\tif (d==19){\t"
+ "\tif (transitionData==19){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -438,7 +438,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"/* C */"
- "\tif (d==20){\t"
+ "\tif (transitionData==20){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -454,7 +454,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){\t"
+ "if (transitionData==20){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 16);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -492,13 +492,13 @@ RoomModel SendingDataTest {
}
action {
"counter=0;"
- "if (d->i8ValPPD==10){"
+ "if (transitionData->i8ValPPD==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 19);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d->complexVal.i32Val2PPDD==80){"
+ "if (transitionData->complexVal.i32Val2PPDD==80){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 20);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -514,7 +514,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d->i8ValPPD==10){"
+ "if (transitionData->i8ValPPD==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 18);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -526,13 +526,13 @@ RoomModel SendingDataTest {
<pongComplexDerived: PingPongPort>
}
action {
- "if (d->i8ValPPD==11){"
+ "if (transitionData->i8ValPPD==11){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 21);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d->i32Val3PPDe==150){"
+ "if (transitionData->i32Val3PPDe==150){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 22);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
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 2ff8d6533..12fc5f20b 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
@@ -29,12 +29,8 @@ 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
diff --git a/tests/org.eclipse.etrice.generator.cpp.tests/models/SendingDataTest.room b/tests/org.eclipse.etrice.generator.cpp.tests/models/SendingDataTest.room
index b38d93c30..9f6d42b55 100644
--- a/tests/org.eclipse.etrice.generator.cpp.tests/models/SendingDataTest.room
+++ b/tests/org.eclipse.etrice.generator.cpp.tests/models/SendingDataTest.room
@@ -30,7 +30,7 @@ RoomModel SendingDataTest {
<pingInt16: PingPongPort>
}
action {
- "PingPongPort.pongInt16(d);"
+ "PingPongPort.pongInt16(transitionData);"
}
}
Transition tr1: reply -> reply {
@@ -38,7 +38,7 @@ RoomModel SendingDataTest {
<pingInt8: PingPongPort>
}
action {
- "PingPongPort.pongInt8(d);"
+ "PingPongPort.pongInt8(transitionData);"
}
}
Transition init: initial -> reply { }
@@ -47,7 +47,7 @@ RoomModel SendingDataTest {
<pingInt32: PingPongPort>
}
action {
- "PingPongPort.pongInt32(d);"
+ "PingPongPort.pongInt32(transitionData);"
}
}
Transition tr3: reply -> reply {
@@ -55,7 +55,7 @@ RoomModel SendingDataTest {
<pingFloat32: PingPongPort>
}
action {
- "PingPongPort.pongFloat32(d);"
+ "PingPongPort.pongFloat32(transitionData);"
}
}
Transition tr4: reply -> reply {
@@ -63,27 +63,27 @@ RoomModel SendingDataTest {
<pingFloat64: PingPongPort>
}
action {
- "PingPongPort.pongFloat64(d);"
+ "PingPongPort.pongFloat64(transitionData);"
}
}
Transition tr7: reply -> cp cp0 {
triggers {
<pingInt32Ref: PingPongPort guard {
- "(*d)!=0"
+ "(*transitionData)!=0"
}>
}
}
Transition tr8: cp cp0 -> reply {
action {
- "PingPongPort.pongInt32((*d)+10);"
+ "PingPongPort.pongInt32((*transitionData)+10);"
}
}
Transition tr6: cp cp0 -> reply {
cond {
- "(*d)!=5"
+ "(*transitionData)!=5"
}
action {
- "PingPongPort.pongInt32(*d);"
+ "PingPongPort.pongInt32(*transitionData);"
}
}
Transition tr9: reply -> reply {
@@ -91,7 +91,7 @@ RoomModel SendingDataTest {
<pingComplex: PingPongPort>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr11: reply -> reply {
@@ -99,7 +99,7 @@ RoomModel SendingDataTest {
<pingComplexRef: PingPongPort>
}
action {
- "PingPongPort.pongComplex(*d);"
+ "PingPongPort.pongComplex(*transitionData);"
}
}
Transition tr5: reply -> reply {
@@ -107,7 +107,7 @@ RoomModel SendingDataTest {
<pingInt64: PingPongPort>
}
action {
- "PingPongPort.pongInt64(d);"
+ "PingPongPort.pongInt64(transitionData);"
}
}
Transition tr10: reply -> reply {
@@ -115,30 +115,30 @@ RoomModel SendingDataTest {
<pingInt16Ref: PingPongPort>
}
action {
- "PingPongPort.pongInt16(*d);"
+ "PingPongPort.pongInt16(*transitionData);"
}
}
Transition tr12: reply -> cp cp1 {
triggers {
<pingComplexRef: PingPongPort guard {
- "d->i8ValPPD == 5"
+ "transitionData->i8ValPPD == 5"
}>
}
action {
- "PingPongPort.pongComplex(*d);"
+ "PingPongPort.pongComplex(*transitionData);"
}
}
Transition tr13: cp cp1 -> reply {
action {
- "PingPongPort.pongComplex(*d);"
+ "PingPongPort.pongComplex(*transitionData);"
}
}
Transition tr14: cp cp1 -> reply {
cond {
- "d->i8ValPPD==7"
+ "transitionData->i8ValPPD==7"
}
action {
- "PingPongPort.pongComplex(*d);"
+ "PingPongPort.pongComplex(*transitionData);"
}
}
Transition tr15: reply -> reply {
@@ -146,7 +146,7 @@ RoomModel SendingDataTest {
<pingComplexDerived: PingPongPort>
}
action {
- "PingPongPort.pongComplexDerived(d);"
+ "PingPongPort.pongComplexDerived(transitionData);"
}
}
Transition tr16: my tp0 -> my tp0 {
@@ -230,7 +230,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==5){"
+ "if (transitionData==5){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -243,7 +243,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==19){"
+ "if (transitionData==19){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 3);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -256,7 +256,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4711){"
+ "if (transitionData==4711){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 4);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -273,7 +273,7 @@ RoomModel SendingDataTest {
"counter=0;"
"if (lang == 1){"
"/* Java cannot send references of primitive types */"
- "\tif (d==4711){\t"
+ "\tif (transitionData==4711){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -281,7 +281,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"/* C */"
- "\tif (d==4712){\t"
+ "\tif (transitionData==4712){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -295,7 +295,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470815){"
+ "if (transitionData==11470815){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 5);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -308,7 +308,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>3)&&(d<4)){"
+ "if ((transitionData>3)&&(transitionData<4)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 6);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -321,7 +321,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>7)&&(d<8)){"
+ "if ((transitionData>7)&&(transitionData<8)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 7);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -334,7 +334,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==6){"
+ "if (transitionData==6){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 10);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -347,7 +347,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){"
+ "if (transitionData==20){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 11);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -360,7 +360,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4712){"
+ "if (transitionData==4712){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 12);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -373,7 +373,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470816){"
+ "if (transitionData==11470816){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 13);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -386,7 +386,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>13)&&(d<14)){"
+ "if ((transitionData>13)&&(transitionData<14)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 14);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -399,7 +399,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>28)&&(d<29)){"
+ "if ((transitionData>28)&&(transitionData<29)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 15);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -413,7 +413,7 @@ RoomModel SendingDataTest {
}>
}
action {
- "if (d==4712){\t"
+ "if (transitionData==4712){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 17);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -430,7 +430,7 @@ RoomModel SendingDataTest {
"counter++;"
"if (lang == 1){"
"/* Java cannot send references of primitive types */"
- "\tif (d==19){\t"
+ "\tif (transitionData==19){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -438,7 +438,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"/* C */"
- "\tif (d==20){\t"
+ "\tif (transitionData==20){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -454,7 +454,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){\t"
+ "if (transitionData==20){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 16);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -492,13 +492,13 @@ RoomModel SendingDataTest {
}
action {
"counter=0;"
- "if (d.i8ValPPD==10){"
+ "if (transitionData.i8ValPPD==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 19);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d.complexVal.i32Val2PPDD==80){"
+ "if (transitionData.complexVal.i32Val2PPDD==80){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 20);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -514,7 +514,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d.i8ValPPD==10){"
+ "if (transitionData.i8ValPPD==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 18);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -526,13 +526,13 @@ RoomModel SendingDataTest {
<pongComplexDerived: PingPongPort>
}
action {
- "if (d.i8ValPPD==11){"
+ "if (transitionData.i8ValPPD==11){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 21);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d.i32Val3PPDe==150){"
+ "if (transitionData.i32Val3PPDe==150){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 22);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest1.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest1.room
index 9f393fd1a..331261002 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest1.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest1.room
@@ -43,7 +43,7 @@ RoomModel DynamicActorTest1 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC3:/JavaGenTests/da1Test/appl/cont/opt/sub2/deep_sub\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da1Test/appl/cont/opt/sub2/deep_sub\"));"
"opt.destroyOptionalActor();"
}
}
@@ -52,7 +52,7 @@ RoomModel DynamicActorTest1 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC1:/JavaGenTests/da1Test/appl/cont/opt/sub1\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da1Test/appl/cont/opt/sub1\"));"
"opt.destroyOptionalActor();"
}
}
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest2.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest2.room
index 9893c7dbf..ed4439255 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest2.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest2.room
@@ -43,7 +43,7 @@ RoomModel DynamicActorTest2 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
}
}
Transition tr2: CreateOptional1 -> ReceivedHelloAgain {
@@ -51,7 +51,7 @@ RoomModel DynamicActorTest2 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:0/sub2/deep_sub\"));"
}
}
Transition tr1: ReceivedHelloAgain -> Destroy0 {
@@ -59,7 +59,7 @@ RoomModel DynamicActorTest2 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
}
}
Transition tr3: Destroy0 -> Destroy1Create2 {
@@ -67,7 +67,7 @@ RoomModel DynamicActorTest2 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC1:/JavaGenTests/da2Test/appl/cont/optarray:1/sub1\"));"
}
}
Transition tr4: Destroy1Create2 -> Done {
@@ -75,7 +75,7 @@ RoomModel DynamicActorTest2 {
<hello: p0>
}
action {
- "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", txt.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:1/sub2/deep_sub\"));"
+ "EXPECT_TRUE(caseId, \"<|MODEL_LOCATION|>\", transitionData.equals(\"AC3:/JavaGenTests/da2Test/appl/cont/optarray:1/sub2/deep_sub\"));"
}
}
State CreateOptional2 {
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest3.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest3.room
index 152b36811..892a80686 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest3.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest3.room
@@ -39,7 +39,7 @@ RoomModel DynamicActorTest3 {
<hello: opt>
}
action {
- "System.out.println(\"controller received \"+txt);"
+ "System.out.println(\"controller received \"+transitionData);"
}
}
Transition tr2: createOpt1 -> UnexpectedError {
@@ -101,7 +101,7 @@ RoomModel DynamicActorTest3 {
<create: fct>
}
action {
- "if (optRef.createOptionalActor(ac, getThread()))"
+ "if (optRef.createOptionalActor(transitionData, getThread()))"
"\tfct.ok();"
"else"
"\tfct.error();"
@@ -165,7 +165,7 @@ RoomModel DynamicActorTest3 {
<hello: hlp>
}
action {
- "System.out.println(\"helper said \"+txt);"
+ "System.out.println(\"helper said \"+transitionData);"
"p0.hello(\"this is AC1, instance \"+getInstancePath());"
}
}
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest4.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest4.room
index 3deb03ddd..14de05c25 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest4.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest4.room
@@ -40,7 +40,7 @@ RoomModel DynamicActorTest4 {
<hello: p0>
}
action {
- "System.out.println(txt+\"\\n\");"
+ "System.out.println(transitionData+\"\\n\");"
"opt.destroyOptionalActor();"
"dumpTree(\"after deletion of Optional2\");"
}
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest5.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest5.room
index 0a4d3d8c0..c2680d7d0 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest5.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest5.room
@@ -42,7 +42,7 @@ RoomModel DynamicActorTest5 {
action {
"dumpTree(\"after received hello\");"
""
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
""
"etUnit_testFinished(caseId);"
}
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest6.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest6.room
index 174b03d01..d1b69ba3a 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest6.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest6.room
@@ -41,7 +41,7 @@ RoomModel DynamicActorTest6 {
<hello: pin>
}
action {
- "System.out.println(\"Controller received: \"+txt);"
+ "System.out.println(\"Controller received: \"+transitionData);"
}
}
Transition tr2: Destroy -> CreateAgain {
@@ -59,7 +59,7 @@ RoomModel DynamicActorTest6 {
<hello: pin>
}
action {
- "System.out.println(\"Controller received: \"+txt);"
+ "System.out.println(\"Controller received: \"+transitionData);"
}
}
State CreateOptionals {
@@ -212,9 +212,9 @@ RoomModel DynamicActorTest6 {
<hello: pin>
}
action {
- "System.out.println(\"AC2 received \"+txt);"
+ "System.out.println(\"AC2 received \"+transitionData);"
""
- "pout.hello(\"AC2: forwarding \"+txt);"
+ "pout.hello(\"AC2: forwarding \"+transitionData);"
}
}
State Ready
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest7.room b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest7.room
index ec9aff939..99755e2cf 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest7.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/DynamicActorTest7.room
@@ -59,7 +59,7 @@ RoomModel DynamicActorTest7 {
<hello: op>
}
action {
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
}
}
Transition tr1: DestroyAndCreate -> DestroyAndRestore {
@@ -67,7 +67,7 @@ RoomModel DynamicActorTest7 {
<hello: op>
}
action {
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
}
}
Transition tr2: DestroyAndRestore -> LoadInArray {
@@ -75,7 +75,7 @@ RoomModel DynamicActorTest7 {
<hello: op>
}
action {
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
}
}
Transition tr3: LoadInArray -> ReceivedHello {
@@ -83,7 +83,7 @@ RoomModel DynamicActorTest7 {
<hello: opa>
}
action {
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
}
}
Transition tr4: ReceivedHello -> Done {
@@ -91,7 +91,7 @@ RoomModel DynamicActorTest7 {
<hello: opa>
}
action {
- "System.out.println(\"received \"+txt);"
+ "System.out.println(\"received \"+transitionData);"
}
}
State Init {
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/SendingDataTest.room b/tests/org.eclipse.etrice.generator.java.tests/models/SendingDataTest.room
index 39a66aeee..42f0554ac 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/SendingDataTest.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/SendingDataTest.room
@@ -28,7 +28,7 @@ RoomModel SendingDataTest {
<pingInt16: PingPongPort>
}
action {
- "PingPongPort.pongInt16(d);"
+ "PingPongPort.pongInt16(transitionData);"
}
}
Transition tr1: reply -> reply {
@@ -36,7 +36,7 @@ RoomModel SendingDataTest {
<pingInt8: PingPongPort>
}
action {
- "PingPongPort.pongInt8(d);"
+ "PingPongPort.pongInt8(transitionData);"
}
}
Transition init: initial -> reply { }
@@ -45,7 +45,7 @@ RoomModel SendingDataTest {
<pingInt32: PingPongPort>
}
action {
- "PingPongPort.pongInt32(d);"
+ "PingPongPort.pongInt32(transitionData);"
}
}
Transition tr3: reply -> reply {
@@ -53,7 +53,7 @@ RoomModel SendingDataTest {
<pingFloat32: PingPongPort>
}
action {
- "PingPongPort.pongFloat32(d);"
+ "PingPongPort.pongFloat32(transitionData);"
}
}
Transition tr4: reply -> reply {
@@ -61,27 +61,27 @@ RoomModel SendingDataTest {
<pingFloat64: PingPongPort>
}
action {
- "PingPongPort.pongFloat64(d);"
+ "PingPongPort.pongFloat64(transitionData);"
}
}
Transition tr7: reply -> cp cp0 {
triggers {
<pingInt32Ref: PingPongPort guard {
- "d!=0"
+ "transitionData!=0"
}>
}
}
Transition tr8: cp cp0 -> reply {
action {
- "PingPongPort.pongInt32(d+10);"
+ "PingPongPort.pongInt32(transitionData+10);"
}
}
Transition tr6: cp cp0 -> reply {
cond {
- "d!=5"
+ "transitionData!=5"
}
action {
- "PingPongPort.pongInt32(d);"
+ "PingPongPort.pongInt32(transitionData);"
}
}
Transition tr9: reply -> reply {
@@ -89,7 +89,7 @@ RoomModel SendingDataTest {
<pingComplex: PingPongPort>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr11: reply -> reply {
@@ -97,7 +97,7 @@ RoomModel SendingDataTest {
<pingComplexRef: PingPongPort>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr5: reply -> reply {
@@ -105,7 +105,7 @@ RoomModel SendingDataTest {
<pingInt64: PingPongPort>
}
action {
- "PingPongPort.pongInt64(d);"
+ "PingPongPort.pongInt64(transitionData);"
}
}
Transition tr10: reply -> reply {
@@ -113,30 +113,30 @@ RoomModel SendingDataTest {
<pingInt16Ref: PingPongPort>
}
action {
- "PingPongPort.pongInt16(d);"
+ "PingPongPort.pongInt16(transitionData);"
}
}
Transition tr12: reply -> cp cp1 {
triggers {
<pingComplexRef: PingPongPort guard {
- "d.i8Val == 5"
+ "transitionData.i8Val == 5"
}>
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr13: cp cp1 -> reply {
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr14: cp cp1 -> reply {
cond {
- "d.i8Val==7"
+ "transitionData.i8Val==7"
}
action {
- "PingPongPort.pongComplex(d);"
+ "PingPongPort.pongComplex(transitionData);"
}
}
Transition tr15: reply -> reply {
@@ -144,7 +144,7 @@ RoomModel SendingDataTest {
<pingComplexDerived: PingPongPort>
}
action {
- "PingPongPort.pongComplexDerived(d);"
+ "PingPongPort.pongComplexDerived(transitionData);"
}
}
ChoicePoint cp0
@@ -222,7 +222,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==5){"
+ "if (transitionData==5){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 2);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -235,7 +235,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==19){"
+ "if (transitionData==19){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 3);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -248,7 +248,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4711){"
+ "if (transitionData==4711){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 4);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -265,7 +265,7 @@ RoomModel SendingDataTest {
"counter=0;"
"if (lang == 1){"
"// Java cannot send references of primitive types"
- "\tif (d==4711){\t"
+ "\tif (transitionData==4711){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -273,7 +273,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"// C"
- "\tif (d==4712){\t"
+ "\tif (transitionData==4712){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 9);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -287,7 +287,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470815){"
+ "if (transitionData==11470815){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 5);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -300,7 +300,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>3)&&(d<4)){"
+ "if ((transitionData>3)&&(transitionData<4)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 6);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -313,7 +313,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>7)&&(d<8)){"
+ "if ((transitionData>7)&&(transitionData<8)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 7);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -326,7 +326,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==6){"
+ "if (transitionData==6){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 10);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -339,7 +339,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){"
+ "if (transitionData==20){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 11);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -352,7 +352,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==4712){"
+ "if (transitionData==4712){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 12);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -365,7 +365,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==11470816){"
+ "if (transitionData==11470816){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 13);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -378,7 +378,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>13)&&(d<14)){"
+ "if ((transitionData>13)&&(transitionData<14)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 14);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -391,7 +391,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if ((d>28)&&(d<29)){"
+ "if ((transitionData>28)&&(transitionData<29)){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 15);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -405,7 +405,7 @@ RoomModel SendingDataTest {
}>
}
action {
- "if (d==4712){\t"
+ "if (transitionData==4712){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 17);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -422,7 +422,7 @@ RoomModel SendingDataTest {
"counter++;"
"if (lang == 1){"
"// Java cannot send references of primitive types"
- "\tif (d==19){\t"
+ "\tif (transitionData==19){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -430,7 +430,7 @@ RoomModel SendingDataTest {
"} "
"if (lang == 2){"
"// C"
- "\tif (d==20){\t"
+ "\tif (transitionData==20){\t"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 8);"
"\t}else{"
"\t\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -446,7 +446,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d==20){\t"
+ "if (transitionData==20){\t"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 16);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -484,13 +484,13 @@ RoomModel SendingDataTest {
}
action {
"counter=0;"
- "if (d.i8Val==10){"
+ "if (transitionData.i8Val==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 19);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d.complexVal.i32Val2==80){"
+ "if (transitionData.complexVal.i32Val2==80){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 20);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -506,7 +506,7 @@ RoomModel SendingDataTest {
}
action {
"counter++;"
- "if (d.i8Val==10){"
+ "if (transitionData.i8Val==10){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 18);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
@@ -518,13 +518,13 @@ RoomModel SendingDataTest {
<pongComplexDerived: PingPongPort>
}
action {
- "if (d.i8Val==11){"
+ "if (transitionData.i8Val==11){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 21);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
"}"
""
- "if (d.i32Val3==150){"
+ "if (transitionData.i32Val3==150){"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 22);"
"}else{"
"\tEXPECT_ORDER(caseId,\"<|MODEL_LOCATION|>\", 0xFF);"
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/StoreRestoreTest.room b/tests/org.eclipse.etrice.generator.java.tests/models/StoreRestoreTest.room
index 939f5c211..300e23378 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/StoreRestoreTest.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/StoreRestoreTest.room
@@ -141,7 +141,7 @@ RoomModel StoreRestoreTest {
<valueIs: prt>
}
action {
- "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, val);"
+ "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, transitionData);"
}
}
Transition tr4: Prepare2 -> Loop {
@@ -154,7 +154,7 @@ RoomModel StoreRestoreTest {
<valueIs: prt>
}
action {
- "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, val);"
+ "EXPECT_EQUAL_INT16(caseId, \"check old value <|MODEL_LOCATION|>\", (short)3, transitionData);"
}
}
ChoicePoint cp0
diff --git a/tests/org.eclipse.etrice.generator.java.tests/models/TCPTest.room b/tests/org.eclipse.etrice.generator.java.tests/models/TCPTest.room
index 5e2b2c4f3..456827558 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/models/TCPTest.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/models/TCPTest.room
@@ -1,160 +1,160 @@
-RoomModel TCPTest {
-
- import room.basic.test.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/Tests.room"
- import room.basic.types.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/Types.room"
- import room.basic.service.tcp.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/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\", \"TCPTest\", \"org.eclipse.etrice.generator.java.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(data);"
- }
- }
- 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);"
- }
- }
- }
- }
- }
+RoomModel TCPTest {
+
+ import room.basic.test.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/Tests.room"
+ import room.basic.types.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/Types.room"
+ import room.basic.service.tcp.* from "../../../runtime/org.eclipse.etrice.modellib.java/model/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\", \"TCPTest\", \"org.eclipse.etrice.generator.java.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.generator.java.tests/targetModels/TCPTest.room b/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room
index 7508f94f1..b337eb919 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room
+++ b/tests/org.eclipse.etrice.generator.java.tests/targetModels/TCPTest.room
@@ -1,160 +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);"
- }
- }
- }
- }
- }
+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.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior b/tests/org.eclipse.etrice.ui.behavior.tests/models/diagrams/InheritedStateMachine.Base.behavior
index 510dfad28..fbcd4d516 100644
--- 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
@@ -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 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">
+<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.14.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"/>
@@ -17,7 +17,7 @@
<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"/>
+ <properties key="obj-type" value="ini"/>
<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>
@@ -179,7 +179,7 @@
</children>
</children>
<children xsi:type="pi:ContainerShape" visible="true" active="true">
- <properties key="obj-type" value="trp"/>
+ <properties key="obj-type" value="cp"/>
<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>
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
index 50f9fda19..b6b9291d0 100644
--- 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
@@ -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 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">
+<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.14.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"/>
@@ -17,16 +17,16 @@
<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"/>
+ <properties key="obj-type" value="ini"/>
<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"/>
+ <graphicsAlgorithmChildren xsi:type="al:Ellipse" background="//@colors.1" foreground="//@colors.3" 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"/>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.2"/>
<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"/>
+ <graphicsAlgorithm xsi:type="al:Text" background="//@colors.3" foreground="//@colors.3" 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">
@@ -38,7 +38,7 @@
<link>
<businessObjects href="../InheritedStateMachine.room#TransitionPoint:Base$tp0"/>
</link>
- <anchors xsi:type="pi:ChopboxAnchor" referencedGraphicsAlgorithm="//@children.0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0"/>
+ <anchors xsi:type="pi:ChopboxAnchor"/>
<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>
@@ -179,14 +179,14 @@
</children>
</children>
<children xsi:type="pi:ContainerShape" visible="true" active="true">
- <properties key="obj-type" value="trp"/>
+ <properties key="obj-type" value="cp"/>
<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"/>
+ <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="//@connections.4 //@connections.5" incomingConnections="//@connections.3"/>
<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>
diff --git a/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen b/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen
deleted file mode 100644
index 8e4ad56d6..000000000
--- a/tests/org.eclipse.etrice.ui.behavior.tests/output/Base.fsmgen
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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
deleted file mode 100644
index a2a66226f..000000000
--- a/tests/org.eclipse.etrice.ui.behavior.tests/output/Derived.fsmgen
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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
deleted file mode 100644
index 57c3ec88f..000000000
--- a/tests/org.eclipse.etrice.ui.behavior.tests/output/DoubleDerived.fsmgen
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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/AbstractStateMachineTest.java b/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/AbstractStateMachineTest.java
index e75e9521c..04f836404 100644
--- a/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/AbstractStateMachineTest.java
+++ b/tests/org.eclipse.etrice.ui.behavior.tests/src/org/eclipse/etrice/ui/behavior/commands/AbstractStateMachineTest.java
@@ -17,11 +17,9 @@ import java.net.URL;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
import org.eclipse.etrice.core.fsm.fSM.EntryPoint;
import org.eclipse.etrice.core.fsm.fSM.ExitPoint;
-import org.eclipse.etrice.core.fsm.fSM.InitialTransition;
import org.eclipse.etrice.core.fsm.fSM.RefinedState;
import org.eclipse.etrice.core.fsm.fSM.State;
import org.eclipse.etrice.core.fsm.fSM.StateGraph;
@@ -29,6 +27,8 @@ import org.eclipse.etrice.core.fsm.fSM.StateGraphItem;
import org.eclipse.etrice.core.fsm.fSM.TrPoint;
import org.eclipse.etrice.core.fsm.fSM.Transition;
import org.eclipse.etrice.core.fsm.fSM.TransitionPoint;
+import org.eclipse.etrice.core.fsm.util.FSMHelpers;
+import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.tests.base.TestBase;
import org.eclipse.etrice.ui.behavior.BehaviorTestActivator;
import org.eclipse.etrice.ui.behavior.fsm.support.StateSupport;
@@ -49,6 +49,8 @@ import org.eclipse.graphiti.services.Graphiti;
*/
public abstract class AbstractStateMachineTest extends TestBase {
+ private FSMHelpers fsmHelpers = new FSMHelpers();
+
/**
* test general conditions for state graphs
* @param diagram the diagram
@@ -60,15 +62,24 @@ public abstract class AbstractStateMachineTest extends TestBase {
ActorClass ac = (ActorClass) bo;
- boolean hasInitialTransition = false;
- for (Transition trans : sg.getTransitions()) {
- if (trans instanceof InitialTransition) {
- hasInitialTransition = true;
- break;
+ List<PictogramElement> elements;
+
+ // check initial transition
+ {
+ boolean hasInitialTransition = fsmHelpers.hasInitTransition(sg);
+
+ // if this is the top level and we have an inherited initial transition we count that
+ // too since its pe is also linked to the current state graph
+ if (sg==ac.getStateMachine()) {
+ ActorClass theAC = ac.getActorBase();
+ while (theAC!=null) {
+ hasInitialTransition |= fsmHelpers.hasInitTransition(theAC.getStateMachine());
+ theAC = theAC.getActorBase();
+ }
}
+ elements = Graphiti.getLinkService().getPictogramElements(diagram, sg);
+ assertEquals("PEs for our state graph: sg and initial point", hasInitialTransition? 2:1, elements.size());
}
- List<PictogramElement> elements = Graphiti.getLinkService().getPictogramElements(diagram, sg);
- assertEquals("PEs for our state graph: sg and initial point", hasInitialTransition? 2:1, elements.size());
for (State s : sg.getStates()) {
elements = Graphiti.getLinkService().getPictogramElements(diagram, s);
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
deleted file mode 100644
index 7535dfc38..000000000
--- a/tests/org.eclipse.etrice.ui.behavior.tests/xtend-gen/org/eclipse/etrice/ui/behavior/commands/TestFSMGenModel.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * 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