Explorar o código

Add test & copyright headers

René Beckmann %!s(int64=7) %!d(string=hai) anos
pai
achega
ac27f5d485

+ 22 - 0
test-plugins/org.yakindu.sct.model.sexec.test/src/org/yakindu/sct/model/sexec/transformation/test/StatechartExtensionsTest.java

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) 2017 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.model.sexec.transformation.test;
 
 import org.eclipse.xtext.junit4.InjectWith;
@@ -13,6 +23,10 @@ import com.google.inject.Inject;
 
 import static org.junit.Assert.*;
 
+/**
+ * @author rbeckmann
+ *
+ */
 @RunWith(XtextRunner.class)
 @InjectWith(TestModelInjectorProvider.class)
 public class StatechartExtensionsTest {
@@ -25,4 +39,12 @@ public class StatechartExtensionsTest {
 		
 		assertEquals(statechartExtensions.maxNumberOfParallelTimeEvents(sc), 6);
 	}
+	
+	@Test
+	public void testmaxNumberOfParallelTimeEvents_zero() {
+		ExtensionTestModels models = new ExtensionTestModels();
+		Statechart sc = ExtensionTestModels.loadStatechart(models.getModelDirectory() + ExtensionTestModels.NO_TIME_EVENTS);
+		
+		assertEquals(statechartExtensions.maxNumberOfParallelTimeEvents(sc), 0);
+	}
 }

+ 1 - 0
test-plugins/org.yakindu.sct.test.models/.settings/org.eclipse.core.resources.prefs

@@ -33,6 +33,7 @@ encoding//testmodels/SCTUnit/TypeAlias.sct=UTF-8
 encoding//testmodels/SCTUnit/ValuedEvents.sct=UTF-8
 encoding//testmodels/SCTUnit/entries/EntryReactionAction.sct=UTF-8
 encoding//testmodels/SCTUnit/executionorder/ChildFirstExecutionHierarchy.sct=UTF-8
+encoding//testmodels/extensions/NoTimeEvents.sct=UTF-8
 encoding//testmodels/validation/EntryTransitionToParentState.sct=UTF-8
 encoding//testmodels/validation/NoTriggerOnTransitionWithExitPointSpec.sct=UTF-8
 encoding//testmodels/validation/RegionCantBeEnteredUsingShallowHistory.sct=UTF-8

+ 16 - 0
test-plugins/org.yakindu.sct.test.models/src/org/yakindu/sct/test/models/ExtensionTestModels.java

@@ -1,9 +1,25 @@
+/**
+ * Copyright (c) 2017 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.test.models;
 
+/**
+ * @author rbeckmann
+ *
+ */
 public class ExtensionTestModels extends AbstractTestModelsUtil {
 	private static final String TESTMODEL_DIR = "org.yakindu.sct.test.models/testmodels/extensions/";
 	
 	public static final String PARALLEL_TIME_EVENTS = "ParallelTimeEvents.sct";
+	public static final String NO_TIME_EVENTS = "NoTimeEvents.sct";
 	@Override
 	public String getModelDirectory() {
 		return TESTMODEL_DIR;