Browse Source

Removed StateWithEmptyRegion test

Andreas Mülder 12 years ago
parent
commit
86f85d1e5e
13 changed files with 28 additions and 352 deletions
  1. 0 22
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StateWithEmptyRegion/StateWithEmptyRegion.cc
  2. 0 8
      test-plugins/org.yakindu.sct.generator.c.test/gtests/StateWithEmptyRegion/StateWithEmptyRegion.sgen
  3. 0 8
      test-plugins/org.yakindu.sct.generator.c.test/model/test.sgen
  4. 8 14
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java
  5. 0 39
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/StateWithEmptyRegion.java
  6. 0 12
      test-plugins/org.yakindu.sct.generator.java.test/model/model.sgen
  7. 0 6
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/statewithemptyregion/IStateWithEmptyRegionStatemachine.java
  8. 0 114
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/statewithemptyregion/StateWithEmptyRegionStatemachine.java
  9. 10 14
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTests.java
  10. 0 45
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/StateWithEmptyRegionTest.java
  11. 0 8
      test-plugins/org.yakindu.sct.model.sexec.interpreter.test/model/test.sgen
  12. 10 14
      test-plugins/org.yakindu.sct.model.sexec.interpreter.test/test-gen/org/yakindu/sct/model/sexec/interpreter/test/AllTests.java
  13. 0 48
      test-plugins/org.yakindu.sct.model.sexec.interpreter.test/test-gen/org/yakindu/sct/model/sexec/interpreter/test/StateWithEmptyRegionTest.java

+ 0 - 22
test-plugins/org.yakindu.sct.generator.c.test/gtests/StateWithEmptyRegion/StateWithEmptyRegion.cc

@@ -1,22 +0,0 @@
-/**
-* Copyright (c) 2013 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
-*/
-#include <string>
-#include "gtest/gtest.h"
-#include "StateWithEmptyRegion.h"
-
-TEST(StatemachineTest, StateWithEmptyRegionTest) {
-	StateWithEmptyRegion handle;
-	stateWithEmptyRegion_init(&handle);
-	stateWithEmptyRegion_enter(&handle);
-	EXPECT_TRUE(stateWithEmptyRegion_isActive(&handle, StateWithEmptyRegion_main_region_A));
-	stateWithEmptyRegion_runCycle(&handle);
-	EXPECT_TRUE(stateWithEmptyRegion_isActive(&handle, StateWithEmptyRegion_main_region_B));
-}

+ 0 - 8
test-plugins/org.yakindu.sct.generator.c.test/gtests/StateWithEmptyRegion/StateWithEmptyRegion.sgen

@@ -1,8 +0,0 @@
-GeneratorModel for yakindu::c {
-	statechart StateWithEmptyRegion {
-		feature Outlet {
-			targetProject = "gtests"
-			targetFolder = "StateWithEmptyRegion"
-		}
-	}
-}

+ 0 - 8
test-plugins/org.yakindu.sct.generator.c.test/model/test.sgen

@@ -258,14 +258,6 @@ GeneratorModel for sctunit::c {
 		}			
 	}
 	
-	test StateWithEmptyRegion{
-		
-		feature Outlet{ 
-			targetProject = "org.yakindu.sct.generator.c.test" 
-			targetFolder = "test-gen"			
-		}			
-	}
-	
 	test STextKeywordsInStatesAndRegions{
 		
 		feature Outlet{ 

+ 8 - 14
test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java

@@ -15,19 +15,13 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({ AlwaysOncycle.class, AssignmentAsExpression.class,
-		BitExpressions.class, BooleanExpressions.class, CKeywords.class,
-		Declarations.class, Choice.class, DeepHistory.class, EnterState.class,
-		ExitState.class, ExitOnSelfTransition.class, Guard.class,
-		GuardedEntry.class, GuardedExit.class, HistoryWithoutInitialStep.class,
-		IntegerExpressions.class, InEventLifeCycle.class,
-		InternalEventLifeCycle.class, OutEventLifeCycle.class,
-		Parenthesis.class, PriorityValues.class, RaiseEvent.class,
-		SameNameDifferentRegion.class, ShallowHistory.class,
-		SimpleHierachy.class, StateIsActive.class,
-		StatechartLocalReactions.class, StateWithEmptyRegion.class,
-		StringExpressions.class, SyncFork.class, SyncJoin.class,
-		SimpleEvent.class, STextKeywordsInStatesAndRegions.class,
-		TransitionWithoutCondition.class, ValuedEvents.class})
+@SuiteClasses({ AlwaysOncycle.class, AssignmentAsExpression.class, BitExpressions.class, BooleanExpressions.class,
+		CKeywords.class, Declarations.class, Choice.class, DeepHistory.class, EnterState.class, ExitState.class,
+		ExitOnSelfTransition.class, Guard.class, GuardedEntry.class, GuardedExit.class,
+		HistoryWithoutInitialStep.class, IntegerExpressions.class, InEventLifeCycle.class,
+		InternalEventLifeCycle.class, OutEventLifeCycle.class, Parenthesis.class, PriorityValues.class,
+		RaiseEvent.class, SameNameDifferentRegion.class, ShallowHistory.class, SimpleHierachy.class,
+		StateIsActive.class, StatechartLocalReactions.class, StringExpressions.class, SyncFork.class, SyncJoin.class,
+		SimpleEvent.class, STextKeywordsInStatesAndRegions.class, TransitionWithoutCondition.class, ValuedEvents.class })
 public class AllTests {
 }

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

@@ -1,39 +0,0 @@
-/**
- * Copyright (c) 2013 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/StateWithEmptyRegion/StateWithEmptyRegion.cc", program = "gtests/StateWithEmptyRegion/StateWithEmptyRegion", model = "testmodels/SCTUnit/StateWithEmptyRegion.sct")
-@RunWith(GTestRunner.class)
-public class StateWithEmptyRegion {
-
-	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();
-	}
-}

+ 0 - 12
test-plugins/org.yakindu.sct.generator.java.test/model/model.sgen

@@ -206,18 +206,6 @@ GeneratorModel for yakindu::java {
 			RuntimeService = true
 		}
 	}
-	statechart StateWithEmptyRegion {
-		feature Outlet {
-			targetProject = "org.yakindu.sct.generator.java.test"
-			targetFolder = "src-gen"
-		}
-
-		feature GeneralFeatures {
-			TimerService = true
-			RuntimeService = true
-		}
-	}
-	
 	statechart StatechartLocalReactions {
 		feature Outlet {
 			targetProject = "org.yakindu.sct.generator.java.test"

+ 0 - 6
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/statewithemptyregion/IStateWithEmptyRegionStatemachine.java

@@ -1,6 +0,0 @@
-package org.yakindu.scr.statewithemptyregion;
-import org.yakindu.scr.IStatemachine;
-
-public interface IStateWithEmptyRegionStatemachine extends IStatemachine {
-
-}

+ 0 - 114
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/statewithemptyregion/StateWithEmptyRegionStatemachine.java

@@ -1,114 +0,0 @@
-package org.yakindu.scr.statewithemptyregion;
-
-public class StateWithEmptyRegionStatemachine
-		implements
-			IStateWithEmptyRegionStatemachine {
-
-	public enum State {
-		main_region_A, main_region_B, $NullState$
-	};
-
-	private final State[] stateVector = new State[1];
-
-	private int nextStateIndex;
-
-	public StateWithEmptyRegionStatemachine() {
-
-	}
-
-	public void init() {
-		for (int i = 0; i < 1; i++) {
-			stateVector[i] = State.$NullState$;
-		}
-
-		clearEvents();
-		clearOutEvents();
-
-	}
-
-	public void enter() {
-		entryAction();
-
-		nextStateIndex = 0;
-		stateVector[0] = State.main_region_A;
-	}
-
-	public void exit() {
-		switch (stateVector[0]) {
-			case main_region_A :
-				nextStateIndex = 0;
-				stateVector[0] = State.$NullState$;
-				break;
-
-			case main_region_B :
-				nextStateIndex = 0;
-				stateVector[0] = State.$NullState$;
-				break;
-
-			default :
-				break;
-		}
-
-		exitAction();
-	}
-
-	protected void clearEvents() {
-
-	}
-
-	protected void clearOutEvents() {
-	}
-
-	public boolean isStateActive(State state) {
-		switch (state) {
-			case main_region_A :
-				return stateVector[0] == State.main_region_A;
-			case main_region_B :
-				return stateVector[0] == State.main_region_B;
-			default :
-				return false;
-		}
-	}
-
-	/* Entry action for statechart 'StateWithEmptyRegion'. */
-	private void entryAction() {
-	}
-
-	/* Exit action for state 'StateWithEmptyRegion'. */
-	private void exitAction() {
-	}
-
-	/* The reactions of state A. */
-	private void reactMain_region_A() {
-		nextStateIndex = 0;
-		stateVector[0] = State.$NullState$;
-
-		nextStateIndex = 0;
-		stateVector[0] = State.main_region_B;
-	}
-
-	/* The reactions of state B. */
-	private void reactMain_region_B() {
-	}
-
-	public void runCycle() {
-
-		clearOutEvents();
-
-		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
-
-			switch (stateVector[nextStateIndex]) {
-				case main_region_A :
-					reactMain_region_A();
-					break;
-				case main_region_B :
-					reactMain_region_B();
-					break;
-				default :
-					// $NullState$
-			}
-		}
-
-		clearEvents();
-	}
-}

+ 10 - 14
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTests.java

@@ -15,19 +15,15 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
-		BitExpressionsTest.class, BooleanExpressionsTest.class, CKeywordsTest.class,
-		DeclarationsTest.class, ChoiceTest.class, DeepHistoryTest.class, EnterStateTest.class,
-		ExitStateTest.class, ExitOnSelfTransitionTest.class, GuardTest.class,
-		GuardedEntryTest.class, GuardedExitTest.class, HistoryWithoutInitialStepTest.class,
-		IntegerExpressionsTest.class, InEventLifeCycleTest.class,
-		InternalEventLifeCycleTest.class, OutEventLifeCycleTest.class,
-		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
-		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
-		SimpleHierachyTest.class, StateIsActiveTest.class,
-		StatechartLocalReactionsTest.class, StateWithEmptyRegionTest.class,
-		StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		SimpleEventTest.class, STextKeywordsInStatesAndRegionsTest.class,
-		TransitionWithoutConditionTest.class, ValuedEventsTest.class})
+@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class, BitExpressionsTest.class,
+		BooleanExpressionsTest.class, CKeywordsTest.class, DeclarationsTest.class, ChoiceTest.class,
+		DeepHistoryTest.class, EnterStateTest.class, ExitStateTest.class, ExitOnSelfTransitionTest.class,
+		GuardTest.class, GuardedEntryTest.class, GuardedExitTest.class, HistoryWithoutInitialStepTest.class,
+		IntegerExpressionsTest.class, InEventLifeCycleTest.class, InternalEventLifeCycleTest.class,
+		OutEventLifeCycleTest.class, ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
+		SameNameDifferentRegionTest.class, ShallowHistoryTest.class, SimpleHierachyTest.class, StateIsActiveTest.class,
+		StatechartLocalReactionsTest.class, StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
+		SimpleEventTest.class, STextKeywordsInStatesAndRegionsTest.class, TransitionWithoutConditionTest.class,
+		ValuedEventsTest.class })
 public class AllTests {
 }

+ 0 - 45
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/StateWithEmptyRegionTest.java

@@ -1,45 +0,0 @@
-/**
- * Copyright (c) 2013 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.java.test;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import static org.junit.Assert.*;
-import org.yakindu.scr.statewithemptyregion.StateWithEmptyRegionStatemachine;
-import org.yakindu.scr.statewithemptyregion.StateWithEmptyRegionStatemachine.State;
-/**
- *  Unit TestCase for StateWithEmptyRegion
- */
-@SuppressWarnings("all")
-public class StateWithEmptyRegionTest {
-
-	private StateWithEmptyRegionStatemachine statemachine;
-
-	@Before
-	public void setUp() {
-		statemachine = new StateWithEmptyRegionStatemachine();
-		statemachine.init();
-	}
-
-	@After
-	public void tearDown() {
-		statemachine = null;
-	}
-
-	@Test
-	public void testStateWithEmptyRegionTest() {
-		statemachine.enter();
-		assertTrue(statemachine.isStateActive(State.main_region_A));
-		statemachine.runCycle();
-		assertTrue(statemachine.isStateActive(State.main_region_B));
-	}
-}

+ 0 - 8
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/model/test.sgen

@@ -257,14 +257,6 @@ GeneratorModel for sctunit::interpreter {
 		}			
 	}
 	
-	test StateWithEmptyRegion{
-		
-		feature Outlet{ 
-			targetProject = "org.yakindu.sct.model.sexec.interpreter.test" 
-			targetFolder = "test-gen"			
-		}			
-	}
-	
 	test STextKeywordsInStatesAndRegions{
 		
 		feature Outlet{ 

+ 10 - 14
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/test-gen/org/yakindu/sct/model/sexec/interpreter/test/AllTests.java

@@ -15,19 +15,15 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
-		BitExpressionsTest.class, BooleanExpressionsTest.class, CKeywordsTest.class,
-		DeclarationsTest.class, ChoiceTest.class, DeepHistoryTest.class, EnterStateTest.class,
-		ExitStateTest.class, ExitOnSelfTransitionTest.class, GuardTest.class,
-		GuardedEntryTest.class, GuardedExitTest.class, HistoryWithoutInitialStepTest.class,
-		IntegerExpressionsTest.class, InEventLifeCycleTest.class,
-		InternalEventLifeCycleTest.class, OutEventLifeCycleTest.class,
-		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
-		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
-		SimpleHierachyTest.class, StateIsActiveTest.class,
-		StatechartLocalReactionsTest.class, StateWithEmptyRegionTest.class,
-		StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		SimpleEventTest.class, STextKeywordsInStatesAndRegionsTest.class,
-		TransitionWithoutConditionTest.class, ValuedEventsTest.class})
+@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class, BitExpressionsTest.class,
+		BooleanExpressionsTest.class, CKeywordsTest.class, DeclarationsTest.class, ChoiceTest.class,
+		DeepHistoryTest.class, EnterStateTest.class, ExitStateTest.class, ExitOnSelfTransitionTest.class,
+		GuardTest.class, GuardedEntryTest.class, GuardedExitTest.class, HistoryWithoutInitialStepTest.class,
+		IntegerExpressionsTest.class, InEventLifeCycleTest.class, InternalEventLifeCycleTest.class,
+		OutEventLifeCycleTest.class, ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
+		SameNameDifferentRegionTest.class, ShallowHistoryTest.class, SimpleHierachyTest.class, StateIsActiveTest.class,
+		StatechartLocalReactionsTest.class, StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
+		SimpleEventTest.class, STextKeywordsInStatesAndRegionsTest.class, TransitionWithoutConditionTest.class,
+		ValuedEventsTest.class })
 public class AllTests {
 }

+ 0 - 48
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/test-gen/org/yakindu/sct/model/sexec/interpreter/test/StateWithEmptyRegionTest.java

@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2013 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 org.eclipse.xtext.junit4.InjectWith;
-import org.eclipse.xtext.junit4.XtextRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.yakindu.sct.model.sexec.interpreter.test.util.AbstractExecutionFlowTest;
-import org.yakindu.sct.model.sexec.interpreter.test.util.SExecInjectionProvider;
-import com.google.inject.Inject;
-import org.junit.Before;
-import org.yakindu.sct.model.sexec.interpreter.IExecutionFlowInterpreter;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.test.models.SCTUnitTestModels;
-import static junit.framework.Assert.*;
-/**
- *  Unit TestCase for StateWithEmptyRegion
- */
-@SuppressWarnings("all")
-@RunWith(XtextRunner.class)
-@InjectWith(SExecInjectionProvider.class)
-public class StateWithEmptyRegionTest extends AbstractExecutionFlowTest {
-
-	@Inject
-	private SCTUnitTestModels models;
-
-	@Before
-	public void setup() throws Exception {
-		ExecutionFlow flow = models
-				.loadExecutionFlowFromResource("StateWithEmptyRegion.sct");
-		initInterpreter(flow);
-	}
-	@Test
-	public void StateWithEmptyRegionTest() throws Exception {
-		interpreter.enter();
-		assertTrue(isActive("A"));
-		interpreter.runCycle();
-		assertTrue(isActive("B"));
-	}
-}