ソースを参照

reworded choice validation

Axel Terfloth 7 年 前
コミット
0cdaf2d9aa

+ 6 - 5
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/validation/ChoiceValidator.java

@@ -16,18 +16,19 @@ import org.yakindu.sct.model.sgraph.Choice;
 
 /**
  * 
- * All validation contraints for the meta model element {@link Choice}
+ * All validation constraints for the meta model element {@link Choice}
  * 
  */
 public class ChoiceValidator extends AbstractSGraphValidator {
 
-	private static final String OUTGOING_TRANSITION_COUNT_MSG = "A choice must have at least one outgoing transition.";
-	public static final String OUTGOING_TRANSITION_COUNT_CODE = "choice.out.transition";
+	private static final String CHOICE_TRANSITIONS_REQUIRE_N_OUT_MSG = "A choice must have at least one outgoing transition.";
+	public static final String CHOICE_TRANSITIONS_REQUIRE_N_OUT_CODE = "choice.transitions.RequireNOut";
 
+	
 	@Check(CheckType.FAST)
-	public void choiceHasOutgoingTransition(Choice choice) {
+	public void checkChoiceTransitionsRequireNOut(Choice choice) {
 		if (choice.getOutgoingTransitions().size() == 0) {
-			error(OUTGOING_TRANSITION_COUNT_MSG, choice, null, -1, OUTGOING_TRANSITION_COUNT_CODE);
+			error(CHOICE_TRANSITIONS_REQUIRE_N_OUT_MSG, choice, null, -1, CHOICE_TRANSITIONS_REQUIRE_N_OUT_CODE);
 		}
 	}
 

+ 2 - 2
test-plugins/org.yakindu.sct.model.sgraph.test/src/org/yakindu/sct/model/sgraph/test/validation/ChoiceValidatorTest.java

@@ -10,7 +10,7 @@
  */
 package org.yakindu.sct.model.sgraph.test.validation;
 
-import static org.yakindu.sct.model.sgraph.validation.ChoiceValidator.OUTGOING_TRANSITION_COUNT_CODE;
+import static org.yakindu.sct.model.sgraph.validation.ChoiceValidator.CHOICE_TRANSITIONS_REQUIRE_N_OUT_CODE;
 
 import org.junit.Test;
 import org.yakindu.sct.model.sgraph.Choice;
@@ -46,7 +46,7 @@ public class ChoiceValidatorTest extends AbstractSGraphValidatorTest {
 		region.getVertices().add(state);
 		createTransition(state, choice);
 
-		tester.validate(choice).assertError(OUTGOING_TRANSITION_COUNT_CODE);
+		tester.validate(choice).assertError(CHOICE_TRANSITIONS_REQUIRE_N_OUT_CODE);
 	}
 
 }