Forráskód Böngészése

merge branch Bugfix_2_0_x into main trunk ...

terfloth@itemis.de 12 éve
szülő
commit
1101abc524

+ 36 - 36
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/booleanexpressions/BooleanExpressionsStatemachine.java

@@ -4,7 +4,7 @@ public class BooleanExpressionsStatemachine
 		implements
 			IBooleanExpressionsStatemachine {
 
-	private final class SCIDefaultImpl implements SCIDefault {
+	private final class SCInterfaceImpl implements SCInterface {
 
 		private boolean e1;
 
@@ -88,7 +88,7 @@ public class BooleanExpressionsStatemachine
 
 	}
 
-	private SCIDefaultImpl sCIDefault;
+	private SCInterfaceImpl sCInterface;
 
 	public enum State {
 		main_region_StateA, main_region_StateB, $NullState$
@@ -100,7 +100,7 @@ public class BooleanExpressionsStatemachine
 
 	public BooleanExpressionsStatemachine() {
 
-		sCIDefault = new SCIDefaultImpl();
+		sCInterface = new SCInterfaceImpl();
 
 	}
 
@@ -112,27 +112,27 @@ public class BooleanExpressionsStatemachine
 		clearEvents();
 		clearOutEvents();
 
-		sCIDefault.myBool1 = false;
+		sCInterface.myBool1 = false;
 
-		sCIDefault.myBool2 = false;
+		sCInterface.myBool2 = false;
 
-		sCIDefault.and = false;
+		sCInterface.and = false;
 
-		sCIDefault.or = false;
+		sCInterface.or = false;
 
-		sCIDefault.not = false;
+		sCInterface.not = false;
 
-		sCIDefault.equal = false;
+		sCInterface.equal = false;
 
-		sCIDefault.notequal = false;
+		sCInterface.notequal = false;
 	}
 
 	public void enter() {
 		entryAction();
 
-		sCIDefault.myBool1 = true;
+		sCInterface.myBool1 = true;
 
-		sCIDefault.myBool2 = false;
+		sCInterface.myBool2 = false;
 
 		nextStateIndex = 0;
 		stateVector[0] = State.main_region_StateA;
@@ -158,7 +158,7 @@ public class BooleanExpressionsStatemachine
 	}
 
 	protected void clearEvents() {
-		sCIDefault.clearEvents();
+		sCInterface.clearEvents();
 
 	}
 
@@ -176,62 +176,62 @@ public class BooleanExpressionsStatemachine
 		}
 	}
 
-	public SCIDefault getSCIDefault() {
-		return sCIDefault;
+	public SCInterface getSCInterface() {
+		return sCInterface;
 	}
 
 	public void raiseE1() {
-		sCIDefault.raiseE1();
+		sCInterface.raiseE1();
 	}
 
 	public boolean getMyBool1() {
-		return sCIDefault.getMyBool1();
+		return sCInterface.getMyBool1();
 	}
 
 	public void setMyBool1(boolean value) {
-		sCIDefault.setMyBool1(value);
+		sCInterface.setMyBool1(value);
 	}
 	public boolean getMyBool2() {
-		return sCIDefault.getMyBool2();
+		return sCInterface.getMyBool2();
 	}
 
 	public void setMyBool2(boolean value) {
-		sCIDefault.setMyBool2(value);
+		sCInterface.setMyBool2(value);
 	}
 	public boolean getAnd() {
-		return sCIDefault.getAnd();
+		return sCInterface.getAnd();
 	}
 
 	public void setAnd(boolean value) {
-		sCIDefault.setAnd(value);
+		sCInterface.setAnd(value);
 	}
 	public boolean getOr() {
-		return sCIDefault.getOr();
+		return sCInterface.getOr();
 	}
 
 	public void setOr(boolean value) {
-		sCIDefault.setOr(value);
+		sCInterface.setOr(value);
 	}
 	public boolean getNot() {
-		return sCIDefault.getNot();
+		return sCInterface.getNot();
 	}
 
 	public void setNot(boolean value) {
-		sCIDefault.setNot(value);
+		sCInterface.setNot(value);
 	}
 	public boolean getEqual() {
-		return sCIDefault.getEqual();
+		return sCInterface.getEqual();
 	}
 
 	public void setEqual(boolean value) {
-		sCIDefault.setEqual(value);
+		sCInterface.setEqual(value);
 	}
 	public boolean getNotequal() {
-		return sCIDefault.getNotequal();
+		return sCInterface.getNotequal();
 	}
 
 	public void setNotequal(boolean value) {
-		sCIDefault.setNotequal(value);
+		sCInterface.setNotequal(value);
 	}
 
 	/* Entry action for statechart 'BooleanExpressions'. */
@@ -244,19 +244,19 @@ public class BooleanExpressionsStatemachine
 
 	/* The reactions of state StateA. */
 	private void reactMain_region_StateA() {
-		if (sCIDefault.e1) {
+		if (sCInterface.e1) {
 			nextStateIndex = 0;
 			stateVector[0] = State.$NullState$;
 
-			sCIDefault.and = sCIDefault.myBool1 && sCIDefault.myBool2;
+			sCInterface.and = sCInterface.myBool1 && sCInterface.myBool2;
 
-			sCIDefault.or = sCIDefault.myBool1 || sCIDefault.myBool2;
+			sCInterface.or = sCInterface.myBool1 || sCInterface.myBool2;
 
-			sCIDefault.not = !sCIDefault.myBool1;
+			sCInterface.not = !sCInterface.myBool1;
 
-			sCIDefault.equal = sCIDefault.myBool1 == sCIDefault.myBool2;
+			sCInterface.equal = sCInterface.myBool1 == sCInterface.myBool2;
 
-			sCIDefault.notequal = (sCIDefault.myBool1 != sCIDefault.myBool2);
+			sCInterface.notequal = (sCInterface.myBool1 != sCInterface.myBool2);
 
 			nextStateIndex = 0;
 			stateVector[0] = State.main_region_StateB;

+ 2 - 2
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/booleanexpressions/IBooleanExpressionsStatemachine.java

@@ -3,7 +3,7 @@ import org.yakindu.scr.IStatemachine;
 
 public interface IBooleanExpressionsStatemachine extends IStatemachine {
 
-	public interface SCIDefault {
+	public interface SCInterface {
 		public void raiseE1();
 		public boolean getMyBool1();
 		public void setMyBool1(boolean value);
@@ -22,6 +22,6 @@ public interface IBooleanExpressionsStatemachine extends IStatemachine {
 
 	}
 
-	public SCIDefault getSCIDefault();
+	public SCInterface getSCInterface();
 
 }

+ 0 - 4
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/performancetest/PerformanceTestStatemachine.java

@@ -888,8 +888,6 @@ public class PerformanceTestStatemachine
 				}
 
 				reactPerformanceTest_mr__sync0();
-
-				reactPerformanceTest_mr__sync0();
 			}
 		}
 	}
@@ -1155,8 +1153,6 @@ public class PerformanceTestStatemachine
 			}
 
 			reactPerformanceTest_mr__sync0();
-
-			reactPerformanceTest_mr__sync0();
 		}
 	}
 

+ 2 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/stringexpressions/IStringExpressionsStatemachine.java

@@ -9,6 +9,8 @@ public interface IStringExpressionsStatemachine extends IStatemachine {
 		public void setMyString(String value);
 		public String getMyString2();
 		public void setMyString2(String value);
+		public String getQuotedString();
+		public void setQuotedString(String value);
 		public boolean getEquals();
 		public void setEquals(boolean value);
 		public boolean getNotEqual();

+ 23 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/stringexpressions/StringExpressionsStatemachine.java

@@ -32,6 +32,16 @@ public class StringExpressionsStatemachine
 			this.myString2 = value;
 		}
 
+		private String quotedString;
+
+		public String getQuotedString() {
+			return quotedString;
+		}
+
+		public void setQuotedString(String value) {
+			this.quotedString = value;
+		}
+
 		private boolean equals;
 
 		public boolean getEquals() {
@@ -86,6 +96,8 @@ public class StringExpressionsStatemachine
 
 		sCInterface.myString2 = "";
 
+		sCInterface.quotedString = "\"x\"";
+
 		sCInterface.equals = false;
 
 		sCInterface.notEqual = false;
@@ -98,6 +110,8 @@ public class StringExpressionsStatemachine
 
 		sCInterface.myString2 = "world";
 
+		sCInterface.quotedString = "'y'";
+
 		nextStateIndex = 0;
 		stateVector[0] = State.main_region_StateA;
 	}
@@ -162,6 +176,13 @@ public class StringExpressionsStatemachine
 	public void setMyString2(String value) {
 		sCInterface.setMyString2(value);
 	}
+	public String getQuotedString() {
+		return sCInterface.getQuotedString();
+	}
+
+	public void setQuotedString(String value) {
+		sCInterface.setQuotedString(value);
+	}
 	public boolean getEquals() {
 		return sCInterface.getEquals();
 	}
@@ -199,6 +220,8 @@ public class StringExpressionsStatemachine
 					? sCInterface.myString2 == null
 					: !sCInterface.myString.equals(sCInterface.myString2));
 
+			sCInterface.quotedString = "\"z\"";
+
 			nextStateIndex = 0;
 			stateVector[0] = State.main_region_StateB;
 		}

+ 2 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/syncjoin/ISyncJoinStatemachine.java

@@ -8,6 +8,8 @@ public interface ISyncJoinStatemachine extends IStatemachine {
 		public void raiseF();
 		public void raiseJc();
 		public void raiseJd();
+		public int getX();
+		public void setX(int value);
 
 	}
 

+ 21 - 4
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/syncjoin/SyncJoinStatemachine.java

@@ -28,6 +28,16 @@ public class SyncJoinStatemachine implements ISyncJoinStatemachine {
 			jd = true;
 		}
 
+		private int x;
+
+		public int getX() {
+			return x;
+		}
+
+		public void setX(int value) {
+			this.x = value;
+		}
+
 		public void clearEvents() {
 			e = false;
 			f = false;
@@ -61,6 +71,7 @@ public class SyncJoinStatemachine implements ISyncJoinStatemachine {
 		clearEvents();
 		clearOutEvents();
 
+		sCInterface.x = 0;
 	}
 
 	public void enter() {
@@ -159,6 +170,14 @@ public class SyncJoinStatemachine implements ISyncJoinStatemachine {
 		sCInterface.raiseJd();
 	}
 
+	public int getX() {
+		return sCInterface.getX();
+	}
+
+	public void setX(int value) {
+		sCInterface.setX(value);
+	}
+
 	/* Entry action for statechart 'SyncJoin'. */
 	private void entryAction() {
 	}
@@ -227,8 +246,6 @@ public class SyncJoinStatemachine implements ISyncJoinStatemachine {
 			}
 
 			reactSyncJoin_main_region__sync0();
-
-			reactSyncJoin_main_region__sync0();
 		}
 	}
 
@@ -278,13 +295,13 @@ public class SyncJoinStatemachine implements ISyncJoinStatemachine {
 			}
 
 			reactSyncJoin_main_region__sync0();
-
-			reactSyncJoin_main_region__sync0();
 		}
 	}
 
 	/* The reactions of state null. */
 	private void reactSyncJoin_main_region__sync0() {
+		sCInterface.x += 1;
+
 		nextStateIndex = 0;
 		stateVector[0] = State.main_region_A;
 	}

+ 3 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/sct/generator/java/test/StringExpressionsTest.java

@@ -37,14 +37,17 @@ public class StringExpressionsTest {
 
 	@Test
 	public void testStringExpressionsTest() {
+		assertTrue(statemachine.getQuotedString().equals("\"x\""));
 		statemachine.enter();
 		assertTrue(statemachine.isStateActive(State.main_region_StateA));
 		assertTrue(statemachine.getMyString().equals("hello"));
 		assertTrue(statemachine.getMyString2().equals("world"));
+		assertTrue(statemachine.getQuotedString().equals("'y'"));
 		statemachine.raiseE1();
 		statemachine.runCycle();
 		assertTrue(statemachine.isStateActive(State.main_region_StateB));
 		assertTrue(statemachine.getEquals() == false);
 		assertTrue(statemachine.getNotEqual() == true);
+		assertTrue(statemachine.getQuotedString().equals("\"z\""));
 	}
 }

+ 12 - 0
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/sct/generator/java/test/SyncJoinTest.java

@@ -103,4 +103,16 @@ public class SyncJoinTest {
 		assertTrue(statemachine.isStateActive(State.main_region_B_r1_C2));
 		assertTrue(statemachine.isStateActive(State.main_region_B_r2_D2));
 	}
+	@Test
+	public void testdoubleEntryActionBug() {
+		statemachine.enter();
+		statemachine.raiseE();
+		statemachine.raiseF();
+		statemachine.runCycle();
+		statemachine.raiseJc();
+		statemachine.raiseJd();
+		statemachine.runCycle();
+		assertTrue(statemachine.isStateActive(State.main_region_A));
+		assertTrue(statemachine.getX() == 1);
+	}
 }

+ 3 - 0
test-plugins/org.yakindu.sct.model.sexec.interpreter.test/src-gen/org/yakindu/sct/model/sexec/interpreter/test/StringExpressionsTest.java

@@ -40,14 +40,17 @@ public class StringExpressionsTest extends AbstractExecutionFlowTest {
 	}
 	@Test
 	public void StringExpressionsTest() throws Exception {
+		assertTrue(getString("quotedString").equals("\"x\""));
 		interpreter.enter();
 		assertTrue(isActive("StateA"));
 		assertTrue(getString("myString").equals("hello"));
 		assertTrue(getString("myString2").equals("world"));
+		assertTrue(getString("quotedString").equals("'y'"));
 		raiseEvent("e1");
 		interpreter.runCycle();
 		assertTrue(isActive("StateB"));
 		assertTrue(getBoolean("equals") == false);
 		assertTrue(getBoolean("notEqual") == true);
+		assertTrue(getString("quotedString").equals("\"z\""));
 	}
 }