Pārlūkot izejas kodu

Adding NullCheckTest

malknet42 11 gadi atpakaļ
vecāks
revīzija
58de8f429b
19 mainītis faili ar 515 papildinājumiem un 53 dzēšanām
  1. 26 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheck/NullCheck.cc
  2. 8 0
      test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheck/NullCheck.sgen
  3. 8 0
      test-plugins/org.yakindu.sct.generator.c.test/model/test.sgen
  4. 8 7
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/AllTests.java
  5. 39 0
      test-plugins/org.yakindu.sct.generator.c.test/test-gen/org/yakindu/sct/generator/c/test/NullCheck.java
  6. 8 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/NullCheckTest/NullCheck.sgen
  7. 23 0
      test-plugins/org.yakindu.sct.generator.cpp.test/gtests/NullCheckTest/NullCheckTest.cc
  8. 8 0
      test-plugins/org.yakindu.sct.generator.cpp.test/model/test.sgen
  9. 79 37
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java
  10. 39 0
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/NullCheckTest.java
  11. 11 0
      test-plugins/org.yakindu.sct.generator.java.test/model/model.sgen
  12. 8 0
      test-plugins/org.yakindu.sct.generator.java.test/model/test.sgen
  13. 12 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/nullcheck/INullCheckStatemachine.java
  14. 134 0
      test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/nullcheck/NullCheckStatemachine.java
  15. 3 4
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTestsTest.java
  16. 46 0
      test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/NullCheckTest.java
  17. 8 0
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/model/test.sgen
  18. 4 5
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/AllTestsTest.java
  19. 43 0
      test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/NullCheckTest.java

+ 26 - 0
test-plugins/org.yakindu.sct.generator.c.test/gtests/NullCheck/NullCheck.cc

@@ -0,0 +1,26 @@
+/**
+* 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
+*/
+#include <string>
+#include "gtest/gtest.h"
+#include "NullCheck.h"
+
+
+NullCheck handle;
+
+TEST(StatemachineTest, SimpleNullCheckTest) {
+	nullCheck_init(&handle);
+	nullCheck_enter(&handle);
+	EXPECT_TRUE(nullCheck_isActive(&handle, NullCheck_A));
+	nullCheck_runCycle(&handle);
+	EXPECT_TRUE(nullCheck_isActive(&handle, NullCheck_B));
+}
+
+		

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

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

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

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

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

@@ -9,12 +9,13 @@
  *     committers of YAKINDU - initial API and implementation
  */
 package org.yakindu.sct.generator.c.test;
+
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({AlwaysOncycle.class, AssignmentAsExpression.class,
+@SuiteClasses({ AlwaysOncycle.class, AssignmentAsExpression.class,
 		BitExpressions.class, BooleanExpressions.class, Choice.class,
 		CKeywords.class, Declarations.class, DeepEntry.class,
 		DeepHistory.class, DynamicChoice.class, EnterState.class,
@@ -23,13 +24,13 @@ import org.junit.runners.Suite.SuiteClasses;
 		HistoryWithoutInitialStep.class, InEventLifeCycle.class,
 		IntegerExpressions.class, InternalEventLifeCycle.class,
 		LogicalAndTests.class, LogicalOrTests.class,
-		NamedInterfaceAccess.class, OutEventLifeCycle.class, Parenthesis.class,
-		PriorityValues.class, RaiseEvent.class, SameNameDifferentRegion.class,
-		ShallowHistory.class, SimpleEvent.class,
-		StatechartLocalReactions.class, SimpleHierachy.class,
+		NamedInterfaceAccess.class, NullCheck.class, OutEventLifeCycle.class,
+		Parenthesis.class, PriorityValues.class, RaiseEvent.class,
+		SameNameDifferentRegion.class, ShallowHistory.class, SimpleEvent.class,
+		SimpleHierachy.class, StatechartLocalReactions.class,
 		StateIsActive.class, StaticChoice.class,
 		STextKeywordsInStatesAndRegions.class, StringExpressions.class,
-		SyncFork.class, SyncJoin.class, TransitionWithoutCondition.class,
-		ValuedEvents.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/NullCheck.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/NullCheck/NullCheck.cc", program = "gtests/NullCheck/NullCheck", model = "testmodels/SCTUnit/NullCheck.sct")
+@RunWith(GTestRunner.class)
+public class NullCheck {
+
+	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();
+	}
+}

+ 8 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/NullCheckTest/NullCheck.sgen

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

+ 23 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/gtests/NullCheckTest/NullCheckTest.cc

@@ -0,0 +1,23 @@
+/**
+* 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
+*/
+#include <string>
+#include "gtest/gtest.h"
+#include "NullCheck.h"
+
+TEST(StatemachineTest, SimpleNullCheckTest) {
+	NullCheck* statechart = new NullCheck();
+	statechart->init();
+	statechart->enter();
+	EXPECT_TRUE(statechart->isActive(NullCheck::A));
+	statechart->runCycle();
+	EXPECT_TRUE(statechart->isActive(NullCheck::B));
+	delete statechart;
+}

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

@@ -208,6 +208,14 @@ GeneratorModel for sctunit::cpp {
 			targetFolder = "test-gen"			
 		}			
 	}
+	
+	test NullCheck{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.cpp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
 
 	test OutEventLifeCycle{
 		

+ 79 - 37
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java

@@ -1,37 +1,79 @@
-/**
- * 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.cpp.test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
-		BitExpressionsTest.class, BooleanExpressionsTest.class,
-		ChoiceTest.class, CKeywordsTest.class, DeclarationsTest.class,
-		DeepEntryTest.class, DeepHistoryTest.class, DynamicChoiceTest.class,
-		EnterStateTest.class, EntryChoiceTest.class,
-		ExitOnSelfTransitionTest.class, ExitStateTest.class,
-		FeatureCallsTest.class, GuardTest.class, GuardedEntryTest.class,
-		GuardedExitTest.class, HistoryWithoutInitialStepTest.class,
-		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
-		InternalEventLifeCycleTest.class, LogicalAndTestsTest.class,
-		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
-		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
-		SimpleEventTest.class, StatechartLocalReactionsTest.class,
-		SimpleHierachyTest.class, StateIsActiveTest.class,
-		StaticChoiceTest.class, STextKeywordsInStatesAndRegionsTest.class,
-		StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		TransitionWithoutConditionTest.class, ValuedEventsTest.class})
-public class AllTestsTest {
-}
+/**
+ * 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.cpp.test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+import org.yakindu.sct.generator.c.test.AlwaysOncycle;
+import org.yakindu.sct.generator.c.test.AssignmentAsExpression;
+import org.yakindu.sct.generator.c.test.BitExpressions;
+import org.yakindu.sct.generator.c.test.BooleanExpressions;
+import org.yakindu.sct.generator.c.test.CKeywords;
+import org.yakindu.sct.generator.c.test.Choice;
+import org.yakindu.sct.generator.c.test.Declarations;
+import org.yakindu.sct.generator.c.test.DeepEntry;
+import org.yakindu.sct.generator.c.test.DeepHistory;
+import org.yakindu.sct.generator.c.test.DynamicChoice;
+import org.yakindu.sct.generator.c.test.EnterState;
+import org.yakindu.sct.generator.c.test.EntryChoice;
+import org.yakindu.sct.generator.c.test.ExitOnSelfTransition;
+import org.yakindu.sct.generator.c.test.ExitState;
+import org.yakindu.sct.generator.c.test.FeatureCalls;
+import org.yakindu.sct.generator.c.test.Guard;
+import org.yakindu.sct.generator.c.test.GuardedEntry;
+import org.yakindu.sct.generator.c.test.GuardedExit;
+import org.yakindu.sct.generator.c.test.HistoryWithoutInitialStep;
+import org.yakindu.sct.generator.c.test.InEventLifeCycle;
+import org.yakindu.sct.generator.c.test.IntegerExpressions;
+import org.yakindu.sct.generator.c.test.InternalEventLifeCycle;
+import org.yakindu.sct.generator.c.test.LogicalAndTests;
+import org.yakindu.sct.generator.c.test.LogicalOrTests;
+import org.yakindu.sct.generator.c.test.NamedInterfaceAccess;
+import org.yakindu.sct.generator.c.test.NullCheck;
+import org.yakindu.sct.generator.c.test.OutEventLifeCycle;
+import org.yakindu.sct.generator.c.test.Parenthesis;
+import org.yakindu.sct.generator.c.test.PriorityValues;
+import org.yakindu.sct.generator.c.test.RaiseEvent;
+import org.yakindu.sct.generator.c.test.STextKeywordsInStatesAndRegions;
+import org.yakindu.sct.generator.c.test.SameNameDifferentRegion;
+import org.yakindu.sct.generator.c.test.ShallowHistory;
+import org.yakindu.sct.generator.c.test.SimpleEvent;
+import org.yakindu.sct.generator.c.test.SimpleHierachy;
+import org.yakindu.sct.generator.c.test.StateIsActive;
+import org.yakindu.sct.generator.c.test.StatechartLocalReactions;
+import org.yakindu.sct.generator.c.test.StaticChoice;
+import org.yakindu.sct.generator.c.test.StringExpressions;
+import org.yakindu.sct.generator.c.test.SyncFork;
+import org.yakindu.sct.generator.c.test.SyncJoin;
+import org.yakindu.sct.generator.c.test.TimedTransitions;
+import org.yakindu.sct.generator.c.test.TransitionWithoutCondition;
+import org.yakindu.sct.generator.c.test.ValuedEvents;
+
+@RunWith(Suite.class)
+@SuiteClasses({ AlwaysOncycle.class, AssignmentAsExpression.class,
+	BitExpressions.class, BooleanExpressions.class, Choice.class,
+	CKeywords.class, Declarations.class, DeepEntry.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,
+	NamedInterfaceAccess.class, NullCheck.class, OutEventLifeCycle.class,
+	Parenthesis.class, PriorityValues.class, RaiseEvent.class,
+	SameNameDifferentRegion.class, ShallowHistory.class, SimpleEvent.class,
+	SimpleHierachy.class, StatechartLocalReactions.class,
+	StateIsActive.class, StaticChoice.class,
+	STextKeywordsInStatesAndRegions.class, StringExpressions.class,
+	SyncFork.class, SyncJoin.class, TimedTransitions.class,
+	TransitionWithoutCondition.class, ValuedEvents.class })
+public class AllTestsTest {
+}

+ 39 - 0
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/NullCheckTest.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.cpp.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/NullCheckTest/NullCheckTest.cc", program = "gtests/NullCheckTest/NullCheck", model = "testmodels/SCTUnit/NullCheck.sct")
+@RunWith(GTestRunner.class)
+public class NullCheckTest {
+
+	protected final GTestHelper helper = new GTestHelper(this) {
+
+		@Override
+		protected void getSourceFiles(Collection<String> files) {
+			super.getSourceFiles(files);
+			files.add(getFileName(getTestProgram()) + ".cpp");
+		}
+	};
+
+	@Before
+	public void setUp() {
+		helper.generate();
+		helper.compile();
+	}
+}

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

@@ -69,6 +69,17 @@ GeneratorModel for yakindu::java {
 			RuntimeService = true
 		}
 	}
+	statechart NullCheck {
+		feature Outlet {
+			targetProject = "org.yakindu.sct.generator.java.test"
+			targetFolder = "src-gen"
+		}
+
+		feature GeneralFeatures {
+			TimerService = true
+			RuntimeService = true
+		}
+	}	
 	statechart DeepHistory {
 		feature Outlet {
 			targetProject = "org.yakindu.sct.generator.java.test"

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

@@ -210,6 +210,14 @@ GeneratorModel for sctunit::java {
 		}			
 	}
 
+	test NullCheck{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.java.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
 	test OutEventLifeCycle{
 		
 		feature Outlet{ 

+ 12 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/nullcheck/INullCheckStatemachine.java

@@ -0,0 +1,12 @@
+package org.yakindu.scr.nullcheck;
+import org.yakindu.scr.IStatemachine;
+
+public interface INullCheckStatemachine extends IStatemachine {
+
+	public interface SCInterface {
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 134 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/nullcheck/NullCheckStatemachine.java

@@ -0,0 +1,134 @@
+package org.yakindu.scr.nullcheck;
+
+public class NullCheckStatemachine implements INullCheckStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_A, main_region_B, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public NullCheckStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	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();
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	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;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	/* Entry action for statechart 'NullCheck'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'NullCheck'. */
+	private void exitAction() {
+	}
+
+	/* The reactions of state A. */
+	private void reactMain_region_A() {
+		if (null == null) {
+			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();
+	}
+}

+ 3 - 4
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTestsTest.java

@@ -26,14 +26,13 @@ import org.junit.runners.Suite.SuiteClasses;
 		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
 		InternalEventLifeCycleTest.class, LogicalAndTestsTest.class,
 		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
+		NullCheckTest.class, OutEventLifeCycleTest.class,
+		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
 		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		SimpleEventTest.class, StatechartLocalReactionsTest.class,
 		SimpleHierachyTest.class, StateIsActiveTest.class,
 		StaticChoiceTest.class, STextKeywordsInStatesAndRegionsTest.class,
 		StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		TransitionWithoutConditionTest.class, ValuedEventsTest.class,
-		EntryChoiceTest.class })
+		TransitionWithoutConditionTest.class, ValuedEventsTest.class })
 public class AllTestsTest {
 }

+ 46 - 0
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/NullCheckTest.java

@@ -0,0 +1,46 @@
+/**
+ * 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.java.test;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.yakindu.scr.nullcheck.NullCheckStatemachine;
+import org.yakindu.scr.nullcheck.NullCheckStatemachine.State;
+/**
+ *  Unit TestCase for NullCheck
+ */
+@SuppressWarnings("all")
+public class NullCheckTest {
+
+	private NullCheckStatemachine statemachine;
+
+	@Before
+	public void setUp() {
+		statemachine = new NullCheckStatemachine();
+		statemachine.init();
+	}
+
+	@After
+	public void tearDown() {
+		statemachine = null;
+	}
+
+	@Test
+	public void testSimpleNullCheckTest() {
+		statemachine.enter();
+		assertTrue(statemachine.isStateActive(State.main_region_A));
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.main_region_B));
+	}
+}

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

@@ -209,6 +209,14 @@ GeneratorModel for sctunit::interpreter {
 			targetFolder = "test-gen"			
 		}			
 	}
+	
+	test NullCheck{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.simulation.core.sexec.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
 
 	test OutEventLifeCycle{
 		

+ 4 - 5
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/AllTestsTest.java

@@ -15,7 +15,7 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
+@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
 		BitExpressionsTest.class, BooleanExpressionsTest.class,
 		ChoiceTest.class, CKeywordsTest.class, DeclarationsTest.class,
 		DeepEntryTest.class, DeepHistoryTest.class, DynamicChoiceTest.class,
@@ -26,14 +26,13 @@ import org.junit.runners.Suite.SuiteClasses;
 		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
 		InternalEventLifeCycleTest.class, LogicalAndTestsTest.class,
 		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
+		NullCheckTest.class, OutEventLifeCycleTest.class,
+		ParenthesisTest.class, PriorityValuesTest.class, RaiseEventTest.class,
 		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		SimpleEventTest.class, StatechartLocalReactionsTest.class,
 		SimpleHierachyTest.class, StateIsActiveTest.class,
 		StaticChoiceTest.class, STextKeywordsInStatesAndRegionsTest.class,
 		StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
-		TransitionWithoutConditionTest.class, ValuedEventsTest.class,
-		EntryChoiceTest.class})
+		TransitionWithoutConditionTest.class, ValuedEventsTest.class })
 public class AllTestsTest {
 }

+ 43 - 0
test-plugins/org.yakindu.sct.simulation.core.sexec.test/test-gen/org/yakindu/sct/simulation/core/sexec/test/NullCheckTest.java

@@ -0,0 +1,43 @@
+/**
+ * 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.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 NullCheck
+ */
+@SuppressWarnings("all")
+@RunWith(XtextRunner.class)
+@InjectWith(SExecInjectionProvider.class)
+public class NullCheckTest extends AbstractExecutionFlowTest {
+	@Before
+	public void setup() throws Exception {
+		ExecutionFlow flow = models
+				.loadExecutionFlowFromResource("NullCheck.sct");
+		initInterpreter(flow);
+	}
+	@Test
+	public void SimpleNullCheckTest() throws Exception {
+		interpreter.enter();
+		assertTrue(isActive("A"));
+		interpreter.runCycle();
+		assertTrue(isActive("B"));
+	}
+}