瀏覽代碼

Added infrastructure for Interpreter tests

Andreas Mülder 13 年之前
父節點
當前提交
050c4a734e

+ 1 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/.classpath

@@ -3,5 +3,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="testmodels"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

+ 2 - 1
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/build.properties

@@ -1,4 +1,5 @@
-source.. = src/
+source.. = src/,\
+           testmodels/
 output.. = bin/
 bin.includes = META-INF/,\
                .

二進制
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/images/Simple.png


二進制
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/images/SimpleHierachy.png


+ 47 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/org/yakindu/sct/model/sexec/interpreter/test/ExecutionFlowInterpreterTest.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * 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:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.model.sexec.interpreter.test;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import util.AbstractExecutionFlowTest;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class ExecutionFlowInterpreterTest extends AbstractExecutionFlowTest {
+
+
+	@Test
+	public void testSimpleTransition() throws Exception {
+		loadAndconfigureInterpreter(models.createSimpleModel());
+		assertIsActive("A");
+		assertVarValue("MyVar", 0);
+		context().raiseEvent("Event1", null);
+		interpreter.runCycle();
+		assertIsActive("B");
+		assertVarValue("MyVar", 10);
+	}
+	@Test
+	public void testsimpleHierachy() throws IOException{
+		loadAndconfigureInterpreter(models.createSimpleHierachyModel());
+		assertIsActive("A");
+		context().raiseEvent("Event1", null);
+		interpreter.runCycle();
+		assertIsActive("B");
+		assertIsActive("B1");
+	}
+
+}

+ 2 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/org/yakindu/sct/model/sexec/interpreter/test/STextInterpreterTest.java

@@ -14,6 +14,8 @@ import static junit.framework.Assert.assertEquals;
 
 import org.junit.Test;
 
+import util.AbstractSTextTest;
+
 public class STextInterpreterTest extends AbstractSTextTest {
 
 //	@Test

+ 76 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/util/AbstractExecutionFlowTest.java

@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * 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:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package util;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.fail;
+
+import java.util.Set;
+
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.interpreter.IExecutionFlowInterpreter;
+import org.yakindu.sct.model.sexec.interpreter.InterpreterModule;
+import org.yakindu.sct.model.sexec.transformation.SequencerModule;
+import org.yakindu.sct.model.sgraph.RegularState;
+import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
+
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.util.Modules;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class AbstractExecutionFlowTest {
+	@Inject
+	protected IExecutionFlowInterpreter interpreter;
+	@Inject
+	protected TestModels models;
+
+	public AbstractExecutionFlowTest() {
+		Guice.createInjector(
+				Modules.override(new SequencerModule()).with(
+						new InterpreterModule())).injectMembers(this);
+	}
+
+	protected IExecutionContext context() {
+		return interpreter.getExecutionContext();
+	}
+
+	protected void loadAndconfigureInterpreter(ExecutionFlow flow) {
+		interpreter.initialize(flow);
+		interpreter.enter();
+	}
+
+	//
+	// -> Assertion methods...
+	//
+
+	protected void assertVarValue(String variableName, Object value) {
+		ExecutionVariable variable = context().getVariable(variableName);
+		assertEquals(variable.getValue(), value);
+	}
+
+	protected void assertIsActive(String stateName) {
+		Set<RegularState> allActiveStates = context().getAllActiveStates();
+		for (RegularState regularState : allActiveStates) {
+			if (regularState.getName().equals(stateName)) {
+				return;
+			}
+		}
+		fail("Expected active state " + stateName + " but was "
+				+ allActiveStates);
+	}
+
+}

+ 25 - 7
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/org/yakindu/sct/model/sexec/interpreter/test/AbstractSTextTest.java

@@ -1,4 +1,14 @@
-package org.yakindu.sct.model.sexec.interpreter.test;
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * 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:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package util;
 
 import java.io.StringReader;
 
@@ -26,6 +36,11 @@ import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
 public class AbstractSTextTest {
 
 	@Inject
@@ -34,8 +49,8 @@ public class AbstractSTextTest {
 	private ILinker linker;
 	@Inject
 	private XtextResource resource;
-	@Inject 
-	private IExecutionContext context;
+	@Inject
+	private ExecutionContextImpl context;
 	@Inject
 	private StextStatementInterpreter interpreter;
 
@@ -62,11 +77,14 @@ public class AbstractSTextTest {
 	private void initContext() {
 		// "event abc operation foo() var myInt : integer var MyBool : boolean
 		// var myReal : real
-		ExecutionVariable myInt = new ExecutionVariable("myInt", Integer.class, 0);
+		ExecutionVariable myInt = new ExecutionVariable("myInt", Integer.class,
+				0);
 		context.declareVariable(myInt);
-		ExecutionVariable myBool = new ExecutionVariable("myBool", Boolean.class, false);
+		ExecutionVariable myBool = new ExecutionVariable("myBool",
+				Boolean.class, false);
 		context.declareVariable(myBool);
-		ExecutionVariable myFloat = new ExecutionVariable("myFloat", Float.class, 0.0f);
+		ExecutionVariable myFloat = new ExecutionVariable("myFloat",
+				Float.class, 0.0f);
 		context.declareVariable(myFloat);
 		ExecutionEvent event = new ExecutionEvent("abc", Integer.class);
 		context.declareEvent(event);
@@ -136,7 +154,7 @@ public class AbstractSTextTest {
 				defaultScope, Expression.class.getSimpleName());
 		return interpreter.evaluateStatement(statement, context);
 	}
-	
+
 	protected Object executeExpression(String scope, String expression) {
 		Scope defaultScope = createContextScope(scope);
 		Statement statement = (Statement) parseExpression(expression,

+ 82 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src/util/TestModels.java

@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * 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:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package util;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.transformation.ModelSequencer;
+import org.yakindu.sct.model.sgraph.SGraphPackage;
+import org.yakindu.sct.model.sgraph.Statechart;
+
+import com.google.inject.Inject;
+
+/**
+ * Provides access to the testmodels.
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class TestModels {
+
+	private static final String TESTMODEL_DIR = "org.yakindu.sct.model.sexec.interpreter.test/testmodels/";
+
+	private static final String SIMPLE = "Simple.sct";
+	private static final String SIMPLE_HIERACHY = "SimpleHierachy.sct";
+
+	@Inject
+	private ModelSequencer sequencer;
+
+	/**
+	 * <img src="../../images/Simple.png" /> <br />
+	 * Creates a simple {@link Statechart} with two States and one Transition
+	 * @return the {@link ExecutionFlow}
+	 * @throws IOException
+	 */
+	public ExecutionFlow createSimpleModel() throws IOException {
+		return loadFromResource(SIMPLE);
+	}
+	
+	/**
+	 * <img src="../../images/SimpleHierachy.png" /> <br />
+	 * Creates a simple {@link Statechart} with two States and one Transition
+	 * @return the {@link ExecutionFlow}
+	 * @throws IOException
+	 */
+	public ExecutionFlow createSimpleHierachyModel() throws IOException {
+		return loadFromResource(SIMPLE_HIERACHY);
+	}
+	
+
+	/**
+	 * Helper method - loads a testmodel from the Testmodel directory
+	 * 
+	 * @param fileName
+	 *            the filename of the testmodel
+	 * @return the {@link ExecutionFlow}
+	 * @throws IOException
+	 */
+	private ExecutionFlow loadFromResource(String fileName) throws IOException {
+		Assert.isNotNull(fileName);
+		URI uri = URI.createPlatformPluginURI(TESTMODEL_DIR + fileName, true);
+		ResourceSetImpl impl = new ResourceSetImpl();
+		Resource resource = impl.getResource(uri, true);
+		Statechart statechart = (Statechart) EcoreUtil.getObjectByType(
+				resource.getContents(), SGraphPackage.Literals.STATECHART);
+		Assert.isNotNull(statechart);
+		return sequencer.transform(statechart);
+	}
+}

+ 100 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/testmodels/Simple.sct

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:sgraph="http://www.yakindu.org/sct/sgraph/2.0.0">
+  <sgraph:Statechart xmi:id="_RHEiAHNtEeGtAMDjlTj9eQ" specification="internal:&#xD;&#xA;event Event1&#xD;&#xA;var MyVar : integer = 0" name="Simple">
+    <regions xmi:id="_RHIMYnNtEeGtAMDjlTj9eQ" name="main region">
+      <vertices xsi:type="sgraph:Entry" xmi:id="_RHZSIXNtEeGtAMDjlTj9eQ">
+        <outgoingTransitions xmi:id="_RHjDIXNtEeGtAMDjlTj9eQ" target="_RHc8gXNtEeGtAMDjlTj9eQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_RHc8gXNtEeGtAMDjlTj9eQ" name="A" incomingTransitions="_RHjDIXNtEeGtAMDjlTj9eQ">
+        <outgoingTransitions xmi:id="_Wl3F8HNtEeGtAMDjlTj9eQ" specification="Event1" target="_V-iAMHNtEeGtAMDjlTj9eQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_V-iAMHNtEeGtAMDjlTj9eQ" specification="entry / MyVar = 10" name="B" incomingTransitions="_Wl3F8HNtEeGtAMDjlTj9eQ"/>
+    </regions>
+  </sgraph:Statechart>
+  <notation:Diagram xmi:id="_RHIMYHNtEeGtAMDjlTj9eQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_RHEiAHNtEeGtAMDjlTj9eQ" measurementUnit="Pixel">
+    <children xmi:id="_RHRWUHNtEeGtAMDjlTj9eQ" type="Region" element="_RHIMYnNtEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_RHW14HNtEeGtAMDjlTj9eQ" type="RegionName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_RHW14XNtEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_RHW14nNtEeGtAMDjlTj9eQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_RHXc8HNtEeGtAMDjlTj9eQ" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+        <children xmi:id="_RHZ5MHNtEeGtAMDjlTj9eQ" type="Entry" element="_RHZSIXNtEeGtAMDjlTj9eQ">
+          <children xmi:id="_RHbHUHNtEeGtAMDjlTj9eQ" type="BorderItemLabelContainer">
+            <children xsi:type="notation:DecorationNode" xmi:id="_RHcVcHNtEeGtAMDjlTj9eQ" type="BorderItemLabel">
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_RHcVcXNtEeGtAMDjlTj9eQ"/>
+              <layoutConstraint xsi:type="notation:Location" xmi:id="_RHcVcnNtEeGtAMDjlTj9eQ"/>
+            </children>
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_RHbHUXNtEeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+            <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHbHUnNtEeGtAMDjlTj9eQ"/>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_RHZ5MXNtEeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHc8gHNtEeGtAMDjlTj9eQ" x="70" y="20"/>
+        </children>
+        <children xmi:id="_RHeKoHNtEeGtAMDjlTj9eQ" type="State" element="_RHc8gXNtEeGtAMDjlTj9eQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_RHf_0HNtEeGtAMDjlTj9eQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_RHf_0XNtEeGtAMDjlTj9eQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_RHf_0nNtEeGtAMDjlTj9eQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_RHhN8HNtEeGtAMDjlTj9eQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_RHhN8XNtEeGtAMDjlTj9eQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHhN8nNtEeGtAMDjlTj9eQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_RHicEHNtEeGtAMDjlTj9eQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_RHexsHNtEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_RHexsXNtEeGtAMDjlTj9eQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_RHicEXNtEeGtAMDjlTj9eQ"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHjDIHNtEeGtAMDjlTj9eQ" x="50" y="80"/>
+        </children>
+        <children xmi:id="_V-m4sHNtEeGtAMDjlTj9eQ" type="State" element="_V-iAMHNtEeGtAMDjlTj9eQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_V-oG0HNtEeGtAMDjlTj9eQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_V-oG0XNtEeGtAMDjlTj9eQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_V-oG0nNtEeGtAMDjlTj9eQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_V-ot4HNtEeGtAMDjlTj9eQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_V-ot4XNtEeGtAMDjlTj9eQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_V-ot4nNtEeGtAMDjlTj9eQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_V-p8AHNtEeGtAMDjlTj9eQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_V-m4sXNtEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_V-m4snNtEeGtAMDjlTj9eQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_V-p8AXNtEeGtAMDjlTj9eQ"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_V-m4s3NtEeGtAMDjlTj9eQ" x="189" y="78" width="151"/>
+        </children>
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHXc8XNtEeGtAMDjlTj9eQ"/>
+      </children>
+      <styles xsi:type="notation:ShapeStyle" xmi:id="_RHRWUXNtEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHZSIHNtEeGtAMDjlTj9eQ" x="220" y="10" width="400" height="191"/>
+    </children>
+    <children xsi:type="notation:Shape" xmi:id="_RHn7oHNtEeGtAMDjlTj9eQ" type="StatechartText" fontName="Verdana" lineColor="4210752">
+      <children xsi:type="notation:DecorationNode" xmi:id="_RHpJwHNtEeGtAMDjlTj9eQ" type="StatechartName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_RHpJwXNtEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_RHpJwnNtEeGtAMDjlTj9eQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_RHpJw3NtEeGtAMDjlTj9eQ" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHpJxHNtEeGtAMDjlTj9eQ"/>
+      </children>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_RHqX4HNtEeGtAMDjlTj9eQ" x="10" y="10" width="200" height="191"/>
+    </children>
+    <styles xsi:type="notation:DiagramStyle" xmi:id="_RHIMYXNtEeGtAMDjlTj9eQ"/>
+    <edges xmi:id="_RHlfYHNtEeGtAMDjlTj9eQ" type="Transition" element="_RHjDIXNtEeGtAMDjlTj9eQ" source="_RHZ5MHNtEeGtAMDjlTj9eQ" target="_RHeKoHNtEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_RHnUkHNtEeGtAMDjlTj9eQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_RHnUkXNtEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_RHnUknNtEeGtAMDjlTj9eQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_RHlfYXNtEeGtAMDjlTj9eQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_RHmtgHNtEeGtAMDjlTj9eQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_RHmGcHNtEeGtAMDjlTj9eQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    </edges>
+    <edges xmi:id="_Wl6wUHNtEeGtAMDjlTj9eQ" type="Transition" element="_Wl3F8HNtEeGtAMDjlTj9eQ" source="_RHeKoHNtEeGtAMDjlTj9eQ" target="_V-m4sHNtEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_Wl7XYXNtEeGtAMDjlTj9eQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_Wl7-cHNtEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_Wl7-cXNtEeGtAMDjlTj9eQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_Wl6wUXNtEeGtAMDjlTj9eQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_Wl7XYHNtEeGtAMDjlTj9eQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_Wl6wUnNtEeGtAMDjlTj9eQ" points="[18, 4, -191, -4]$[207, -17, -2, -25]"/>
+    </edges>
+  </notation:Diagram>
+</xmi:XMI>

+ 158 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/testmodels/SimpleHierachy.sct

@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:sgraph="http://www.yakindu.org/sct/sgraph/2.0.0">
+  <sgraph:Statechart xmi:id="_7tWuQHNzEeGtAMDjlTj9eQ" specification="internal:&#xD;&#xA;event Event1 : void" name="SimpleHierachy">
+    <regions xmi:id="_7tYjcnNzEeGtAMDjlTj9eQ" name="main region">
+      <vertices xsi:type="sgraph:Entry" xmi:id="_7tbmwXNzEeGtAMDjlTj9eQ">
+        <outgoingTransitions xmi:id="_7tiUcXNzEeGtAMDjlTj9eQ" target="_7teqEHNzEeGtAMDjlTj9eQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_7teqEHNzEeGtAMDjlTj9eQ" name="A" incomingTransitions="_7tiUcXNzEeGtAMDjlTj9eQ">
+        <outgoingTransitions xmi:id="_9lmCQHNzEeGtAMDjlTj9eQ" specification="Event1" target="_8YlckHNzEeGtAMDjlTj9eQ"/>
+      </vertices>
+      <vertices xsi:type="sgraph:State" xmi:id="_8YlckHNzEeGtAMDjlTj9eQ" name="B" incomingTransitions="_9lmCQHNzEeGtAMDjlTj9eQ">
+        <regions xmi:id="_-bcsMHNzEeGtAMDjlTj9eQ" name="subregion1">
+          <vertices xsi:type="sgraph:State" xmi:id="_EUXAUHN0EeGtAMDjlTj9eQ" name="B1" incomingTransitions="_GE5J0HN0EeGtAMDjlTj9eQ"/>
+          <vertices xsi:type="sgraph:Entry" xmi:id="_Fq8_0HN0EeGtAMDjlTj9eQ">
+            <outgoingTransitions xmi:id="_GE5J0HN0EeGtAMDjlTj9eQ" specification="" target="_EUXAUHN0EeGtAMDjlTj9eQ"/>
+          </vertices>
+        </regions>
+      </vertices>
+    </regions>
+  </sgraph:Statechart>
+  <notation:Diagram xmi:id="_7tYjcHNzEeGtAMDjlTj9eQ" type="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor" element="_7tWuQHNzEeGtAMDjlTj9eQ" measurementUnit="Pixel">
+    <children xmi:id="_7tYjc3NzEeGtAMDjlTj9eQ" type="Region" element="_7tYjcnNzEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_7tZxkHNzEeGtAMDjlTj9eQ" type="RegionName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_7tZxkXNzEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_7tZxknNzEeGtAMDjlTj9eQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_7ta_sHNzEeGtAMDjlTj9eQ" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+        <children xmi:id="_7tcN0HNzEeGtAMDjlTj9eQ" type="Entry" element="_7tbmwXNzEeGtAMDjlTj9eQ">
+          <children xmi:id="_7tdb8HNzEeGtAMDjlTj9eQ" type="BorderItemLabelContainer">
+            <children xsi:type="notation:DecorationNode" xmi:id="_7teDAHNzEeGtAMDjlTj9eQ" type="BorderItemLabel">
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_7teDAXNzEeGtAMDjlTj9eQ"/>
+              <layoutConstraint xsi:type="notation:Location" xmi:id="_7teDAnNzEeGtAMDjlTj9eQ"/>
+            </children>
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_7tdb8XNzEeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+            <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tdb8nNzEeGtAMDjlTj9eQ"/>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_7tcN0XNzEeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7teDA3NzEeGtAMDjlTj9eQ" x="70" y="20"/>
+        </children>
+        <children xmi:id="_7tfRIHNzEeGtAMDjlTj9eQ" type="State" element="_7teqEHNzEeGtAMDjlTj9eQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_7tgfQHNzEeGtAMDjlTj9eQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_7tgfQXNzEeGtAMDjlTj9eQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_7tgfQnNzEeGtAMDjlTj9eQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_7tgfQ3NzEeGtAMDjlTj9eQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_7tgfRHNzEeGtAMDjlTj9eQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tgfRXNzEeGtAMDjlTj9eQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_7thtYHNzEeGtAMDjlTj9eQ" type="StateFigureCompartment"/>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_7tfRIXNzEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_7tfRInNzEeGtAMDjlTj9eQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_7thtYXNzEeGtAMDjlTj9eQ"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tiUcHNzEeGtAMDjlTj9eQ" x="10" y="94" width="140" height="115"/>
+        </children>
+        <children xmi:id="_8Yof4HNzEeGtAMDjlTj9eQ" type="State" element="_8YlckHNzEeGtAMDjlTj9eQ">
+          <children xsi:type="notation:DecorationNode" xmi:id="_8YpuAHNzEeGtAMDjlTj9eQ" type="StateName">
+            <styles xsi:type="notation:ShapeStyle" xmi:id="_8YpuAXNzEeGtAMDjlTj9eQ"/>
+            <layoutConstraint xsi:type="notation:Location" xmi:id="_8YpuAnNzEeGtAMDjlTj9eQ"/>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_8YpuA3NzEeGtAMDjlTj9eQ" type="StateTextCompartment">
+            <children xsi:type="notation:Shape" xmi:id="_8YqVEHNzEeGtAMDjlTj9eQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_8YqVEXNzEeGtAMDjlTj9eQ"/>
+            </children>
+          </children>
+          <children xsi:type="notation:Compartment" xmi:id="_8Yq8IHNzEeGtAMDjlTj9eQ" type="StateFigureCompartment">
+            <children xmi:id="_-behYHNzEeGtAMDjlTj9eQ" type="Region" element="_-bcsMHNzEeGtAMDjlTj9eQ">
+              <children xsi:type="notation:DecorationNode" xmi:id="_-bfvgHNzEeGtAMDjlTj9eQ" type="RegionName">
+                <styles xsi:type="notation:ShapeStyle" xmi:id="_-bfvgXNzEeGtAMDjlTj9eQ"/>
+                <layoutConstraint xsi:type="notation:Location" xmi:id="_-bfvgnNzEeGtAMDjlTj9eQ"/>
+              </children>
+              <children xsi:type="notation:Shape" xmi:id="_-bgWkHNzEeGtAMDjlTj9eQ" type="RegionCompartment" fontName="Verdana" lineColor="4210752">
+                <children xmi:id="_EUY1gHN0EeGtAMDjlTj9eQ" type="State" element="_EUXAUHN0EeGtAMDjlTj9eQ">
+                  <children xsi:type="notation:DecorationNode" xmi:id="_EUaDoHN0EeGtAMDjlTj9eQ" type="StateName">
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_EUaDoXN0EeGtAMDjlTj9eQ"/>
+                    <layoutConstraint xsi:type="notation:Location" xmi:id="_EUaqsHN0EeGtAMDjlTj9eQ"/>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_EUaqsXN0EeGtAMDjlTj9eQ" type="StateTextCompartment">
+                    <children xsi:type="notation:Shape" xmi:id="_EUaqsnN0EeGtAMDjlTj9eQ" type="StateTextCompartmentExpression" fontName="Verdana" lineColor="4210752">
+                      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EUaqs3N0EeGtAMDjlTj9eQ"/>
+                    </children>
+                  </children>
+                  <children xsi:type="notation:Compartment" xmi:id="_EUb40HN0EeGtAMDjlTj9eQ" type="StateFigureCompartment"/>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_EUY1gXN0EeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+                  <styles xsi:type="notation:FontStyle" xmi:id="_EUY1gnN0EeGtAMDjlTj9eQ"/>
+                  <styles xsi:type="notation:BooleanValueStyle" xmi:id="_EUb40XN0EeGtAMDjlTj9eQ"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EUY1g3N0EeGtAMDjlTj9eQ" x="133" y="33"/>
+                </children>
+                <children xmi:id="_Fq_cEHN0EeGtAMDjlTj9eQ" type="Entry" element="_Fq8_0HN0EeGtAMDjlTj9eQ">
+                  <children xmi:id="_FrAqMHN0EeGtAMDjlTj9eQ" type="BorderItemLabelContainer">
+                    <children xsi:type="notation:DecorationNode" xmi:id="_FrB4UHN0EeGtAMDjlTj9eQ" type="BorderItemLabel">
+                      <styles xsi:type="notation:ShapeStyle" xmi:id="_FrB4UXN0EeGtAMDjlTj9eQ"/>
+                      <layoutConstraint xsi:type="notation:Location" xmi:id="_FrB4UnN0EeGtAMDjlTj9eQ"/>
+                    </children>
+                    <styles xsi:type="notation:ShapeStyle" xmi:id="_FrAqMXN0EeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+                    <layoutConstraint xsi:type="notation:Bounds" xmi:id="_FrAqMnN0EeGtAMDjlTj9eQ"/>
+                  </children>
+                  <styles xsi:type="notation:ShapeStyle" xmi:id="_Fq_cEXN0EeGtAMDjlTj9eQ" fontName="Verdana" lineColor="4210752"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_Fq_cEnN0EeGtAMDjlTj9eQ" x="26" y="51"/>
+                </children>
+                <layoutConstraint xsi:type="notation:Bounds" xmi:id="_-bgWkXNzEeGtAMDjlTj9eQ"/>
+              </children>
+              <styles xsi:type="notation:ShapeStyle" xmi:id="_-behYXNzEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+              <layoutConstraint xsi:type="notation:Bounds" xmi:id="_-behYnNzEeGtAMDjlTj9eQ"/>
+            </children>
+          </children>
+          <styles xsi:type="notation:ShapeStyle" xmi:id="_8Yof4XNzEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
+          <styles xsi:type="notation:FontStyle" xmi:id="_8Yof4nNzEeGtAMDjlTj9eQ"/>
+          <styles xsi:type="notation:BooleanValueStyle" xmi:id="_8Yq8IXNzEeGtAMDjlTj9eQ"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_8Yof43NzEeGtAMDjlTj9eQ" x="229" y="20" width="246" height="236"/>
+        </children>
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7ta_sXNzEeGtAMDjlTj9eQ"/>
+      </children>
+      <styles xsi:type="notation:ShapeStyle" xmi:id="_7tYjdHNzEeGtAMDjlTj9eQ" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tbmwHNzEeGtAMDjlTj9eQ" x="220" y="10" width="521" height="306"/>
+    </children>
+    <children xsi:type="notation:Shape" xmi:id="_7tkJoHNzEeGtAMDjlTj9eQ" type="StatechartText" fontName="Verdana" lineColor="4210752">
+      <children xsi:type="notation:DecorationNode" xmi:id="_7tkwsHNzEeGtAMDjlTj9eQ" type="StatechartName">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_7tkwsXNzEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_7tlXwHNzEeGtAMDjlTj9eQ"/>
+      </children>
+      <children xsi:type="notation:Shape" xmi:id="_7tlXwXNzEeGtAMDjlTj9eQ" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
+        <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tlXwnNzEeGtAMDjlTj9eQ"/>
+      </children>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_7tl-0HNzEeGtAMDjlTj9eQ" x="10" y="10" width="200" height="306"/>
+    </children>
+    <styles xsi:type="notation:DiagramStyle" xmi:id="_7tYjcXNzEeGtAMDjlTj9eQ"/>
+    <edges xmi:id="_7ti7gHNzEeGtAMDjlTj9eQ" type="Transition" element="_7tiUcXNzEeGtAMDjlTj9eQ" source="_7tcN0HNzEeGtAMDjlTj9eQ" target="_7tfRIHNzEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_7tjikXNzEeGtAMDjlTj9eQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_7tjiknNzEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_7tjik3NzEeGtAMDjlTj9eQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_7ti7gXNzEeGtAMDjlTj9eQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_7tjikHNzEeGtAMDjlTj9eQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_7ti7gnNzEeGtAMDjlTj9eQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+    </edges>
+    <edges xmi:id="_9loegHNzEeGtAMDjlTj9eQ" type="Transition" element="_9lmCQHNzEeGtAMDjlTj9eQ" source="_7tfRIHNzEeGtAMDjlTj9eQ" target="_8Yof4HNzEeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_9lpsoHNzEeGtAMDjlTj9eQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_9lpsoXNzEeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_9lpsonNzEeGtAMDjlTj9eQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_9loegXNzEeGtAMDjlTj9eQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_9lpFkHNzEeGtAMDjlTj9eQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_9loegnNzEeGtAMDjlTj9eQ" points="[60, 1, -74, -6]$[131, -18, -3, -25]"/>
+      <sourceAnchor xsi:type="notation:IdentityAnchor" xmi:id="_9m1_cHNzEeGtAMDjlTj9eQ" id="(0.9357142857142857,0.41739130434782606)"/>
+    </edges>
+    <edges xmi:id="_GE7mEHN0EeGtAMDjlTj9eQ" type="Transition" element="_GE5J0HN0EeGtAMDjlTj9eQ" source="_Fq_cEHN0EeGtAMDjlTj9eQ" target="_EUY1gHN0EeGtAMDjlTj9eQ">
+      <children xsi:type="notation:DecorationNode" xmi:id="_GE80MHN0EeGtAMDjlTj9eQ" type="TransitionExpression">
+        <styles xsi:type="notation:ShapeStyle" xmi:id="_GE80MXN0EeGtAMDjlTj9eQ"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_GE80MnN0EeGtAMDjlTj9eQ" y="10"/>
+      </children>
+      <styles xsi:type="notation:ConnectorStyle" xmi:id="_GE7mEXN0EeGtAMDjlTj9eQ" lineColor="4210752"/>
+      <styles xsi:type="notation:FontStyle" xmi:id="_GE8NIHN0EeGtAMDjlTj9eQ" fontName="Verdana"/>
+      <bendpoints xsi:type="notation:RelativeBendpoints" xmi:id="_GE7mEnN0EeGtAMDjlTj9eQ" points="[7, 0, -97, 5]$[106, -15, 2, -10]"/>
+      <targetAnchor xsi:type="notation:IdentityAnchor" xmi:id="_GGGDsHN0EeGtAMDjlTj9eQ" id="(0.1,0.4642857142857143)"/>
+    </edges>
+  </notation:Diagram>
+</xmi:XMI>