Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-08-12 16:10:14 -0400
committerChristian W. Damus2015-08-12 22:00:43 -0400
commit6eaabb65cb893537db2539e04b3606be9cbbe13f (patch)
tree1e64d85ce2e87144ab1e663ca3d1bfaa0a2b0c4b
parent26085a2255f73ee759050cad3f65e907f98a86de (diff)
downloadorg.eclipse.papyrus-6eaabb65cb893537db2539e04b3606be9cbbe13f.tar.gz
org.eclipse.papyrus-6eaabb65cb893537db2539e04b3606be9cbbe13f.tar.xz
org.eclipse.papyrus-6eaabb65cb893537db2539e04b3606be9cbbe13f.zip
Bug 464647: [Tests] Generate JUnit tests for diagram view synch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=464647 Further refinements to generation of specific diagram test suites, including support for custom model-to-text templates for generation of JUnit sources from the UTP model.
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF11
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java10
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java16
-rw-r--r--tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend23
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend149
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend14
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend32
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend46
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend30
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend30
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend82
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java84
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/synchronization/AbstractSynchronizationTest.java4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend14
18 files changed, 314 insertions, 239 deletions
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF b/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF
index 4ed029eb1df..bcfa6af5f40 100644
--- a/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF
+++ b/tests/framework/org.eclipse.papyrus.tests.framework/META-INF/MANIFEST.MF
@@ -41,13 +41,14 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: org.eclipse.papyrus.tests.framework,
+ org.eclipse.papyrus.tests.framework.exceptions,
+ org.eclipse.papyrus.tests.framework.exceptions.impl,
+ org.eclipse.papyrus.tests.framework.exceptions.util,
org.eclipse.papyrus.tests.framework.gmfgen2uml,
org.eclipse.papyrus.tests.framework.gmfgenuml2utp,
+ org.eclipse.papyrus.tests.framework.internal.exceptions.operations,
org.eclipse.papyrus.tests.framework.m2m,
org.eclipse.papyrus.tests.framework.m2t.xtend,
- org.eclipse.papyrus.tests.framework.mwe,
- org.eclipse.papyrus.tests.framework.exceptions,
- org.eclipse.papyrus.tests.framework.exceptions.impl,
- org.eclipse.papyrus.tests.framework.exceptions.util,
- org.eclipse.papyrus.tests.framework.internal.exceptions.operations
+ org.eclipse.papyrus.tests.framework.m2t.xtend.templates,
+ org.eclipse.papyrus.tests.framework.mwe
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java
index 938b01b10d5..89e76d69513 100644
--- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java
+++ b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorComponent.java
@@ -29,6 +29,7 @@ import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.CodegenContext;
import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.PapyrusDiagramCanonicalTests;
import org.eclipse.uml2.uml.Model;
+import com.google.common.base.Supplier;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -48,20 +49,15 @@ public class CodeGeneratorComponent extends WorkflowComponentWithModelSlot {
@Inject
private CodegenContext codegenContext;
- public CodeGeneratorComponent() {
- injector = Guice.createInjector(createCodeGeneratorModule());
+ public CodeGeneratorComponent(Supplier<? extends CodeGeneratorModule> codegenModule) {
+ injector = Guice.createInjector(codegenModule.get());
injector.injectMembers(this);
}
- protected CodeGeneratorModule createCodeGeneratorModule() {
- return new CodeGeneratorModule();
- }
-
public String getTempSrcPath() {
return tempSrcPath;
}
-
public void setTempSrcPath(String tempSrcPath) {
this.tempSrcPath = tempSrcPath;
}
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java
index 23d7218d360..95fba8f99fc 100644
--- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java
+++ b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/m2t/xtend/CodeGeneratorModule.java
@@ -52,35 +52,35 @@ public class CodeGeneratorModule extends AbstractModule {
// Pass
}
- private void bindAllPackageTestsTemplate() {
+ protected void bindAllPackageTestsTemplate() {
// Pass
}
- private void bindAppearanceTestTemplate() {
+ protected void bindAppearanceTestTemplate() {
// Pass
}
- private void bindDeleteTestTemplate() {
+ protected void bindDeleteTestTemplate() {
// Pass
}
- private void bindDropTestTemplate() {
+ protected void bindDropTestTemplate() {
// Pass
}
- private void bindEditionTestTemplate() {
+ protected void bindEditionTestTemplate() {
// Pass
}
- private void bindTestChildLabelNodeTestTemplate() {
+ protected void bindTestChildLabelNodeTestTemplate() {
// Pass
}
- private void bindTestLinkTemplate() {
+ protected void bindTestLinkTemplate() {
// Pass
}
- private void bindTestNodeTemplate() {
+ protected void bindTestNodeTemplate() {
// Pass
}
diff --git a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend
index e177eec2ce6..ac01e1f0391 100644
--- a/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend
+++ b/tests/framework/org.eclipse.papyrus.tests.framework/src/org/eclipse/papyrus/tests/framework/mwe/GenerateTestsWorkflow.xtend
@@ -12,32 +12,33 @@
******************************************************************************/
package org.eclipse.papyrus.tests.framework.mwe
+import java.util.Collection
+import java.util.List
+import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.plugin.EcorePlugin
+import org.eclipse.emf.mwe.core.WorkflowContext
+import org.eclipse.emf.mwe.core.issues.Issues
+import org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
+import org.eclipse.emf.mwe.core.monitor.ProgressMonitor
import org.eclipse.emf.mwe.utils.DirectoryCleaner
import org.eclipse.emf.mwe.utils.Mapping
import org.eclipse.emf.mwe.utils.Reader
import org.eclipse.emf.mwe.utils.StandaloneSetup
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
import org.eclipse.papyrus.mwe2.utils.XtendWorkflow
+import org.eclipse.papyrus.mwe2.utils.components.MultiReader
import org.eclipse.papyrus.mwe2.utils.components.RegisterUmlProfile
import org.eclipse.papyrus.mwe2.utils.components.UMLWriter
import org.eclipse.papyrus.tests.framework.gmfgen2uml.GMFGen2UMLComponent
import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPComponent
import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule
import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorComponent
+import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorModule
import org.eclipse.uml2.uml.Model
import org.eclipse.uml2.uml.Profile
import org.eclipse.uml2.uml.resources.util.UMLResourcesUtil
import org.eclipse.xtend.lib.annotations.Accessors
-import org.eclipse.emf.common.util.URI
-import java.util.List
-import org.eclipse.papyrus.mwe2.utils.components.MultiReader
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
-import java.util.Collection
-import org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
-import org.eclipse.emf.mwe.core.monitor.ProgressMonitor
-import org.eclipse.emf.mwe.core.issues.Issues
-import org.eclipse.emf.mwe.core.WorkflowContext
/**
* A workflow orchestrating a transformation pipeline for generation of JUnit tests for the edit-parts of a diagram.
@@ -65,6 +66,8 @@ class GenerateTestsWorkflow extends XtendWorkflow {
(Model, Model, Profile)=>GMFGen2UTPModule utpModuleFunction
+ @Accessors ()=>CodeGeneratorModule codegenModuleSupplier = [new CodeGeneratorModule]
+
final TestExceptionsBuilder testExceptionsBuilder = new TestExceptionsBuilder
def setUtpModuleFunction((Model, Model, Profile)=>GMFGen2UTPModule utpModuleFunction) {
@@ -281,7 +284,7 @@ class GenerateTestsWorkflow extends XtendWorkflow {
components += new DirectoryCleaner => [
directory = projectFile(testSrcGenLocation)
]
- components += new CodeGeneratorComponent => [
+ components += new CodeGeneratorComponent(codegenModuleSupplier) => [
tempSrcPath = projectFile(testSrcGenLocation)
modelSlot = 'papyrusTestModel'
]
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend
index 274d35f571b..83c0e383615 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.activity.tests/src/org/eclipse/papyrus/uml/diagram/activity/tests/generation/ActivityDiagramGenerateTestsWorkflow.xtend
@@ -29,7 +29,7 @@ class ActivityDiagramGenerateTestsWorkflow {
def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
testProjectName = 'org.eclipse.papyrus.uml.diagram.activity.tests'
- gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen')
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.activity/model/activityDiagram.gmfgen')
testSrcGenLocation = 'test-gen/'
testModel = 'model/ActivityDiagramTest.uml'
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend
index e67d9bc1114..a6940b3e41e 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.clazz.tests/test/org/eclipse/papyrus/uml/diagram/clazz/tests/generation/ClassDiagramGenerateTestsWorkflow.xtend
@@ -29,7 +29,7 @@ class ClassDiagramGenerateTestsWorkflow {
def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
testProjectName = 'org.eclipse.papyrus.uml.diagram.clazz.tests'
- gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen')
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.clazz/model/classdiagram.gmfgen')
testSrcGenLocation = 'test-gen/'
testModel = 'model/ClassDiagramTest.uml'
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend
index 1d74515694d..9cbad5813dd 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication.tests/src/org/eclipse/papyrus/uml/diagram/communication/tests/generation/CommunicationDiagramGenerateTestsWorkflow.xtend
@@ -28,7 +28,7 @@ class CommunicationDiagramGenerateTestsWorkflow {
def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
testProjectName = 'org.eclipse.papyrus.uml.diagram.communication.tests'
- gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen')
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.communication/model/communicationdiagram.gmfgen')
testSrcGenLocation = 'test-gen/'
testModel = 'model/CommunicationDiagramTest.uml'
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend
index 4d5f2e0a5df..518bd911ff1 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.component.tests/src/org/eclipse/papyrus/uml/diagram/component/test/generation/ComponentDiagramGenerateTestsWorkflow.xtend
@@ -28,7 +28,7 @@ class ComponentDiagramGenerateTestsWorkflow {
def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
testProjectName = 'org.eclipse.papyrus.uml.diagram.component.tests'
- gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen')
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.component/model/ComponentDiagram.gmfgen')
testSrcGenLocation = 'test-gen/'
testModel = 'model/ComponentDiagramTest.uml'
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend
index c1893e92fb4..d790b2699d8 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite.tests/test/org/eclipse/papyrus/uml/diagram/composite/test/generation/CompositeDiagramGenerateTestsWorkflow.xtend
@@ -26,15 +26,20 @@ class CompositeDiagramGenerateTestsWorkflow {
runWorkflow(workflow);
}
- def static void runWorkflow(GenerateTestsWorkflow workflow) {
- workflow.testProjectName = 'org.eclipse.papyrus.uml.diagram.composite.tests'
- workflow.gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen')
- workflow.testSrcGenLocation = 'test-gen/'
- workflow.testModel = 'model/CompositeDiagramTest.uml'
+ def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
+ testProjectName = 'org.eclipse.papyrus.uml.diagram.composite.tests'
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen')
+ testSrcGenLocation = 'test-gen/'
+ testModel = 'model/CompositeDiagramTest.uml'
- workflow.utpModuleFunction = [gmfgen, framework, utp |
+ utpModuleFunction = [gmfgen, framework, utp |
new GMFGen2UTPModule(gmfgen, framework, utp) => [
diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.composite.test'
+
+ // Nonconformant API names for this diagram
+ diagramCreationCommand = 'CreateCompositeDiagramCommand';
+ testConstantsInterface = 'ICompositeDiagramTestsConstants';
+
topContainerEditPart = 'ClassCompositeEditPart';
topNodesToTest += #[
'ClassCompositeEditPart',
@@ -92,7 +97,6 @@ class CompositeDiagramGenerateTestsWorkflow {
]
childNodesToTest += #[
'PropertyPartEditPartCN',
- 'CollaborationRoleEditPartCN',
'CollaborationUseEditPartCN',
'CollaborationCompositeEditPartCN',
'CommentEditPartCN',
@@ -126,131 +130,18 @@ class CompositeDiagramGenerateTestsWorkflow {
'ConstraintEditPartCN'
*/
]
- linksToTest += #[
- 'AbstractionEditPart',
- 'DeploymentEditPart',
- //Blocks the interface
- //'InformationFlowEditPart',
- 'DependencyEditPart',
- 'RealizationEditPart',
- 'UsageEditPart'
- ]
- linksOwnedBySourceToTest += #[
- 'GeneralizationEditPart',
- 'InterfaceRealizationEditPart',
- 'SubstitutionEditPart'
- ]
- elementTypesAppearanceTests += #[
- 'ActivityEditPart',
- 'ActorEditPart',
- 'AnyReceiveEventEditPart',
- 'ArtifactEditPart',
- 'CallEventEditPart',
- 'ChangeEventEditPart',
- 'ClassEditPart',
- 'CollaborationEditPart',
- 'CommentEditPart',
- 'ComponentEditPart',
- 'ConstraintEditPart',
- 'DataTypeEditPart',
- 'DeploymentSpecificationEditPart',
- 'DeviceEditPart',
- 'DurationEditPart',
- 'DurationConstraintEditPart',
- 'DurationIntervalEditPart',
- 'DurationObservationEditPart',
- 'EnumerationEditPart',
- 'ExecutionEnvironmentEditPart',
- 'ExpressionEditPart',
- 'FunctionBehaviorEditPart',
- 'InformationItemEditPart',
- 'InstanceValueEditPart',
- 'InteractionEditPart',
- 'InteractionConstraintEditPart',
- 'InterfaceEditPart',
- 'IntervalEditPart',
- 'IntervalConstraintEditPart',
- 'LiteralBooleanEditPart',
- 'LiteralIntegerEditPart',
- 'LiteralNullEditPart',
- 'LiteralStringEditPart',
- 'LiteralUnlimitedNaturalEditPart',
- 'NodeEditPart',
- 'OpaqueBehaviorEditPart',
- 'OpaqueExpressionEditPart',
- 'PrimitiveTypeEditPart',
- 'ProtocolStateMachineEditPart',
- 'SignalEditPart',
- 'SignalEventEditPart',
- 'StateMachineEditPart',
- 'StringExpressionEditPart',
- 'TimeConstraintEditPart',
- 'TimeEventEditPart',
- 'TimeExpressionEditPart',
- 'TimeIntervalEditPart',
- 'TimeObservationEditPart',
- 'UseCaseEditPart'
- ]
- elementTypesDropTests += #[
- 'ClassEditPart',
- 'ActivityEditPart',
- 'ActorEditPart',
- 'AnyReceiveEventEditPart',
- 'ArtifactEditPart',
- 'CallEventEditPart',
- 'ChangeEventEditPart',
- 'ClassEditPart',
- 'CollaborationEditPart',
- 'CommentEditPart',
- 'ComponentEditPart',
- 'ConstraintEditPart',
- 'DataTypeEditPart',
- 'DeploymentSpecificationEditPart',
- 'DeviceEditPart',
- 'DurationEditPart',
- 'DurationConstraintEditPart',
- 'DurationIntervalEditPart',
- 'DurationObservationEditPart',
- 'EnumerationEditPart',
- 'ExecutionEnvironmentEditPart',
- 'ExpressionEditPart',
- 'FunctionBehaviorEditPart',
- 'InformationItemEditPart',
- 'InstanceValueEditPart',
- 'InteractionEditPart',
- 'InteractionConstraintEditPart',
- 'InterfaceEditPart',
- 'IntervalEditPart',
- 'IntervalConstraintEditPart',
- 'LiteralBooleanEditPart',
- 'LiteralIntegerEditPart',
- 'LiteralNullEditPart',
- 'LiteralStringEditPart',
- 'LiteralUnlimitedNaturalEditPart',
- 'NodeEditPart',
- 'OpaqueBehaviorEditPart',
- 'OpaqueExpressionEditPart',
- 'PrimitiveTypeEditPart',
- 'ProtocolStateMachineEditPart',
- 'SignalEditPart',
- 'SignalEventEditPart',
- 'StateMachineEditPart',
- 'StringExpressionEditPart',
- 'TimeConstraintEditPart',
- 'TimeEventEditPart',
- 'TimeExpressionEditPart',
- 'TimeIntervalEditPart',
- 'TimeObservationEditPart',
- 'UseCaseEditPart'
- ]
-
- // Nonconformant API names for this diagram
- diagramCreationCommand = 'CreateCompositeDiagramCommand';
- testConstantsInterface = 'ICompositeDiagramTestsConstants';
]
]
- workflow.run(new WorkflowContextImpl);
+ except [
+ editPart [
+ kind = interactive
+ reason = 'Pops up a dialog to configure the element.'
+ editPart = named('CollaborationRoleEditPartCN')
+ ]
+ ]
+
+ run(new WorkflowContextImpl);
}
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend
index 0f3f9a7c23c..337066be26f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/generation/SequenceDiagramGenerateTestsWorkflow.xtend
@@ -26,13 +26,13 @@ class SequenceDiagramGenerateTestsWorkflow {
runWorkflow(workflow);
}
- def static void runWorkflow(GenerateTestsWorkflow workflow) {
- workflow.testProjectName = 'org.eclipse.papyrus.uml.diagram.sequence.tests'
- workflow.gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen')
- workflow.testSrcGenLocation = 'test-gen/'
- workflow.testModel = 'model/SequenceDiagramTest.uml'
+ def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
+ testProjectName = 'org.eclipse.papyrus.uml.diagram.sequence.tests'
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.sequence/model/sequenceDiagram.gmfgen')
+ testSrcGenLocation = 'test-gen/'
+ testModel = 'model/SequenceDiagramTest.uml'
- workflow.utpModuleFunction = [gmfgen, framework, utp |
+ utpModuleFunction = [gmfgen, framework, utp |
new GMFGen2UTPModule(gmfgen, framework, utp) => [
diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.sequence.test'
topContainerEditPart = 'InteractionEditPart'
@@ -92,7 +92,7 @@ class SequenceDiagramGenerateTestsWorkflow {
]
]
- workflow.run(new WorkflowContextImpl);
+ run(new WorkflowContextImpl);
}
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend
new file mode 100644
index 00000000000..cd0016357b5
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomCommonTemplate.xtend
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Christian W. Damus 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:
+ * Christian W. Damus - Initial API and implementation
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation
+
+import javax.inject.Singleton
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate
+
+/**
+ * Common utilities for the state machine custom model-to-text templates.
+ */
+ @Singleton
+class CustomCommonTemplate extends TestNodeTemplate {
+ def smUtils() {
+ 'org.eclipse.papyrus.uml.diagram.statemachine.tests.generation.StateMachineDiagramGeneratedTestsUtil'.imported
+ }
+
+ def customGetContainerEditPart() '''
+ @Override
+ protected «'org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart'.imported» getContainerEditPart() {
+ return «smUtils».resolveTopRegionCompartment(super.getContainerEditPart());
+ }
+ '''
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend
new file mode 100644
index 00000000000..8199f52e7ac
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomSynchronizationTestTemplate.xtend
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, 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:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 464647
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation
+
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.SynchronizationTestTemplate
+import org.eclipse.uml2.uml.Class
+
+/**
+ * Template for the test class for model-view synchronization tests.
+ */
+class CustomSynchronizationTestTemplate extends SynchronizationTestTemplate {
+ override additionalMethods(Class class_) '''
+ «super.additionalMethods(class_)»
+
+ «class_.customCreateSemanticElement»
+ '''
+
+ def customCreateSemanticElement(Class class_) '''
+ @Override
+ protected «'org.eclipse.emf.ecore.EObject'.imported» createSemanticElement(«'org.eclipse.gmf.runtime.emf.type.core.IElementType'.imported» elementType, EObject container) {
+ if (elementType.equals(«class_.umlElementTypes».StateMachine_2000)) {
+ // Return the already existing state machine
+ return container;
+ }
+
+ if (container instanceof «'org.eclipse.uml2.uml.StateMachine'.imported») {
+ // Create the element in the first region, instead, unless it's a region that we're creating
+ if (!elementType.getId().contains(".Region")) {
+ container = ((StateMachine) container).getRegions().get(0);
+ }
+ }
+
+ return super.createSemanticElement(elementType, container);
+ }
+ '''
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend
new file mode 100644
index 00000000000..b87439e95ea
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestLinkTemplate.xtend
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, 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:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 464647
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation
+
+import javax.inject.Inject
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestLinkTemplate
+import org.eclipse.uml2.uml.Class
+
+/**
+ * Template for the test class for creation of a link edit-part.
+ */
+class CustomTestLinkTemplate extends TestLinkTemplate {
+ @Inject extension CustomCommonTemplate
+
+ override additionalMethods(Class class_) '''
+ «super.additionalMethods(class_)»
+
+ «customGetContainerEditPart»
+ '''
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend
new file mode 100644
index 00000000000..160f55c6e63
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/CustomTestNodeTemplate.xtend
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 CEA LIST, Christian W. Damus, 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:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 464647
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation
+
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate
+import org.eclipse.uml2.uml.Class
+import javax.inject.Inject
+
+/**
+ * Template for the test class for creation of a top-node edit-part.
+ */
+class CustomTestNodeTemplate extends TestNodeTemplate {
+ @Inject extension CustomCommonTemplate
+
+ override additionalMethods(Class class_) '''
+ «super.additionalMethods(class_)»
+
+ «customGetContainerEditPart»
+ '''
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend
index ff1707457d6..aa69913e344 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGenerateTestsWorkflow.xtend
@@ -15,6 +15,10 @@ package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation
import org.eclipse.emf.mwe2.runtime.workflow.WorkflowContextImpl
import org.eclipse.papyrus.tests.framework.mwe.GenerateTestsWorkflow
import org.eclipse.papyrus.tests.framework.gmfgenuml2utp.GMFGen2UTPModule
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestNodeTemplate
+import org.eclipse.papyrus.tests.framework.m2t.xtend.CodeGeneratorModule
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.TestLinkTemplate
+import org.eclipse.papyrus.tests.framework.m2t.xtend.templates.SynchronizationTestTemplate
/**
* Xtend program for the generation of the State Machine Diagram tests.
@@ -26,75 +30,29 @@ class StateMachineDiagramGenerateTestsWorkflow {
runWorkflow(workflow);
}
- def static void runWorkflow(GenerateTestsWorkflow workflow) {
- workflow.testProjectName = 'org.eclipse.papyrus.uml.diagram.statemachine.tests'
- workflow.gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen')
- workflow.testSrcGenLocation = 'test-gen/'
- workflow.testModel = 'model/StateMachineDiagramTest.uml'
+ def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
+ testProjectName = 'org.eclipse.papyrus.uml.diagram.statemachine.tests'
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.statemachine/model/stateMachineDiagram.gmfgen')
+ testSrcGenLocation = 'test-gen/'
+ testModel = 'model/StateMachineDiagramTest.uml'
- workflow.utpModuleFunction = [gmfgen, framework, utp |
+ utpModuleFunction = [gmfgen, framework, utp |
new GMFGen2UTPModule(gmfgen, framework, utp) => [
diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.statemachine.test'
topContainerEditPart = 'StateMachineEditPart';
- topNodesToTest += #[
- 'StateMachineEditPart'
- ]
- childNodesToTest += #[
- 'RegionEditPart',
- 'FinalStateEditPart',
- 'StateEditPart',
- 'PseudostateInitialEditPart',
- 'PseudostateJoinEditPart',
- 'PseudostateForkEditPart',
- 'PseudostateChoiceEditPart',
- 'PseudostateJunctionEditPart',
- 'PseudostateShallowHistoryEditPart',
- 'PseudostateDeepHistoryEditPart',
- 'PseudostateTerminateEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
- linksToTest += #[
- 'TransitionEditPart'
- ]
- linksOwnedBySourceToTest += #[
- 'GeneralizationEditPart'
- ]
- elementTypesAppearanceTests += #[
- 'RegionEditPart',
- 'FinalStateEditPart',
- 'StateEditPart',
- 'PseudostateInitialEditPart',
- 'PseudostateJoinEditPart',
- 'PseudostateForkEditPart',
- 'PseudostateChoiceEditPart',
- 'PseudostateJunctionEditPart',
- 'PseudostateShallowHistoryEditPart',
- 'PseudostateDeepHistoryEditPart',
- 'PseudostateTerminateEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
- elementTypesDropTests += #[
- 'StateMachineEditPart',
- 'RegionEditPart',
- 'FinalStateEditPart',
- 'StateEditPart',
- 'PseudostateInitialEditPart',
- 'PseudostateJoinEditPart',
- 'PseudostateForkEditPart',
- 'PseudostateChoiceEditPart',
- 'PseudostateJunctionEditPart',
- 'PseudostateShallowHistoryEditPart',
- 'PseudostateDeepHistoryEditPart',
- 'PseudostateTerminateEditPart',
- 'CommentEditPart',
- 'ConstraintEditPart'
- ]
]
]
- workflow.run(new WorkflowContextImpl);
+ // Custom code generation templates
+ codegenModuleSupplier = [new CodeGeneratorModule {
+ override protected bindTestNodeTemplate() {
+ bind(TestNodeTemplate).to(CustomTestNodeTemplate)
+ bind(TestLinkTemplate).to(CustomTestLinkTemplate)
+ bind(SynchronizationTestTemplate).to(CustomSynchronizationTestTemplate)
+ }
+ }]
+
+ run(new WorkflowContextImpl);
}
}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java
new file mode 100644
index 00000000000..db9881c4e9c
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine.tests/src/org/eclipse/papyrus/uml/diagram/statemachine/tests/generation/StateMachineDiagramGeneratedTestsUtil.java
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST 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:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.statemachine.tests.generation;
+
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
+import org.eclipse.uml2.uml.Region;
+import org.eclipse.uml2.uml.StateMachine;
+
+import com.google.common.collect.Iterables;
+
+/**
+ * Utility APIs for the customizations in the generated State Machine Diagram tests.
+ */
+public class StateMachineDiagramGeneratedTestsUtil {
+
+ private StateMachineDiagramGeneratedTestsUtil() {
+ super();
+ }
+
+ /**
+ * Resolves the actual container edit part in which we want to create children, which
+ * is the first region's shape compartment if the given {@code container} is actually
+ * the state machine edit part or its (regions) shape compartment.
+ *
+ * @param container
+ * a container edit part
+ * @return the resolved preferred container, which may just be the same {@code container}
+ */
+ public static IGraphicalEditPart resolveTopRegionCompartment(IGraphicalEditPart container) {
+ IGraphicalEditPart result = container;
+
+ if (result.resolveSemanticElement() instanceof StateMachine) {
+ // Find the regions compartment
+ result = getShapeCompartment(result);
+
+ // Find the region in the state machine compartment
+ result = getFirstGraphicalChild(result);
+
+ if (result.resolveSemanticElement() instanceof Region) {
+ // Find the region compartment
+ result = getShapeCompartment(result);
+ }
+ }
+
+ return result;
+ }
+
+ public static IGraphicalEditPart getShapeCompartment(IGraphicalEditPart editPart) {
+ IGraphicalEditPart result = editPart;
+
+ if (!(result instanceof ShapeCompartmentEditPart)) {
+ // Find the regions compartment
+ for (ShapeCompartmentEditPart next : Iterables.filter(result.getChildren(), ShapeCompartmentEditPart.class)) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ public static IGraphicalEditPart getFirstGraphicalChild(IGraphicalEditPart editPart) {
+ IGraphicalEditPart result = editPart;
+
+ for (IGraphicalEditPart next : Iterables.filter(result.getChildren(), IGraphicalEditPart.class)) {
+ result = next;
+ break;
+ }
+
+ return result;
+ }
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/synchronization/AbstractSynchronizationTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/synchronization/AbstractSynchronizationTest.java
index ed20c3b4e3e..80b0096eb42 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/synchronization/AbstractSynchronizationTest.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.tests/src/org/eclipse/papyrus/uml/diagram/tests/synchronization/AbstractSynchronizationTest.java
@@ -251,6 +251,10 @@ public abstract class AbstractSynchronizationTest extends AbstractPapyrusTestCas
if (UMLPackage.Literals.BEHAVIOR.isSuperTypeOf(elementType.getEClass()) && (container.eContainer() == null)) {
result = (EObject) EcoreUtil.getObjectByType(container.eContents(), elementType.getEClass());
}
+ // Also, we don't nest behaviors
+ if (UMLPackage.Literals.BEHAVIOR.isSuperTypeOf(elementType.getEClass()) && (elementType.getEClass().isInstance(container))) {
+ result = container;
+ }
if (result == null) {
IElementEditService edit = ElementEditServiceUtils.getCommandProvider(container);
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend
index dd1f05d5db0..6a687e98e60 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generation/TimingDiagramGenerateTestsWorkflow.xtend
@@ -26,13 +26,13 @@ class TimingDiagramGenerateTestsWorkflow {
runWorkflow(workflow);
}
- def static void runWorkflow(GenerateTestsWorkflow workflow) {
- workflow.testProjectName = 'org.eclipse.papyrus.uml.diagram.timing.tests'
- workflow.gmfgenUri = workflow.resourceURI('/org.eclipse.papyrus.uml.diagram.timing/model/timingdiagram.gmfgen')
- workflow.testSrcGenLocation = 'test-gen/'
- workflow.testModel = 'model/TimingDiagramTest.uml'
+ def static void runWorkflow(extension GenerateTestsWorkflow workflow) {
+ testProjectName = 'org.eclipse.papyrus.uml.diagram.timing.tests'
+ gmfgenUri = resourceURI('/org.eclipse.papyrus.uml.diagram.timing/model/timingdiagram.gmfgen')
+ testSrcGenLocation = 'test-gen/'
+ testModel = 'model/TimingDiagramTest.uml'
- workflow.utpModuleFunction = [gmfgen, framework, utp |
+ utpModuleFunction = [gmfgen, framework, utp |
new GMFGen2UTPModule(gmfgen, framework, utp) => [
diagramTestPackageName = 'org.eclipse.papyrus.uml.diagram.timing.test'
topContainerEditPart = 'InteractionEditPartTN';
@@ -88,7 +88,7 @@ class TimingDiagramGenerateTestsWorkflow {
]
]
- workflow.run(new WorkflowContextImpl);
+ run(new WorkflowContextImpl);
}
}

Back to the top