bohl@itemis.de 11 سال پیش
والد
کامیت
79c99828d4

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

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

+ 1 - 1
test-plugins/org.yakindu.sct.generator.java.test/src/org/yakindu/sct/generator/java/test/AllTestsTestCustom.java

@@ -15,6 +15,6 @@ import org.junit.runners.Suite.SuiteClasses;
 import org.yakindu.sct.generator.java.JavaSCTGeneratorTest;
 
 @RunWith(Suite.class)
-@SuiteClasses({OperationsTestCustom.class, JavaSCTGeneratorTest.class})
+@SuiteClasses({OperationsTestCustom.class, OperationsWithoutBracesCustom.class, JavaSCTGeneratorTest.class})
 public class AllTestsTestCustom {
 }

+ 69 - 0
test-plugins/org.yakindu.sct.generator.java.test/src/org/yakindu/sct/generator/java/test/OperationsWithoutBracesCustom.java

@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2015 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.operationswithoutbraces.OperationsWithoutBracesStatemachine;
+import org.yakindu.scr.operationswithoutbraces.IOperationsWithoutBracesStatemachine.SCInterfaceOperationCallback;
+import org.yakindu.scr.operationswithoutbraces.OperationsWithoutBracesStatemachine.State;
+/**
+ *  Unit TestCase for OperationsWithoutBraces
+ */
+@SuppressWarnings("all")
+public class OperationsWithoutBracesCustom implements SCInterfaceOperationCallback{
+
+	private OperationsWithoutBracesStatemachine statemachine;
+
+	@Before
+	public void setUp() {
+		statemachine = new OperationsWithoutBracesStatemachine();
+		statemachine.init();
+		statemachine.getSCInterface().setSCInterfaceOperationCallback(this);
+	}
+
+	@After
+	public void tearDown() {
+		statemachine = null;
+	}
+
+	@Test
+	public void testOperationsWithoutBracesTest() {
+		statemachine.enter();
+		assertTrue(statemachine.isStateActive(State.main_region_A));
+		assertTrue(statemachine.isStateActive(State.another_region_A));
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.main_region_B));
+		assertTrue(statemachine.isStateActive(State.another_region_B));
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.main_region_C));
+		assertTrue(statemachine.isStateActive(State.another_region_C));
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.main_region_D));
+		assertTrue(statemachine.isStateActive(State.another_region_D));
+	}
+	
+	// Default Implementation for Operations
+	public boolean myBoolOp() {
+		return false;
+	}
+	public long myIntOp() {
+		return 0;
+	}
+	public double myRealOp() {
+		return 0;
+	}
+}

+ 14 - 24
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/AllTestsTest.java

@@ -15,29 +15,19 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
-		BitExpressionsTest.class, BooleanExpressionsTest.class,
-		CastExpressionsTest.class, ChoiceTest.class,
-		ConditionalExpressionTest.class, DeclarationsTest.class,
-		DeepEntryTest.class, DeepHistoryTest.class, DynamicChoiceTest.class,
-		EmptyTransitionTest.class, EnterStateTest.class, EntryChoiceTest.class,
-		EntryExitSelfTransitionTest.class, ExitOnSelfTransitionTest.class,
-		ExitStateTest.class, FeatureCallsTest.class, GuardTest.class,
-		GuardedEntryTest.class, GuardedExitTest.class,
-		HistoryWithExitPointTest.class, HistoryWithoutInitialStepTest.class,
-		InEventLifeCycleTest.class, IntegerExpressionsTest.class,
-		InternalEventLifeCycleTest.class, LocalReactionsTest.class,
-		LogicalAndTestsTest.class, LogicalOrTestsTest.class,
-		NamedInterfaceAccessTest.class, OperationsWithoutBracesTest.class,
-		OutEventLifeCycleTest.class, ParenthesisTest.class,
-		PriorityValuesTest.class, RaiseEventTest.class,
-		SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
-		ShallowHistoryWithDeepEntryTest.class, SimpleEventTest.class,
-		StatechartLocalReactionsTest.class, SimpleHierachyTest.class,
-		StateIsActiveTest.class, StaticChoiceTest.class,
-		STextKeywordsInStatesAndRegionsTest.class, StringExpressionsTest.class,
-		SyncForkTest.class, SyncJoinTest.class,
-		TransitionWithoutConditionTest.class,
-		TriggerGuardExpressionsTest.class, ValuedEventsTest.class })
+@SuiteClasses({ AlwaysOncycleTest.class, AssignmentAsExpressionTest.class, BitExpressionsTest.class,
+		BooleanExpressionsTest.class, CastExpressionsTest.class, ChoiceTest.class, ConditionalExpressionTest.class,
+		DeclarationsTest.class, DeepEntryTest.class, DeepHistoryTest.class, DynamicChoiceTest.class,
+		EmptyTransitionTest.class, EnterStateTest.class, EntryChoiceTest.class, EntryExitSelfTransitionTest.class,
+		ExitOnSelfTransitionTest.class, ExitStateTest.class, FeatureCallsTest.class, GuardTest.class,
+		GuardedEntryTest.class, GuardedExitTest.class, HistoryWithExitPointTest.class,
+		HistoryWithoutInitialStepTest.class, InEventLifeCycleTest.class, IntegerExpressionsTest.class,
+		InternalEventLifeCycleTest.class, LocalReactionsTest.class, LogicalAndTestsTest.class,
+		LogicalOrTestsTest.class, NamedInterfaceAccessTest.class, OutEventLifeCycleTest.class, ParenthesisTest.class,
+		PriorityValuesTest.class, RaiseEventTest.class, SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
+		ShallowHistoryWithDeepEntryTest.class, SimpleEventTest.class, StatechartLocalReactionsTest.class,
+		SimpleHierachyTest.class, StateIsActiveTest.class, StaticChoiceTest.class,
+		STextKeywordsInStatesAndRegionsTest.class, StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
+		TransitionWithoutConditionTest.class, TriggerGuardExpressionsTest.class, ValuedEventsTest.class })
 public class AllTestsTest {
 }