diff options
author | Henrik Rentz-Reichert | 2019-10-11 15:09:55 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2019-10-11 15:09:56 +0000 |
commit | ad0bc76a408854724e435312d0660d6ba6d9f7e1 (patch) | |
tree | 5b80458a1aa2488925db30f1239fbb69ad733601 /tests | |
parent | 450084d29b75b624d81abf7b2bb3975fa9a77c79 (diff) | |
parent | dc6f84b6d54721849d419d098436f4deb27f9b3b (diff) | |
download | org.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.tar.gz org.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.tar.xz org.eclipse.etrice-ad0bc76a408854724e435312d0660d6ba6d9f7e1.zip |
Merge "Bug 551966 - [fsm] allow subgraphs without init transition"
Diffstat (limited to 'tests')
2 files changed, 98 insertions, 0 deletions
diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMInitTransition.room b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMInitTransition.room new file mode 100644 index 000000000..7b09e9dad --- /dev/null +++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/models/HierFSMInitTransition.room @@ -0,0 +1,55 @@ +/* + * Bug 551966 - [fsm] Allow subgraph without init transition + */ +RoomModel HierFSMInitTransition { + + ActorClass TestActor { + Interface { + Port p0: PC + } + Structure { + external Port p0 + } + Behavior { + StateMachine { + State state0 + + State state1 { + subgraph { + EntryPoint tr0 + ExitPoint tr1 + Transition tr2: my tr0 -> state0 + State state0 + Transition tr3: state0 -> my tr1 { + triggers { + <in1: p0> + } + } + } + } + Transition init0: initial -> state0 + State state2 + Transition tr0: state0 -> tr0 of state1 { + triggers { + <in1: p0> + } + } + Transition tr1: tr1 of state1 -> state2 + Transition tr2: state1 -> state1 { + triggers { + <in1: p0> + } + } + } + } + } + + ProtocolClass PC { + incoming { + Message in1() + Message in2() + } + outgoing { + } + } +} diff --git a/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFSMInitTransition.xtend b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFSMInitTransition.xtend new file mode 100644 index 000000000..660bbe526 --- /dev/null +++ b/tests/org.eclipse.etrice.core.genmodel.fsm.tests/src/org/eclipse/etrice/core/genmodel/fsm/tests/TestFSMInitTransition.xtend @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2010 protos software gmbh (http://www.protos.de). + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * CONTRIBUTORS: + * Juergen Haug (initial contribution) + * + *******************************************************************************/ + +package org.eclipse.etrice.core.genmodel.fsm.tests + +import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer +import org.junit.Before +import org.junit.Test + +import static org.junit.Assert.assertFalse +import static org.junit.Assert.assertNotNull + +/** + * Bug 551966 - [fsm] Allow subgraph without init transition + */ +class TestFSMInitTransition extends FsmGenTestBase { + + GraphContainer gc + + @Before + def void setUp() { + gc = getGraphContainer("HierFSMInitTransition.room", "TestActor") + assertNotNull("graph context was created", gc) + } + + @Test + def void noErrors() { + // there is a check in the ExtendedFsmGenBuilder which is called during setUp + assertFalse("logger has no errors", diagnostician.isFailed) + } + +}
\ No newline at end of file |