diff options
author | Henrik Rentz-Reichert | 2017-11-10 10:22:25 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2017-11-10 19:57:25 +0000 |
commit | b5b1401f30884bdc6c160f8500e3f29b6566c481 (patch) | |
tree | e4c3f9027ac047ac2e25922801a1bb6eb7d5bbd9 /tests/org.eclipse.etrice.core.genmodel.fsm.tests | |
parent | 2e9666c1b52cef7d82be927d14e6dc8b57587a81 (diff) | |
download | org.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/org.eclipse.etrice.core.genmodel.fsm.tests')
10 files changed, 0 insertions, 1223 deletions
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); - } -} |