Browse Source

YAKHMI-1024, STatechart and Test for static/dynamic Choice Test

malknet42 11 years ago
parent
commit
8beaa1dd44

+ 7 - 6
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java

@@ -18,9 +18,9 @@ import org.junit.runners.Suite.SuiteClasses;
 @SuiteClasses({ AlwaysOncycle.class, AssignmentAsExpression.class,
 		BitExpressions.class, BooleanExpressions.class, Choice.class,
 		CKeywords.class, Declarations.class, DeepEntry.class,
-		DeepHistory.class, EnterState.class, EntryChoice.class,
-		ExitOnSelfTransition.class, ExitState.class, FeatureCalls.class,
-		Guard.class, GuardedEntry.class, GuardedExit.class,
+		DeepHistory.class, DynamicChoice.class, EnterState.class,
+		EntryChoice.class, ExitOnSelfTransition.class, ExitState.class,
+		FeatureCalls.class, Guard.class, GuardedEntry.class, GuardedExit.class,
 		HistoryWithoutInitialStep.class, InEventLifeCycle.class,
 		IntegerExpressions.class, InternalEventLifeCycle.class,
 		LogicalAndTests.class, LogicalOrTests.class,
@@ -28,8 +28,9 @@ import org.junit.runners.Suite.SuiteClasses;
 		PriorityValues.class, RaiseEvent.class, SameNameDifferentRegion.class,
 		ShallowHistory.class, SimpleEvent.class, SimpleHierachy.class,
 		StatechartLocalReactions.class, StateIsActive.class,
-		STextKeywordsInStatesAndRegions.class, StringExpressions.class,
-		SyncFork.class, SyncJoin.class, TimedTransitions.class,
-		TransitionWithoutCondition.class, ValuedEvents.class })
+		StaticChoice.class, STextKeywordsInStatesAndRegions.class,
+		StringExpressions.class, SyncFork.class, SyncJoin.class,
+		TimedTransitions.class, TransitionWithoutCondition.class,
+		ValuedEvents.class })
 public class AllTests {
 }

+ 39 - 0
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/DynamicChoice.java

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2014 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.generator.c.test;
+
+import java.util.Collection;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.yakindu.sct.generator.c.gtest.GTest;
+import org.yakindu.sct.generator.c.gtest.GTestRunner;
+import org.yakindu.sct.generator.c.gtest.GTestHelper;
+
+@GTest(sourceFile = "gtests/DynamicChoice/DynamicChoice.cc", program = "gtests/DynamicChoice/DynamicChoice", model = "testmodels/SCTUnit/DynamicChoice.sct")
+@RunWith(GTestRunner.class)
+public class DynamicChoice {
+
+	protected final GTestHelper helper = new GTestHelper(this) {
+
+		@Override
+		protected void getSourceFiles(Collection<String> files) {
+			super.getSourceFiles(files);
+			files.add(getFileName(getTestProgram()) + ".c");
+		}
+	};
+
+	@Before
+	public void setUp() {
+		helper.generate();
+		helper.compile();
+	}
+}

+ 3 - 3
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/TimeTrigger.java

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2013 committers of YAKINDU and others.
+ * Copyright (c) 2014 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
@@ -18,9 +18,9 @@ import org.yakindu.sct.generator.c.gtest.GTest;
 import org.yakindu.sct.generator.c.gtest.GTestRunner;
 import org.yakindu.sct.generator.c.gtest.GTestHelper;
 
-@GTest(sourceFile = "gtests/TimeTrigger/TimeTrigger.cc", program = "gtests/TimeTrigger/TimeTrigger", model = "testmodels/SCTUnit/TimeTrigger.sct")
+@GTest(sourceFile = "gtests/StaticChoice/StaticChoice.cc", program = "gtests/StaticChoice/StaticChoice", model = "testmodels/SCTUnit/StaticChoice.sct")
 @RunWith(GTestRunner.class)
-public class TimeTrigger {
+public class StaticChoice {
 
 	protected final GTestHelper helper = new GTestHelper(this) {