Przeglądaj źródła

Removed Constants Java test

Andreas Mülder 11 lat temu
rodzic
commit
98953ddad2

+ 0 - 253
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/constants/ConstantsStatemachine.java

@@ -1,253 +0,0 @@
-package org.yakindu.scr.constants;
-
-public class ConstantsStatemachine implements IConstantsStatemachine {
-	public static final long x;
-	public static final long y;
-	public static final String y;
-	public static final long two;
-
-	static {
-		sCInterface.x = 10;
-
-		sCInterface.y = sCInterface.x * 2;
-
-		sCINamed.y = "Hello World";
-
-		sCINamed.two = 2;
-	}
-
-	private final class SCInterfaceImpl implements SCInterface {
-
-		private boolean e;
-
-		public void raiseE() {
-			e = true;
-		}
-
-		private long result;
-		public long getResult() {
-			return result;
-		}
-
-		public void setResult(long value) {
-			this.result = value;
-		}
-
-		public void clearEvents() {
-			e = false;
-		}
-
-	}
-
-	private SCInterfaceImpl sCInterface;
-	private final class SCINamedImpl implements SCINamed {
-
-	}
-
-	private SCINamedImpl sCINamed;
-
-	public enum State {
-		main_region_A, main_region_B, $NullState$
-	};
-
-	private final State[] stateVector = new State[1];
-
-	private int nextStateIndex;
-
-	public ConstantsStatemachine() {
-
-		sCInterface = new SCInterfaceImpl();
-		sCINamed = new SCINamedImpl();
-	}
-
-	public void init() {
-		for (int i = 0; i < 1; i++) {
-			stateVector[i] = State.$NullState$;
-		}
-
-		clearEvents();
-		clearOutEvents();
-
-		sCInterface.result = 0;
-	}
-
-	public void enter() {
-		entryAction();
-
-		enterSequence_main_region_default();
-	}
-
-	public void exit() {
-		exitSequence_main_region();
-
-		exitAction();
-	}
-
-	/**
-	 * This method resets the incoming events (time events included).
-	 */
-	protected void clearEvents() {
-		sCInterface.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;
-	}
-	public SCINamed getSCINamed() {
-		return sCINamed;
-	}
-
-	public void raiseE() {
-		sCInterface.raiseE();
-	}
-
-	public long getX() {
-		return sCInterface.getX();
-	}
-
-	public void setX(long value) {
-		sCInterface.setX(value);
-	}
-	public long getY() {
-		return sCInterface.getY();
-	}
-
-	public void setY(long value) {
-		sCInterface.setY(value);
-	}
-	public long getResult() {
-		return sCInterface.getResult();
-	}
-
-	public void setResult(long value) {
-		sCInterface.setResult(value);
-	}
-
-	private boolean check_main_region_A_tr0() {
-		return sCInterface.e;
-	}
-
-	private void effect_main_region_A_tr0() {
-		exitSequence_main_region_A();
-
-		enterSequence_main_region_B_default();
-	}
-
-	/* Entry action for statechart 'Constants'. */
-	private void entryAction() {
-	}
-
-	/* Entry action for state 'B'. */
-	private void entryAction_main_region_B() {
-		sCInterface.result = sCINamed.two * sCInterface.x;
-	}
-
-	/* Exit action for state 'Constants'. */
-	private void exitAction() {
-	}
-
-	/* 'default' enter sequence for state A */
-	private void enterSequence_main_region_A_default() {
-		nextStateIndex = 0;
-		stateVector[0] = State.main_region_A;
-	}
-
-	/* 'default' enter sequence for state B */
-	private void enterSequence_main_region_B_default() {
-		entryAction_main_region_B();
-
-		nextStateIndex = 0;
-		stateVector[0] = State.main_region_B;
-	}
-
-	/* 'default' enter sequence for region main region */
-	private void enterSequence_main_region_default() {
-		react_main_region__entry_Default();
-	}
-
-	/* Default exit sequence for state A */
-	private void exitSequence_main_region_A() {
-		nextStateIndex = 0;
-		stateVector[0] = State.$NullState$;
-	}
-
-	/* Default exit sequence for state B */
-	private void exitSequence_main_region_B() {
-		nextStateIndex = 0;
-		stateVector[0] = State.$NullState$;
-	}
-
-	/* Default exit sequence for region main region */
-	private void exitSequence_main_region() {
-		switch (stateVector[0]) {
-			case main_region_A :
-				exitSequence_main_region_A();
-				break;
-
-			case main_region_B :
-				exitSequence_main_region_B();
-				break;
-
-			default :
-				break;
-		}
-	}
-
-	/* The reactions of state A. */
-	private void react_main_region_A() {
-		if (check_main_region_A_tr0()) {
-			effect_main_region_A_tr0();
-		}
-	}
-
-	/* The reactions of state B. */
-	private void react_main_region_B() {
-	}
-
-	/* Default react sequence for initial entry  */
-	private void react_main_region__entry_Default() {
-		enterSequence_main_region_A_default();
-	}
-
-	public void runCycle() {
-
-		clearOutEvents();
-
-		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
-
-			switch (stateVector[nextStateIndex]) {
-				case main_region_A :
-					react_main_region_A();
-					break;
-				case main_region_B :
-					react_main_region_B();
-					break;
-				default :
-					// $NullState$
-			}
-		}
-
-		clearEvents();
-	}
-}

+ 0 - 25
test-plugins/org.yakindu.sct.generator.java.test/src-gen/org/yakindu/scr/constants/IConstantsStatemachine.java

@@ -1,25 +0,0 @@
-package org.yakindu.scr.constants;
-import org.yakindu.scr.IStatemachine;
-
-public interface IConstantsStatemachine extends IStatemachine {
-
-	public interface SCInterface {
-		public void raiseE();
-		public long getX();
-		public long getY();
-		public long getResult();
-		public void setResult(long value);
-
-	}
-
-	public SCInterface getSCInterface();
-
-	public interface SCINamed {
-		public String getY();
-		public long getTwo();
-
-	}
-
-	public SCINamed getSCINamed();
-
-}

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

@@ -17,7 +17,7 @@ import org.junit.runners.Suite.SuiteClasses;
 @SuiteClasses({AlwaysOncycleTest.class, AssignmentAsExpressionTest.class,
 		BitExpressionsTest.class, BooleanExpressionsTest.class,
 		CastExpressionsTest.class, ChoiceTest.class, CKeywordsTest.class,
-		ConditionalExpressionTest.class, ConstantsTestsTest.class,
+		ConditionalExpressionTest.class, 
 		DeclarationsTest.class, DeepEntryTest.class, DeepHistoryTest.class,
 		DynamicChoiceTest.class, EmptyTransitionTest.class,
 		EnterStateTest.class, EntryChoiceTest.class,

+ 0 - 50
test-plugins/org.yakindu.sct.generator.java.test/test-gen/org/yakindu/sct/generator/java/test/ConstantsTestsTest.java

@@ -1,50 +0,0 @@
-/**
- * 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.constants.ConstantsStatemachine;
-import org.yakindu.scr.constants.ConstantsStatemachine.State;
-/**
- *  Unit TestCase for Constants
- */
-@SuppressWarnings("all")
-public class ConstantsTestsTest {
-
-	private ConstantsStatemachine statemachine;
-
-	@Before
-	public void setUp() {
-		statemachine = new ConstantsStatemachine();
-		statemachine.init();
-	}
-
-	@After
-	public void tearDown() {
-		statemachine = null;
-	}
-
-	@Test
-	public void testconstantDefinition() {
-		statemachine.enter();
-		assertTrue(statemachine.isStateActive(State.main_region_A));
-		assertTrue(statemachine.getX() == 10);
-		assertTrue(statemachine.getY() == 20);
-		assertTrue(statemachine.getSCINamed().getY().equals("Hello World"));
-		statemachine.raiseE();
-		statemachine.runCycle();
-		assertTrue(statemachine.getResult() == 20);
-	}
-}