Browse Source

regenerated interpreter tests

Axel Terfloth 9 years ago
parent
commit
0b995fd017

+ 16 - 8
test-plugins/org.yakindu.sct.simulation.core.sexec.test/model/test.sgen

@@ -8,14 +8,6 @@ GeneratorModel for sctunit::interpreter {
 		}
 	}	
 	
-	test EntryReactionAction{ 
-		
-		feature Outlet{ 
-			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
-			targetFolder = "test-gen"			
-		}			
-	}
-	
 	test AlwaysOncycle{ 
 		
 		feature Outlet{ 
@@ -153,6 +145,14 @@ GeneratorModel for sctunit::interpreter {
 		}			
 	}	
 	
+	test EntryReactionAction{ 
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
 	test ExitOnSelfTransition{
 		
 		feature Outlet{ 
@@ -470,6 +470,14 @@ GeneratorModel for sctunit::interpreter {
 		}			
 	}
 	
+	test TriggerExpressionPrecedence{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
 	test TypeAlias{
 		
 		feature Outlet{ 

+ 2 - 1
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/AllTestsTest.java

@@ -29,6 +29,7 @@ import org.junit.runners.Suite.SuiteClasses;
 		ShallowHistoryWithDeepEntryTest.class, SimpleEventTest.class, SimpleHierachyTest.class,
 		StatechartActiveTest.class, StatechartLocalReactionsTest.class, StateIsActiveTest.class, StaticChoiceTest.class,
 		STextKeywordsInStatesAndRegionsTest.class, StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		TransitionWithoutConditionTest.class, TriggerGuardExpressionsTest.class, ValuedEventsTest.class})
+		TransitionWithoutConditionTest.class, TriggerGuardExpressionsTest.class, TriggerExpressionPrecedenceTest.class,
+		ValuedEventsTest.class})
 public class AllTestsTest {
 }

+ 67 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/TriggerExpressionPrecedenceTest.java

@@ -0,0 +1,67 @@
+/**
+* Copyright (c) 2016 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.simulation.core.sexec.test;
+import org.eclipse.xtext.junit4.InjectWith;
+import org.eclipse.xtext.junit4.XtextRunner;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.interpreter.test.util.AbstractExecutionFlowTest;
+import org.yakindu.sct.model.sexec.interpreter.test.util.SExecInjectionProvider;
+import org.yakindu.sct.test.models.SCTUnitTestModels;
+import com.google.inject.Inject;
+import static org.junit.Assert.assertTrue;
+/**
+ *  Unit TestCase for TriggerExpressionPrecedence
+ */
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(SExecInjectionProvider.class)
+public class TriggerExpressionPrecedenceTest extends AbstractExecutionFlowTest {
+	@Before
+	public void setup() throws Exception {
+		ExecutionFlow flow = models.loadExecutionFlowFromResource("expressions/TriggerExpressionPrecedence.sct");
+		initInterpreter(flow);
+	}
+	@Test
+	public void unsatisfiedTriggerAndFGuardFalseOrFalse() throws Exception {
+		interpreter.enter();
+		setBoolean("c1", false);
+		setBoolean("c2", false);
+		interpreter.runCycle();
+		assertTrue(!getBoolean("e1_transition"));
+	}
+	@Test
+	public void unsatisfiedTriggerAndFGuardTrueOrFalse() throws Exception {
+		interpreter.enter();
+		setBoolean("c1", true);
+		setBoolean("c2", false);
+		interpreter.runCycle();
+		assertTrue(!getBoolean("e1_transition"));
+	}
+	@Test
+	public void unsatisfiedTriggerAndFGuardFalseOrTrue() throws Exception {
+		interpreter.enter();
+		setBoolean("c1", false);
+		setBoolean("c2", true);
+		interpreter.runCycle();
+		assertTrue(!getBoolean("e1_transition"));
+	}
+	@Test
+	public void unsatisfiedTriggerAndFGuardTrueOrTrue() throws Exception {
+		interpreter.enter();
+		setBoolean("c1", true);
+		setBoolean("c2", true);
+		interpreter.runCycle();
+		assertTrue(!getBoolean("e1_transition"));
+	}
+}