Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java')
-rw-r--r--tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java
index 18e2bc45f15..47e6cdd8c61 100644
--- a/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java
+++ b/tests/junit/plugins/uml/alf/org.eclipse.papyrus.uml.alf.tests/src/org/eclipse/papyrus/uml/alf/tests/mapper/CompilerTests.java
@@ -540,6 +540,7 @@ public class CompilerTests {
Behavior classifierBehavior = testClass.getClassifierBehavior();
assertNotNull(classifierBehavior);
+ assertTrue(testClass.getOwnedBehaviors().contains(classifierBehavior));
assertEquals(testClass.getName() + "$behavior$1", classifierBehavior.getName());
assertEquals(VisibilityKind.PRIVATE_LITERAL, classifierBehavior.getVisibility());
assertTrue(classifierBehavior instanceof Activity);
@@ -578,4 +579,25 @@ public class CompilerTests {
assertNotNull(action);
assertEquals(operation, action.getOperation());
}
+
+ public static String TEST_ACTIVE_CLASS_TEXT = "active class Test { public p() { } } do 'Test$behavior$1'";
+
+ @Test
+ public void testActiveClassRecompile() throws ParsingError, MappingError {
+ Class testClass = compileTestClassifierBehavior();
+
+ Behavior classifierBehavior = testClass.getClassifierBehavior();
+ assertTextualRepresentation(classifierBehavior, CLASSIFIER_BEHAVIOR_ACTIVITY_TEXT);
+
+ compiler.compile(testClass, TEST_ACTIVE_CLASS_TEXT);
+
+ assertTextualRepresentation(testClass, TEST_ACTIVE_CLASS_TEXT);
+ assertEquals(classifierBehavior, testClass.getClassifierBehavior());
+ assertTrue(testClass.getOwnedBehaviors().contains(classifierBehavior));
+ assertEquals(testClass.getName() + "$behavior$1", classifierBehavior.getName());
+ assertEquals(VisibilityKind.PRIVATE_LITERAL, classifierBehavior.getVisibility());
+ assertTextualRepresentation(classifierBehavior, CLASSIFIER_BEHAVIOR_ACTIVITY_TEXT);
+ assertTrue(classifierBehavior instanceof Activity);
+ assertTrue(((Activity)classifierBehavior).getNodes().size() > 0);
+ }
}

Back to the top