Browse Source

Added SimpleEvent Test Case to Generator Tests

Andreas Mülder 13 years ago
parent
commit
c3888e1123

+ 37 - 26
test-plugins/org.yakindu.sct.generator.java.test/src/org/yakindu/sct/generator/java/JavaSCTGeneratorTest.java

@@ -17,12 +17,14 @@ import static util.TestModels.FEATURE_CALLS;
 import static util.TestModels.GUARD;
 import static util.TestModels.PRIORITY_VALUES;
 import static util.TestModels.SHALLOW_HISTORY;
+import static util.TestModels.SIMPLE_EVENT;
 import static util.TestModels.SIMPLE_HIERACHY;
 import static util.TestModels.STATECHART_LOCAL_REACTIONS;
 import static util.TestModels.STATE_ACTIVE;
 import static util.TestModels.SYNC_FORK;
 import static util.TestModels.SYNC_JOIN;
 import static util.TestModels.TIME_TRIGGER;
+import static util.TestModels.VALUED_EVENTS;
 
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.runtime.CoreException;
@@ -54,46 +56,39 @@ public class JavaSCTGeneratorTest extends AbstractJavaGeneratorTest {
 	private TestModels models;
 
 	@Test
-	public void testGuardModel() throws Exception {
-		Statechart statechart = models.loadStatechartFromResource(GUARD);
-		failOnError(generateAndCompile(statechart));
-	}
-
-	@Test
-	public void testSimpleHierachyModel() throws Exception {
+	public void testAlwaysOnCycleModel() throws Exception {
 		Statechart statechart = models
-				.loadStatechartFromResource(SIMPLE_HIERACHY);
+				.loadStatechartFromResource(ALWAYS_ONCYCLE);
 		failOnError(generateAndCompile(statechart));
 
 	}
 
 	@Test
-	public void testDeepHistoryModel() throws Exception {
-		Statechart statechart = models.loadStatechartFromResource(DEEP_HISTORY);
+	public void testChoiceModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(CHOICE);
 		failOnError(generateAndCompile(statechart));
 
 	}
 
 	@Test
-	public void testStateActiveModel() throws Exception {
-		Statechart statechart = models.loadStatechartFromResource(STATE_ACTIVE);
+	public void testDeepHistoryModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(DEEP_HISTORY);
 		failOnError(generateAndCompile(statechart));
 
 	}
 
 	@Test
-	public void testChoiceModel() throws Exception {
-		Statechart statechart = models.loadStatechartFromResource(CHOICE);
+	public void testFeatureCallsModel() throws Exception {
+		Statechart statechart = models
+				.loadStatechartFromResource(FEATURE_CALLS);
 		failOnError(generateAndCompile(statechart));
 
 	}
 
 	@Test
-	public void testAlwaysOnCycleModel() throws Exception {
-		Statechart statechart = models
-				.loadStatechartFromResource(ALWAYS_ONCYCLE);
+	public void testGuardModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(GUARD);
 		failOnError(generateAndCompile(statechart));
-
 	}
 
 	@Test
@@ -101,7 +96,6 @@ public class JavaSCTGeneratorTest extends AbstractJavaGeneratorTest {
 		Statechart statechart = models
 				.loadStatechartFromResource(PRIORITY_VALUES);
 		failOnError(generateAndCompile(statechart));
-
 	}
 
 	@Test
@@ -109,22 +103,19 @@ public class JavaSCTGeneratorTest extends AbstractJavaGeneratorTest {
 		Statechart statechart = models
 				.loadStatechartFromResource(SHALLOW_HISTORY);
 		failOnError(generateAndCompile(statechart));
-
 	}
 
 	@Test
-	public void testTimeTriggerModel() throws Exception {
-		Statechart statechart = models.loadStatechartFromResource(TIME_TRIGGER);
+	public void testSimpleEventModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(SIMPLE_EVENT);
 		failOnError(generateAndCompile(statechart));
-
 	}
 
 	@Test
-	public void testFeatureCallsModel() throws Exception {
+	public void testSimpleHierachyModel() throws Exception {
 		Statechart statechart = models
-				.loadStatechartFromResource(FEATURE_CALLS);
+				.loadStatechartFromResource(SIMPLE_HIERACHY);
 		failOnError(generateAndCompile(statechart));
-
 	}
 
 	@Test
@@ -135,6 +126,13 @@ public class JavaSCTGeneratorTest extends AbstractJavaGeneratorTest {
 
 	}
 
+	@Test
+	public void testStateActiveModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(STATE_ACTIVE);
+		failOnError(generateAndCompile(statechart));
+
+	}
+
 	@Test
 	public void testSyncForkModel() throws Exception {
 		Statechart statechart = models.loadStatechartFromResource(SYNC_FORK);
@@ -147,6 +145,19 @@ public class JavaSCTGeneratorTest extends AbstractJavaGeneratorTest {
 		failOnError(generateAndCompile(statechart));
 	}
 
+	@Test
+	public void testTimeTriggerModel() throws Exception {
+		Statechart statechart = models.loadStatechartFromResource(TIME_TRIGGER);
+		failOnError(generateAndCompile(statechart));
+	}
+
+	@Test
+	public void testValuedEventsModel() throws Exception {
+		Statechart statechart = models
+				.loadStatechartFromResource(VALUED_EVENTS);
+		failOnError(generateAndCompile(statechart));
+	}
+
 	private void failOnError(IMarker[] diagnostics) throws CoreException {
 		for (IMarker diagnostic : diagnostics) {
 			int severity = (Integer) diagnostic.getAttribute("severity");