Bladeren bron

refactored stext validation tests

Axel Terfloth 9 jaren geleden
bovenliggende
commit
b9edefbd34

+ 11 - 4
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/AllTests.java

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2012 committers of YAKINDU and others.
+ * Copyright (c) 2012-2016 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
@@ -13,14 +13,21 @@ package org.yakindu.sct.model.stext.test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
+import org.yakindu.sct.model.stext.test.validation.TransitionsWithNoTriggerTest;
 
 /**
  * @author andreas muelder - Initial contribution and API
+ * @author terfloth - extensions
  * 
  */
 @RunWith(value = Suite.class)
-@SuiteClasses(value = { TypeInferrerTest.class, STextJavaValidatorTest.class, StextParserRuleTest.class,
-		TestModelsContainErrorsTest.class, SCTUnitClassifierTest.class })
-public class AllTests {
+@SuiteClasses(value = { 
+		TypeInferrerTest.class, 
+		StextParserRuleTest.class,
+		TestModelsContainErrorsTest.class, 
+		SCTUnitClassifierTest.class, 
+		STextJavaValidatorTest.class, 
+		TransitionsWithNoTriggerTest.class })
 
+public class AllTests {
 }

+ 2 - 187
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/STextJavaValidatorTest.java

@@ -12,7 +12,6 @@
 package org.yakindu.sct.model.stext.test;
 
 import static org.eclipse.xtext.junit4.validation.AssertableDiagnostics.errorCode;
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.yakindu.sct.test.models.AbstractTestModelsUtil.VALIDATION_TESTMODEL_DIR;
@@ -21,18 +20,13 @@ import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Iterator;
 
-import org.eclipse.emf.common.util.BasicDiagnostic;
 import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.Diagnostician;
 import org.eclipse.xtext.junit4.InjectWith;
 import org.eclipse.xtext.junit4.XtextRunner;
 import org.eclipse.xtext.junit4.validation.AssertableDiagnostics;
-import org.eclipse.xtext.junit4.validation.ValidatorTester;
 import org.eclipse.xtext.validation.Check;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.yakindu.base.expressions.expressions.Expression;
@@ -40,15 +34,12 @@ import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Entry;
 import org.yakindu.sct.model.sgraph.Exit;
 import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.SGraphFactory;
 import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Trigger;
-import org.yakindu.sct.model.sgraph.Vertex;
 import org.yakindu.sct.model.stext.inferrer.STextTypeInferrer;
-import org.yakindu.sct.model.stext.resource.StextResource;
 import org.yakindu.sct.model.stext.stext.ImportScope;
 import org.yakindu.sct.model.stext.stext.InterfaceScope;
 import org.yakindu.sct.model.stext.stext.InternalScope;
@@ -59,6 +50,7 @@ import org.yakindu.sct.model.stext.stext.TransitionSpecification;
 import org.yakindu.sct.model.stext.stext.impl.StextFactoryImpl;
 import org.yakindu.sct.model.stext.test.util.AbstractSTextTest;
 import org.yakindu.sct.model.stext.test.util.STextInjectorProvider;
+import org.yakindu.sct.model.stext.test.validation.AbstractSTextValidationTest;
 import org.yakindu.sct.model.stext.validation.STextJavaValidator;
 import org.yakindu.sct.model.stext.validation.STextValidationMessages;
 import org.yakindu.sct.test.models.AbstractTestModelsUtil;
@@ -75,38 +67,8 @@ import com.google.inject.Injector;
  */
 @RunWith(XtextRunner.class)
 @InjectWith(STextInjectorProvider.class)
-public class STextJavaValidatorTest extends AbstractSTextTest implements STextValidationMessages {
-
-	@Inject
-	private STextJavaValidator validator;
-	@Inject
-	private Injector injector;
-	private ValidatorTester<STextJavaValidator> tester;
-	protected BasicDiagnostic diagnostics;
-	protected SGraphFactory factory;
-	protected Statechart statechart;
-	protected StextResource resource;
-
-	public STextJavaValidatorTest() {
-	}
-
-	@Before
-	public void setup() {
-		factory = SGraphFactory.eINSTANCE;
-
-		resource = new StextResource(URI.createURI(""));
-		injector.injectMembers(resource);
-		statechart = factory.createStatechart();
-		resource.getContents().add(statechart);
+public class STextJavaValidatorTest extends AbstractSTextValidationTest implements STextValidationMessages {
 
-		diagnostics = new BasicDiagnostic();
-		tester = new ValidatorTester<STextJavaValidator>(validator, injector);
-	}
-
-	@After
-	public void teardown() {
-		tester = null;
-	}
 
 	/**
 	 * @see STextJavaValidator#checkVariableDefinition(org.yakindu.sct.model.stext.stext.VariableDefinition)
@@ -598,115 +560,6 @@ public class STextJavaValidatorTest extends AbstractSTextTest implements STextVa
 		assertWarning(diagnostics, INTERNAL_DECLARATION_UNUSED);
 	}
 	
-	/**
-	 * Show warning when transition has no guard
-	 */
-	@Test
-	public void transitionsWithNoTrigger() {
-
-		Region region = factory.createRegion();
-
-		// create vertices for main region
-		Entry entry = factory.createEntry();
-		State a = factory.createState();
-		a.setName("A");
-		State b = factory.createState();
-		b.setName("B");
-		State c = factory.createState();
-		c.setName("C");
-		State d = factory.createState();
-		c.setName("D");
-		Choice e = factory.createChoice();
-		State f = factory.createState();
-		f.setName("F");
-		Transition entryToA = createTransition(entry, a);
-		Transition aToB = createTransition(a, b);
-		Transition bToC = createTransition(b, c);
-		Transition cToD = createTransition(c, d);
-		Transition eToF = createTransition(e, f);
-
-		// create vertices for compositState
-		State bb = factory.createState();
-		bb.setName("BB");
-		Entry entryB = factory.createEntry();
-		Exit exitB = factory.createExit();
-
-		Region b_region = factory.createRegion();
-		b_region.getVertices().add(entryB);
-		b_region.getVertices().add(bb);
-		b_region.getVertices().add(exitB);
-		b.getRegions().add(b_region);
-		Transition entryBToBB = createTransition(entryB, bb);
-		Transition bbToExitB = createTransition(bb, exitB);
-
-		region.getVertices().add(entry);
-		region.getVertices().add(a);
-		region.getVertices().add(b);
-		region.getVertices().add(c);
-		region.getVertices().add(d);
-		statechart.getRegions().add(region);
-
-		// transitions from entry point to State A -> valid model with no
-		// warnings
-		assertTrue(validator.validate(eToF, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 0);
-
-		// transitions from entry point to State A -> valid model with no
-		// warnings
-		assertTrue(validator.validate(entryToA, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 0);
-
-		// transition from StateA to StateB -> valid model with warnings expect
-		// 1 warning in total
-		assertTrue(validator.validate(aToB, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 1);
-		resetDiagnostics();
-
-		// transition from EntryB to StateBB -> valid model with no warnings
-		// expect 1 warning in total
-		assertTrue(validator.validate(entryBToBB, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 0);
-
-		// transition from BB to ExitB -> valid model with warnings expect 2
-		// warning in total
-		assertTrue(validator.validate(bbToExitB, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 1);
-		resetDiagnostics();
-
-		// transition from B to C -> valid model with no warning warnings expect
-		// 2 warning in total
-		assertTrue(validator.validate(bToC, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 0);
-
-		// transition from C to D -> valid model with warning warning expect 3
-		// warning in total
-		assertTrue(validator.validate(cToD, diagnostics, new HashMap<Object, Object>()));
-		assertIssueCount(diagnostics, 1);
-		resetDiagnostics();
-
-	}
-
-	/**
-	 * The outgoing transitions of a sync (fork / join) node must not have any
-	 * trigger part. Thus empty transitions must not have any warning. This test
-	 * case addresses a bug #75 (
-	 * https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=75 )
-	 * .
-	 */
-	@Test
-	public void validEmptyTransitionFromSync() {
-		statechart = AbstractTestModelsUtil.loadStatechart(VALIDATION_TESTMODEL_DIR
-				+ "ValidEmptyTransitionFromSync.sct");
-		Iterator<EObject> iter = statechart.eAllContents();
-		while (iter.hasNext()) {
-			EObject element = iter.next();
-			if (element instanceof Transition) {
-				validator.validate(element, diagnostics, new HashMap<Object, Object>());
-			}
-		}
-
-		assertIssueCount(diagnostics, 0);
-	}
 
 	@Test
 	public void checkImportExists() {
@@ -716,42 +569,4 @@ public class STextJavaValidatorTest extends AbstractSTextTest implements STextVa
 		AssertableDiagnostics validationResult = tester.validate(importScope.getImports().get(0));
 		validationResult.assertError(STextJavaValidator.IMPORT_NOT_RESOLVED);
 	}
-
-	protected Transition createTransition(Vertex source, Vertex target) {
-		Transition trans = SGraphFactory.eINSTANCE.createTransition();
-		trans.setSource(source);
-		trans.setTarget(target);
-		source.getOutgoingTransitions().add(trans);
-		target.getIncomingTransitions().add(trans);
-		return trans;
-	}
-
-	protected void assertError(Diagnostic diag, String message) {
-		Diagnostic d = issueByName(diag, message);
-		assertNotNull("Issue '" + message + "' does not exist.", issueByName(diag, message));
-		assertEquals("Issue '" + message + "' is no error.", Diagnostic.ERROR, d.getSeverity());
-	}
-
-	protected void assertWarning(Diagnostic diag, String message) {
-		Diagnostic d = issueByName(diag, message);
-		assertNotNull("Issue '" + message + "' does not exist.", issueByName(diag, message));
-		assertEquals("Issue '" + message + "' is no warning.", Diagnostic.WARNING, d.getSeverity());
-	}
-
-	protected void assertIssueCount(Diagnostic diag, int count) {
-		int c = diag.getChildren().size();
-		assertEquals("expected " + count + " issue(s) but were " + c + " [" + diag.toString() + "]", count, c);
-	}
-
-	protected Diagnostic issueByName(Diagnostic diag, String message) {
-		for (Diagnostic issue : diag.getChildren()) {
-			if (message.equals(issue.getMessage()))
-				return issue;
-		}
-		return null;
-	}
-
-	protected void resetDiagnostics() {
-		diagnostics = new BasicDiagnostic();
-	}
 }

+ 90 - 0
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/validation/AbstractSTextValidationTest.java

@@ -0,0 +1,90 @@
+package org.yakindu.sct.model.stext.test.validation;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.xtext.junit4.validation.ValidatorTester;
+import org.junit.After;
+import org.junit.Before;
+import org.yakindu.sct.model.sgraph.SGraphFactory;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Vertex;
+import org.yakindu.sct.model.stext.resource.StextResource;
+import org.yakindu.sct.model.stext.test.util.AbstractSTextTest;
+import org.yakindu.sct.model.stext.validation.STextJavaValidator;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
+public abstract class AbstractSTextValidationTest extends AbstractSTextTest {
+
+	@Inject
+	public STextJavaValidator validator;
+	@Inject
+	public Injector injector;
+
+	protected ValidatorTester<STextJavaValidator> tester;
+	protected BasicDiagnostic diagnostics;
+	protected SGraphFactory factory;
+	protected Statechart statechart;
+	protected StextResource resource;
+
+	@Before public void setup() {
+		factory = SGraphFactory.eINSTANCE;
+	
+		resource = new StextResource(URI.createURI(""));
+		injector.injectMembers(resource);
+		statechart = factory.createStatechart();
+		resource.getContents().add(statechart);
+	
+		diagnostics = new BasicDiagnostic();
+		tester = new ValidatorTester<STextJavaValidator>(validator, injector);
+	}
+
+	@After public void teardown() {
+		tester = null;
+	}
+
+	protected void resetDiagnostics() {
+		diagnostics = new BasicDiagnostic();
+	}
+
+	protected Transition createTransition(Vertex source, Vertex target) {
+		Transition trans = SGraphFactory.eINSTANCE.createTransition();
+		trans.setSource(source);
+		trans.setTarget(target);
+		source.getOutgoingTransitions().add(trans);
+		target.getIncomingTransitions().add(trans);
+		return trans;
+	}
+
+	protected void assertError(Diagnostic diag, String message) {
+		Diagnostic d = issueByName(diag, message);
+		assertNotNull("Issue '" + message + "' does not exist.", issueByName(diag, message));
+		assertEquals("Issue '" + message + "' is no error.", Diagnostic.ERROR, d.getSeverity());
+	}
+
+	protected void assertWarning(Diagnostic diag, String message) {
+		Diagnostic d = issueByName(diag, message);
+		assertNotNull("Issue '" + message + "' does not exist.", issueByName(diag, message));
+		assertEquals("Issue '" + message + "' is no warning.", Diagnostic.WARNING, d.getSeverity());
+	}
+
+	protected void assertIssueCount(Diagnostic diag, int count) {
+		int c = diag.getChildren().size();
+		assertEquals("expected " + count + " issue(s) but were " + c + " [" + diag.toString() + "]", count, c);
+	}
+
+	protected Diagnostic issueByName(Diagnostic diag, String message) {
+		for (Diagnostic issue : diag.getChildren()) {
+			if (message.equals(issue.getMessage()))
+				return issue;
+		}
+		return null;
+	}
+
+}

+ 241 - 0
test-plugins/org.yakindu.sct.model.stext.test/src/org/yakindu/sct/model/stext/test/validation/TransitionsWithNoTriggerTest.java

@@ -0,0 +1,241 @@
+/**
+ * Copyright (c) 2015 itemis AG.
+ * 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:
+ * 	itemis AG - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.model.stext.test.validation;
+
+import static org.eclipse.xtext.EcoreUtil2.eAllOfType;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.yakindu.sct.model.sgraph.util.SGgraphUtil.firstNamed;
+import static org.yakindu.sct.test.models.AbstractTestModelsUtil.VALIDATION_TESTMODEL_DIR;
+
+import java.util.HashMap;
+
+import org.eclipse.emf.ecore.EObject;
+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.sgraph.Choice;
+import org.yakindu.sct.model.sgraph.Entry;
+import org.yakindu.sct.model.sgraph.Exit;
+import org.yakindu.sct.model.sgraph.Region;
+import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.model.sgraph.Synchronization;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.stext.stext.ReactionTrigger;
+import org.yakindu.sct.model.stext.stext.StextFactory;
+import org.yakindu.sct.model.stext.test.util.STextInjectorProvider;
+import org.yakindu.sct.model.stext.validation.STextValidationMessages;
+import org.yakindu.sct.test.models.AbstractTestModelsUtil;
+
+/** 
+ * @author terfloth - Initial contribution
+ * 
+ */
+@RunWith(XtextRunner.class)
+@InjectWith(STextInjectorProvider.class)
+public class TransitionsWithNoTriggerTest extends AbstractSTextValidationTest implements STextValidationMessages {
+	
+	
+	
+	private Entry entry;
+	protected State stateA;
+	private State stateB;
+	private State stateC;
+	private State stateD;
+	private Choice choice;
+	private State stateE;
+	private Transition entryToStateA;
+	private Transition stateAToStateB;
+	private Transition stateBToStateC;
+	private Transition stateCToStateD;
+	private Transition choiceToStateE;
+	private State stateBB;
+	private Entry entryB;
+	private Exit exitB;
+	private Region regionB;
+	private Transition entryBToStateBB;
+	private Transition stateBBToExitB;
+
+	
+	@Override @Before 
+	public void setup() {
+		super.setup();
+		
+		StextFactory stextFactory = StextFactory.eINSTANCE;
+		
+		Region region = factory.createRegion();
+
+		entry = factory.createEntry();
+		stateA = factory.createState();
+		stateA.setName("A");
+		stateB = factory.createState();
+		stateB.setName("B");
+		stateC = factory.createState();
+		stateC.setName("C");
+		stateD = factory.createState();
+		stateD.setName("D");
+		choice = factory.createChoice();
+		stateE = factory.createState();
+		stateE.setName("E");
+		entryToStateA = createTransition(entry, stateA);
+		stateAToStateB = createTransition(stateA, stateB);
+		stateBToStateC = createTransition(stateB, stateC);
+
+		stateCToStateD = createTransition(stateC, stateD);
+		stateCToStateD.setSpecification("always");
+		ReactionTrigger triggerCToD = stextFactory.createReactionTrigger();
+		triggerCToD.getTriggers().add(stextFactory.createAlwaysEvent());
+		stateCToStateD.setTrigger(triggerCToD);
+		
+		choiceToStateE = createTransition(choice, stateE);
+
+		stateBB = factory.createState();
+		stateBB.setName("BB");
+		entryB = factory.createEntry();
+		exitB = factory.createExit();
+
+		regionB = factory.createRegion();
+		regionB.getVertices().add(entryB);
+		regionB.getVertices().add(stateBB);
+		regionB.getVertices().add(exitB);
+		stateB.getRegions().add(regionB);
+		entryBToStateBB = createTransition(entryB, stateBB);
+		stateBBToExitB = createTransition(stateBB, exitB);
+
+		region.getVertices().add(entry);
+		region.getVertices().add(stateA);
+		region.getVertices().add(stateB);
+		region.getVertices().add(stateC);
+		region.getVertices().add(stateD);
+		statechart.getRegions().add(region);	
+	}
+
+	
+	
+	/** A transition from an entry to a state must have no trigger. */
+	@Test public void noTriggerOnTopLevelEntryToState() {
+
+		assertTrue(validator.validate(entryToStateA, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 0);
+	}
+
+	/** A transition from an entry to a state must have no trigger. */
+	@Test public void noTriggerOnSubStateEntryToState() {
+
+		assertTrue(validator.validate(entryBToStateBB, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 0);
+	}
+
+	/** No trigger on a transition from a choice to a state is valid. */
+	@Test public void noTriggerOnChoiceToState() {
+
+		assertTrue(validator.validate(choiceToStateE, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 0);
+	}
+
+	/** A transition from a state with exit may have no trigger. */
+	@Test public void noTriggerOnExitTransition() {
+
+		assertTrue(validator.validate(stateBToStateC, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 0);
+	}
+
+	/** A transition between two regular states (with no exit) should have a trigger. */
+	@Test public void missingTriggerOnStateToState() {
+
+		assertTrue(validator.validate(stateAToStateB, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 1);
+	}
+
+	/** A transition from a state to an exit should have a trigger. */
+	@Test public void missingTriggerOnStateToExit() {
+
+		assertTrue(validator.validate(stateBBToExitB, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 1);
+	}
+
+	/** A transition from a state to a state with a trigger must issue no warning. */
+	@Test public void existingTriggerOnStateToState() {
+
+		assertTrue(validator.validate(stateCToStateD, diagnostics, new HashMap<Object, Object>()));
+		assertIssueCount(diagnostics, 0);
+	}
+
+	
+	/**
+	 * The outgoing transitions of a sync (fork / join) node must not have any
+	 * trigger part. Thus empty transitions must not have any warning. This test
+	 * case addresses a bug #75 (
+	 * https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=75 )
+	 * .
+	 */
+	@Test public void noTriggerOnSyncOutgoing() {
+		statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
+		
+		Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "valid");
+		Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
+		
+		for (Transition t : sync.getOutgoingTransitions()) {
+			assertTrue(validate(t));
+			assertIssueCount(diagnostics, 0);
+		}
+	}
+
+	/**
+	 * If a sync node has multiple incoming transitions then the transitions can omit the trigger.
+	 */
+	@Test public void noTriggerOnSyncIncoming() {
+		statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
+		
+		Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "valid");
+		Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
+		
+		for (Transition t : sync.getIncomingTransitions()) {
+			assertTrue(validate(t));
+			assertIssueCount(diagnostics, 0);
+		}
+	}
+
+	
+	/**
+	 * If a sync node has multiple incoming transitions then the transitions can omit the trigger.
+	 */
+	@Test public void missingTriggerOnSyncSingleIncoming() {
+		statechart = loadStatechart("ValidEmptyTransitionFromSync.sct");
+		
+		Region validRegion = firstNamed(eAllOfType(statechart, Region.class), "warning");
+		Synchronization sync = eAllOfType(validRegion, Synchronization.class).get(0);
+		
+		assertEquals(1, sync.getIncomingTransitions().size());
+		assertTrue(validate(sync.getIncomingTransitions().get(0)));
+		assertIssueCount(diagnostics, 1);
+		assertWarning(diagnostics, ISSUE_TRANSITION_WITHOUT_TRIGGER);
+	}
+
+	
+	
+	protected boolean validate(EObject obj) {
+		return validator.validate(obj, diagnostics,
+				new HashMap<Object, Object>());
+	}
+	
+	protected Statechart loadStatechart(String modelName) {
+		return AbstractTestModelsUtil
+				.loadStatechart(VALIDATION_TESTMODEL_DIR
+						+ modelName);
+	}
+
+
+}