Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2013-01-03 16:13:29 +0000
committerrschnekenbu2013-01-03 16:13:29 +0000
commit590dfc0a25407fe5bb174a9f69af89fb89b9d274 (patch)
tree69fd9ad3ebe302d383c3daf032129b53a5efe6a5 /incoming
parente04a590deb67c2fe0ae01ed7eb2a34004e73b6a1 (diff)
downloadorg.eclipse.papyrus-590dfc0a25407fe5bb174a9f69af89fb89b9d274.tar.gz
org.eclipse.papyrus-590dfc0a25407fe5bb174a9f69af89fb89b9d274.tar.xz
org.eclipse.papyrus-590dfc0a25407fe5bb174a9f69af89fb89b9d274.zip
Share project "org.eclipse.papyrus.uml.diagram.timing.tests" into "svn+ssh://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papyrus"
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath7
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore1
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project28
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.core.prefs375
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.ui.prefs109
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF22
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt70
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties12
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch44
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java64
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java25
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java620
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java36
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java98
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java332
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java237
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java98
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java46
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java290
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java119
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java79
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java226
-rw-r--r--incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java1094
24 files changed, 4084 insertions, 0 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore
new file mode 100644
index 00000000000..e660fd93d31
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.gitignore
@@ -0,0 +1 @@
+bin/
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project
new file mode 100644
index 00000000000..ea314acb35c
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.diagram.timing.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.core.prefs b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..d170c949df8
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,375 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=160
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.ui.prefs b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..ee74f5637be
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,109 @@
+cleanup.add_default_serial_version_id=false
+cleanup.add_generated_serial_version_id=true
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=false
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=true
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.correct_indentation=false
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=true
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_Cleanup
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Formatter
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=true
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=true
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..73d6e519b34
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Papyrus Timing Diagram Tests (Incubation)
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.timing.tests
+Bundle-Version: 0.10.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.timing.tests.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit4;bundle-version="4.8.1",
+ org.eclipse.papyrus.infra.core;bundle-version="0.9.0",
+ org.eclipse.papyrus.editor;bundle-version="0.9.0",
+ org.eclipse.papyrus.uml.diagram.timing;bundle-version="0.9.0",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.1",
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.0",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: Eclipse Modeling Project
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt
new file mode 100644
index 00000000000..dd867480403
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/TODO.txt
@@ -0,0 +1,70 @@
+remaining tests to write:
+- check that full state invariants are positioned in front of their state definition
+- test deleting a full state invariant (check that related time elements and general orderings are deleted)
+- test hiding a full state invariant (check that related time elements and general orderings are hidden)
+- test hiding an occurrence specification in a full lifeline
+- test that moving a vertical line moves the preceding occurrence specification
+- check that related time elements and general orderings are deleted when deleting a compact occurrence specification
+- check that related time elements and general orderings are deleted when deleting a compact state invariant
+- test hiding a compact occurrence specification (check that related elements are hidden)
+- check that fragment names are updated when changing a state definition name
+- check that vertical lines cannot be deleted
+- test model consistency when modifying the model from the Model Explorer (delete, rename, ...)
+- test reordering Lifelines through drag&drop inside the interaction
+- test reordering state definitions through drag&drop inside the state definition compartment
+- test creating sync/async/reply Messages (check that OccurrenceSpecifications are converted to MessageOccurrenceSpecifications on the fly)
+- test deleting a MessageOccurrenceSpecification (check that the associated Message is deleted)
+- test creating a lost message
+- test moving a lost message floating anchor
+- test creating a found message
+- test moving a found message floating anchor
+- test re-orienting sync/async/reply Messages
+- test re-orienting a create message: everything before the start occurrence must be deleted
+- test re-orienting a destroy message: everything after the destruction occurrence must be deleted
+- test re-orienting the source of a lost message
+- test re-orienting the target of a found message
+- test creating a Gate on the border of an Interaction
+- test renaming a Gate
+- test deleting a Gate (the associated Messages must be deleted)
+- test re-orienting a message from/to a Gate
+-
+
+- test creating a create message (full and compact): check that occurrences and state invariants before the start occurrence are deleted
+- check that time elements and general orderings are not deleted when creating a create message, unless their related element gets deleted
+- check that deleting the start occurrence (from a create message) restores the timeline to normal (full and compact): starting with a StateInvariant
+- check that deleting the state invariant immediately after a creation occurrence (that starts the timeline) also deletes the creation occurrence
+
+- test creating a delete message: check that a DestructionOccurrenceSpecification is created and that other occurrences and state invariants after it are deleted
+- check that time elements and general orderings are not deleted when adding a DestructionOccurrenceSpecification, unless their related element gets deleted
+- test creating a DestructionOccurrenceSpecification from the palette
+- test deleting a DestructionOccurrenceSpecification
+
+- test creating TimeObservations/TimeConstraints (on occurrence specifications and state invariants)
+- test renaming TimeObservations/TimeConstraints
+- test deleting TimeObservations/TimeConstraints
+- test that changing "firstEvent" on a TimeObservation/TimeConstraint moves the TimeObservation/TimeConstraint
+- test that TimeObservations and TimeConstraints have the same horizontal position as the element they are linked to
+- test creating DurationObservations/DurationConstraints (on occurrence specifications and state invariants)
+- test creating DurationObservation/DurationConstraint from a state invariant to the same state invariant
+- test renaming DurationObservations/DurationConstraints
+- test deleting DurationObservations/DurationConstraints
+- test that a DurationObservation/DurationConstraint on the last StateInvariant is properly positioned
+- test that a DurationObservation/DurationConstraint on a StateInvariant is reconnected to the new StateInvariant when cutting the first StateInvariant in two (not yet implemented)
+- test that DurationObservations/DurationConstraints have the correct horizontal position and size considering the elements they are linked to
+- same thing, on a compact state with occurrences on top of it
+- test that in the presence of a DestructionOccurrenceSpecification, DurationObservations/DurationConstraints on the last state end on this DestructionOccurrenceSpecification
+- test creating a general ordering
+- test renaming a general ordering
+- test deleting a general ordering
+
+
+- test dropping lifelines with their covering fragments
+- test dropping messages (sync/async/reply/create/delete/lost/found)
+- test dropping TimeObservation, TimeConstraint, DurationObservation, DurationConstraint
+- test dropping GeneralOrdering
+- test dropping Gate
+- test dropping non-valid models (to check that validation fixes the model)
+
+- test stereotypes
+- test switching between full and compact lifelines
+- test that what works with OccurrenceSpecifications (moving, hiding, deleting, etc.) also works with MessageOccurrenceSpecifications and DestructionOccurrenceSpecifications \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties
new file mode 100644
index 00000000000..6b5ca9799a6
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/build.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2012 CEA LIST.
+#
+# 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch
new file mode 100644
index 00000000000..2bf8a9f5fd3
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/org.eclipse.papyrus.uml.diagram.timing.tests.launch
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.uml.diagram.timing.tests.AllTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.uml.diagram.timing.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m&#13;&#10;-Xmx1024m&#13;&#10;-XX:PermSize=256M&#13;&#10;-XX:MaxPermSize=512M"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="false"/>
+<stringAttribute key="selected_target_plugins" value="com.google.gson@default:default,com.google.guava@default:default,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.sun.el@default:default,com.sun.syndication@default:default,com.sun.xml.bind@default:default,javax.activation@default:default,javax.annotation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.xml.bind@default:default,javax.xml.stream@default:default,javax.xml@default:default,lpg.runtime.java@default:default,net.sourceforge.nattable.core@default:default,org.antlr.runtime@default:default,org.apache.ant@default:default,org.apache.batik.bridge@default:default,org.apache.batik.css@default:default,org.apache.batik.dom.svg@default:default,org.apache.batik.dom@default:default,org.apache.batik.ext.awt@default:default,org.apache.batik.parser@default:default,org.apache.batik.pdf@default:default,org.apache.batik.svggen@default:default,org.apache.batik.transcoder@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.batik.xml@default:default,org.apache.commons.cli@default:default,org.apache.commons.codec@default:default,org.apache.commons.httpclient@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.jasper.glassfish@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.apache.ws.commons.util@default:default,org.apache.xerces@default:default,org.apache.xml.resolver@default:default,org.apache.xml.serializer@default:default,org.apache.xmlrpc@default:default,org.eclipse.amalgam.discovery.core@default:default,org.eclipse.amalgam.discovery.modeling@default:default,org.eclipse.amalgam.discovery.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.ant.launching@default:default,org.eclipse.ant.ui@default:default,org.eclipse.compare.core@default:default,org.eclipse.compare.win32@default:default,org.eclipse.compare@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.externaltools@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.win32.x86@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.win32.x86@default:default,org.eclipse.core.net@default:default,org.eclipse.core.resources.win32.x86@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime.compatibility@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.cvs@default:default,org.eclipse.debug.core@default:default,org.eclipse.debug.ui@default:default,org.eclipse.draw2d.doc.isv@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.provider.filetransfer.httpclient.ssl@default:default,org.eclipse.ecf.provider.filetransfer.httpclient@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:default,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.ssl@default:default,org.eclipse.ecf@default:default,org.eclipse.egit.core@default:default,org.eclipse.egit.doc@default:default,org.eclipse.egit.import@default:default,org.eclipse.egit.mylyn.ui@default:default,org.eclipse.egit.ui@default:default,org.eclipse.egit@default:default,org.eclipse.emf.ant@default:default,org.eclipse.emf.cheatsheets@default:default,org.eclipse.emf.codegen.ecore.ui@default:default,org.eclipse.emf.codegen.ecore@default:default,org.eclipse.emf.codegen.ui@default:default,org.eclipse.emf.codegen@default:default,org.eclipse.emf.common.ui@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.converter@default:default,org.eclipse.emf.databinding.edit@default:default,org.eclipse.emf.databinding@default:default,org.eclipse.emf.doc@default:default,org.eclipse.emf.ecore.change.edit@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.edit@default:default,org.eclipse.emf.ecore.editor@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.emf.edit.ui@default:default,org.eclipse.emf.edit@default:default,org.eclipse.emf.example.installer@default:default,org.eclipse.emf.exporter@default:default,org.eclipse.emf.facet.aggregate.doc@default:default,org.eclipse.emf.facet.aggregate.metamodel.notgenerated@default:default,org.eclipse.emf.facet.aggregate.metamodel@default:default,org.eclipse.emf.facet.capabilities@default:default,org.eclipse.emf.facet.common.core@default:default,org.eclipse.emf.facet.common.sdk.core@default:default,org.eclipse.emf.facet.common.sdk.ui@default:default,org.eclipse.emf.facet.common.ui@default:default,org.eclipse.emf.facet.custom.core@default:default,org.eclipse.emf.facet.custom.doc@default:default,org.eclipse.emf.facet.custom.metamodel.edit@default:default,org.eclipse.emf.facet.custom.metamodel.editor@default:default,org.eclipse.emf.facet.custom.metamodel@default:default,org.eclipse.emf.facet.custom.sdk.core@default:default,org.eclipse.emf.facet.custom.sdk.ui@default:default,org.eclipse.emf.facet.custom.ui@default:default,org.eclipse.emf.facet.doc@default:default,org.eclipse.emf.facet.ecore@default:default,org.eclipse.emf.facet.efacet.catalog@default:default,org.eclipse.emf.facet.efacet.core@default:default,org.eclipse.emf.facet.efacet.doc@default:default,org.eclipse.emf.facet.efacet.edit@default:default,org.eclipse.emf.facet.efacet.editor@default:default,org.eclipse.emf.facet.efacet.examples.library.core@default:default,org.eclipse.emf.facet.efacet.examples.library.metamodel.edit@default:default,org.eclipse.emf.facet.efacet.examples.library.metamodel@default:default,org.eclipse.emf.facet.efacet.metamodel.edit@default:default,org.eclipse.emf.facet.efacet.metamodel.editor@default:default,org.eclipse.emf.facet.efacet.metamodel@default:default,org.eclipse.emf.facet.efacet.sdk.ui@default:default,org.eclipse.emf.facet.efacet.ui@default:default,org.eclipse.emf.facet.efacet@default:default,org.eclipse.emf.facet.infra.browser.custom.core@default:default,org.eclipse.emf.facet.infra.browser.custom.edit@default:default,org.eclipse.emf.facet.infra.browser.custom.editor@default:default,org.eclipse.emf.facet.infra.browser.custom.examples.uml@default:default,org.eclipse.emf.facet.infra.browser.custom.ui@default:default,org.eclipse.emf.facet.infra.browser.custom@default:default,org.eclipse.emf.facet.infra.browser.doc@default:default,org.eclipse.emf.facet.infra.browser.uicore.examples.cnf@default:default,org.eclipse.emf.facet.infra.browser.uicore@default:default,org.eclipse.emf.facet.infra.browser@default:default,org.eclipse.emf.facet.infra.common.core@default:default,org.eclipse.emf.facet.infra.common.ui@default:default,org.eclipse.emf.facet.infra.facet.core@default:default,org.eclipse.emf.facet.infra.facet.edit@default:default,org.eclipse.emf.facet.infra.facet.editor@default:default,org.eclipse.emf.facet.infra.facet.ui@default:default,org.eclipse.emf.facet.infra.facet@default:default,org.eclipse.emf.facet.infra.query.core@default:default,org.eclipse.emf.facet.infra.query.edit@default:default,org.eclipse.emf.facet.infra.query.editor@default:default,org.eclipse.emf.facet.infra.query.ui@default:default,org.eclipse.emf.facet.infra.query@default:default,org.eclipse.emf.facet.query.java.core@default:default,org.eclipse.emf.facet.query.java.metamodel@default:default,org.eclipse.emf.facet.query.java.sdk.ui@default:default,org.eclipse.emf.facet.query.java.ui@default:default,org.eclipse.emf.facet.query.java@default:default,org.eclipse.emf.facet.query.ocl.core@default:default,org.eclipse.emf.facet.query.ocl.metamodel@default:default,org.eclipse.emf.facet.query.ocl.sdk.ui@default:default,org.eclipse.emf.facet.util.core@default:default,org.eclipse.emf.facet.util.emf.catalog@default:default,org.eclipse.emf.facet.util.emf.core@default:default,org.eclipse.emf.facet.util.emf.doc@default:default,org.eclipse.emf.facet.util.emf.ui@default:default,org.eclipse.emf.facet.util.ui@default:default,org.eclipse.emf.facet.widgets.celleditors.ecore.tests.samplemm@default:default,org.eclipse.emf.facet.widgets.celleditors.ecore@default:default,org.eclipse.emf.facet.widgets.celleditors.edit@default:default,org.eclipse.emf.facet.widgets.celleditors.editor@default:default,org.eclipse.emf.facet.widgets.celleditors@default:default,org.eclipse.emf.facet.widgets.nattable.doc@default:default,org.eclipse.emf.facet.widgets.nattable.examples.ecore@default:default,org.eclipse.emf.facet.widgets.nattable.instance.edit@default:default,org.eclipse.emf.facet.widgets.nattable.instance@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration.edit@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration.editor@default:default,org.eclipse.emf.facet.widgets.nattable.tableconfiguration@default:default,org.eclipse.emf.facet.widgets.nattable.workbench@default:default,org.eclipse.emf.facet.widgets.nattable@default:default,org.eclipse.emf.facet.widgets.table.doc@default:default,org.eclipse.emf.facet.widgets.table.examples.library.core@default:default,org.eclipse.emf.facet.widgets.table.metamodel.edit@default:default,org.eclipse.emf.facet.widgets.table.metamodel@default:default,org.eclipse.emf.facet.widgets.table.ui.nattable@default:default,org.eclipse.emf.facet.widgets.table.ui.workbench@default:default,org.eclipse.emf.facet.widgets.table.ui@default:default,org.eclipse.emf.facet.widgets@default:default,org.eclipse.emf.generic.editor@default:default,org.eclipse.emf.importer.ecore@default:default,org.eclipse.emf.importer.java@default:default,org.eclipse.emf.importer.rose@default:default,org.eclipse.emf.importer@default:default,org.eclipse.emf.mapping.ecore.editor@default:default,org.eclipse.emf.mapping.ecore2ecore.editor@default:default,org.eclipse.emf.mapping.ecore2ecore@default:default,org.eclipse.emf.mapping.ecore2xml.ui@default:default,org.eclipse.emf.mapping.ecore2xml@default:default,org.eclipse.emf.mapping.ecore@default:default,org.eclipse.emf.mapping.ui@default:default,org.eclipse.emf.mapping@default:default,org.eclipse.emf.mwe.core@default:default,org.eclipse.emf.mwe.ui@default:default,org.eclipse.emf.mwe.utils@default:default,org.eclipse.emf.mwe2.language.ui@default:default,org.eclipse.emf.mwe2.language@default:default,org.eclipse.emf.mwe2.launch@default:default,org.eclipse.emf.mwe2.lib@default:default,org.eclipse.emf.mwe2.runtime@default:default,org.eclipse.emf.query.doc@default:default,org.eclipse.emf.query.examples@default:default,org.eclipse.emf.query.ocl@default:default,org.eclipse.emf.query@default:default,org.eclipse.emf.transaction.doc@default:default,org.eclipse.emf.transaction.examples@default:default,org.eclipse.emf.transaction.ui@default:default,org.eclipse.emf.transaction@default:default,org.eclipse.emf.validation.doc@default:default,org.eclipse.emf.validation.examples@default:default,org.eclipse.emf.validation.ocl@default:default,org.eclipse.emf.validation.ui.ide@default:default,org.eclipse.emf.validation.ui@default:default,org.eclipse.emf.validation@default:default,org.eclipse.emf.workspace.doc@default:default,org.eclipse.emf.workspace.ui@default:default,org.eclipse.emf.workspace@default:default,org.eclipse.emf@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.console@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.director.app@default:default,org.eclipse.equinox.p2.director@default:default,org.eclipse.equinox.p2.directorywatcher@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.extensionlocation@default:default,org.eclipse.equinox.p2.garbagecollector@default:default,org.eclipse.equinox.p2.jarprocessor@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.operations@default:default,org.eclipse.equinox.p2.publisher.eclipse@default:default,org.eclipse.equinox.p2.publisher@default:default,org.eclipse.equinox.p2.ql@default:default,org.eclipse.equinox.p2.reconciler.dropins@default:default,org.eclipse.equinox.p2.repository.tools@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.touchpoint.eclipse@default:default,org.eclipse.equinox.p2.touchpoint.natives@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.p2.ui.importexport@default:default,org.eclipse.equinox.p2.ui.sdk.scheduler@default:default,org.eclipse.equinox.p2.ui.sdk@default:default,org.eclipse.equinox.p2.ui@default:default,org.eclipse.equinox.p2.updatechecker@default:default,org.eclipse.equinox.p2.updatesite@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.equinox.security.win32.x86@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.simpleconfigurator.manipulator@default:default,org.eclipse.equinox.simpleconfigurator@1:true,org.eclipse.equinox.util@default:default,org.eclipse.gef.doc.isv@default:default,org.eclipse.gef.examples.ui.pde@default:default,org.eclipse.gef@default:default,org.eclipse.gmf.bridge.trace@default:default,org.eclipse.gmf.bridge.ui.dashboard@default:default,org.eclipse.gmf.bridge.ui@default:default,org.eclipse.gmf.bridge@default:default,org.eclipse.gmf.codegen.edit@default:default,org.eclipse.gmf.codegen.ui@default:default,org.eclipse.gmf.codegen@default:default,org.eclipse.gmf.common@default:default,org.eclipse.gmf.doc.ui@default:default,org.eclipse.gmf.doc@default:default,org.eclipse.gmf.ecore.editor@default:default,org.eclipse.gmf.examples.runtime.ui.pde@default:default,org.eclipse.gmf.graphdef.codegen.ui@default:default,org.eclipse.gmf.graphdef.codegen@default:default,org.eclipse.gmf.graphdef.edit@default:default,org.eclipse.gmf.graphdef@default:default,org.eclipse.gmf.map.edit@default:default,org.eclipse.gmf.map@default:default,org.eclipse.gmf.runtime.common.core@default:default,org.eclipse.gmf.runtime.common.ui.action.ide@default:default,org.eclipse.gmf.runtime.common.ui.action@default:default,org.eclipse.gmf.runtime.common.ui.printing.win32@default:false,org.eclipse.gmf.runtime.common.ui.printing@default:default,org.eclipse.gmf.runtime.common.ui.services.action@default:default,org.eclipse.gmf.runtime.common.ui.services.dnd.ide@default:default,org.eclipse.gmf.runtime.common.ui.services.dnd@default:default,org.eclipse.gmf.runtime.common.ui.services.properties@default:default,org.eclipse.gmf.runtime.common.ui.services@default:default,org.eclipse.gmf.runtime.common.ui@default:default,org.eclipse.gmf.runtime.diagram.core@default:default,org.eclipse.gmf.runtime.diagram.ui.actions@default:default,org.eclipse.gmf.runtime.diagram.ui.dnd@default:default,org.eclipse.gmf.runtime.diagram.ui.geoshapes@default:default,org.eclipse.gmf.runtime.diagram.ui.printing.render@default:default,org.eclipse.gmf.runtime.diagram.ui.printing@default:default,org.eclipse.gmf.runtime.diagram.ui.properties@default:default,org.eclipse.gmf.runtime.diagram.ui.providers.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.providers@default:default,org.eclipse.gmf.runtime.diagram.ui.render@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide@default:default,org.eclipse.gmf.runtime.diagram.ui.resources.editor@default:default,org.eclipse.gmf.runtime.diagram.ui@default:default,org.eclipse.gmf.runtime.draw2d.ui.render.awt@default:default,org.eclipse.gmf.runtime.draw2d.ui.render@default:default,org.eclipse.gmf.runtime.draw2d.ui@default:default,org.eclipse.gmf.runtime.emf.clipboard.core@default:default,org.eclipse.gmf.runtime.emf.commands.core@default:default,org.eclipse.gmf.runtime.emf.core@default:default,org.eclipse.gmf.runtime.emf.type.core@default:default,org.eclipse.gmf.runtime.emf.type.ui@default:default,org.eclipse.gmf.runtime.emf.ui.properties@default:default,org.eclipse.gmf.runtime.emf.ui@default:default,org.eclipse.gmf.runtime.gef.ui@default:default,org.eclipse.gmf.runtime.notation.edit@default:default,org.eclipse.gmf.runtime.notation.providers@default:default,org.eclipse.gmf.runtime.notation.sdk@default:default,org.eclipse.gmf.runtime.notation@default:default,org.eclipse.gmf.runtime.sdk@default:default,org.eclipse.gmf.sdk@default:default,org.eclipse.gmf.tooldef.edit@default:default,org.eclipse.gmf.tooldef@default:default,org.eclipse.gmf.tooling.runtime@default:default,org.eclipse.gmf.tooling@default:default,org.eclipse.gmf.validate@default:default,org.eclipse.gmf.xpand.editor@default:default,org.eclipse.gmf.xpand.qvtlibrary@default:default,org.eclipse.gmf.xpand@default:default,org.eclipse.gmf@default:default,org.eclipse.gmt.modisco.infra.common.core@default:default,org.eclipse.gmt.modisco.infra.common.ui@default:default,org.eclipse.gmt.modisco.infra.discoverymanager@default:default,org.eclipse.gmt.modisco.xml.discoverer@default:default,org.eclipse.gmt.modisco.xml@default:default,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help.webapp@default:default,org.eclipse.help@default:default,org.eclipse.jdt.annotation@default:default,org.eclipse.jdt.apt.core@default:default,org.eclipse.jdt.apt.pluggable.core@default:default,org.eclipse.jdt.apt.ui@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.jdt.compiler.tool@default:false,org.eclipse.jdt.core.manipulation@default:default,org.eclipse.jdt.core@default:default,org.eclipse.jdt.debug.ui@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.jdt.doc.isv@default:default,org.eclipse.jdt.doc.user@default:default,org.eclipse.jdt.junit.core@default:default,org.eclipse.jdt.junit.runtime@default:default,org.eclipse.jdt.junit4.runtime@default:default,org.eclipse.jdt.junit@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.jdt.ui@default:default,org.eclipse.jdt@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jgit@default:default,org.eclipse.jsch.core@default:default,org.eclipse.jsch.ui@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.eclipse.m2m.qvt.oml.common.ui@default:default,org.eclipse.m2m.qvt.oml.common@default:default,org.eclipse.m2m.qvt.oml.cst.parser@default:default,org.eclipse.m2m.qvt.oml.debug.core@default:default,org.eclipse.m2m.qvt.oml.debug.ui@default:default,org.eclipse.m2m.qvt.oml.doc@default:default,org.eclipse.m2m.qvt.oml.ecore.imperativeocl@default:default,org.eclipse.m2m.qvt.oml.editor.ui@default:default,org.eclipse.m2m.qvt.oml.emf.util.ui@default:default,org.eclipse.m2m.qvt.oml.emf.util@default:default,org.eclipse.m2m.qvt.oml.ocl@default:default,org.eclipse.m2m.qvt.oml.project@default:default,org.eclipse.m2m.qvt.oml.runtime.ui@default:default,org.eclipse.m2m.qvt.oml.runtime@default:default,org.eclipse.m2m.qvt.oml.samples@default:default,org.eclipse.m2m.qvt.oml.trace.edit@default:default,org.eclipse.m2m.qvt.oml.ui@default:default,org.eclipse.m2m.qvt.oml@default:default,org.eclipse.modisco.infra.discovery.core@default:default,org.eclipse.modisco.infra.discovery.ui@default:default,org.eclipse.modisco.infra.discovery@default:default,org.eclipse.modisco.xml.discoverer@default:default,org.eclipse.mylyn.bugzilla.core@default:default,org.eclipse.mylyn.bugzilla.ide@default:default,org.eclipse.mylyn.bugzilla.ui@default:default,org.eclipse.mylyn.builds.core@default:default,org.eclipse.mylyn.builds.ui@default:default,org.eclipse.mylyn.commons.core@default:default,org.eclipse.mylyn.commons.identity.core@default:default,org.eclipse.mylyn.commons.identity@default:default,org.eclipse.mylyn.commons.net@default:default,org.eclipse.mylyn.commons.notifications.core@default:default,org.eclipse.mylyn.commons.notifications.feed@default:default,org.eclipse.mylyn.commons.notifications.ui@default:default,org.eclipse.mylyn.commons.notifications@default:default,org.eclipse.mylyn.commons.repositories.core@default:default,org.eclipse.mylyn.commons.repositories.http.core@default:default,org.eclipse.mylyn.commons.repositories.ui@default:default,org.eclipse.mylyn.commons.repositories@default:default,org.eclipse.mylyn.commons.screenshots@default:default,org.eclipse.mylyn.commons.team@default:default,org.eclipse.mylyn.commons.ui@default:default,org.eclipse.mylyn.commons.workbench@default:default,org.eclipse.mylyn.commons.xmlrpc@default:default,org.eclipse.mylyn.context.core@default:default,org.eclipse.mylyn.context.tasks.ui@default:default,org.eclipse.mylyn.context.ui@default:default,org.eclipse.mylyn.debug.ui@default:default,org.eclipse.mylyn.discovery.core@default:default,org.eclipse.mylyn.discovery.ui@default:default,org.eclipse.mylyn.help.ui@default:default,org.eclipse.mylyn.hudson.core@default:default,org.eclipse.mylyn.hudson.ui@default:default,org.eclipse.mylyn.ide.ant@default:default,org.eclipse.mylyn.ide.ui@default:default,org.eclipse.mylyn.java.tasks@default:default,org.eclipse.mylyn.java.ui@default:default,org.eclipse.mylyn.monitor.core@default:default,org.eclipse.mylyn.monitor.ui@default:default,org.eclipse.mylyn.pde.ui@default:default,org.eclipse.mylyn.resources.ui@default:default,org.eclipse.mylyn.tasks.bugs@default:default,org.eclipse.mylyn.tasks.core@default:default,org.eclipse.mylyn.tasks.index.core@default:default,org.eclipse.mylyn.tasks.index.ui@default:default,org.eclipse.mylyn.tasks.search@default:default,org.eclipse.mylyn.tasks.ui@default:default,org.eclipse.mylyn.team.cvs@default:default,org.eclipse.mylyn.team.ui@default:default,org.eclipse.mylyn.versions.core@default:default,org.eclipse.mylyn.versions.ui@default:default,org.eclipse.mylyn.wikitext.confluence.core@default:default,org.eclipse.mylyn.wikitext.confluence.ui@default:default,org.eclipse.mylyn.wikitext.core@default:default,org.eclipse.mylyn.wikitext.help.ui@default:default,org.eclipse.mylyn.wikitext.mediawiki.core@default:default,org.eclipse.mylyn.wikitext.mediawiki.ui@default:default,org.eclipse.mylyn.wikitext.tasks.ui@default:default,org.eclipse.mylyn.wikitext.textile.core@default:default,org.eclipse.mylyn.wikitext.textile.ui@default:default,org.eclipse.mylyn.wikitext.tracwiki.core@default:default,org.eclipse.mylyn.wikitext.tracwiki.ui@default:default,org.eclipse.mylyn.wikitext.twiki.core@default:default,org.eclipse.mylyn.wikitext.twiki.ui@default:default,org.eclipse.mylyn.wikitext.ui@default:default,org.eclipse.ocl.common.ui@default:default,org.eclipse.ocl.common@default:default,org.eclipse.ocl.doc@default:default,org.eclipse.ocl.ecore.edit@default:default,org.eclipse.ocl.ecore@default:default,org.eclipse.ocl.edit@default:default,org.eclipse.ocl.examples.common@default:default,org.eclipse.ocl.examples.domain@default:default,org.eclipse.ocl.examples.library@default:default,org.eclipse.ocl.examples.pivot@default:default,org.eclipse.ocl.examples.xtext.base@default:default,org.eclipse.ocl.examples.xtext.console@default:default,org.eclipse.ocl.examples.xtext.essentialocl.ui@default:default,org.eclipse.ocl.examples.xtext.essentialocl@default:default,org.eclipse.ocl.ui@default:default,org.eclipse.ocl.uml.edit@default:default,org.eclipse.ocl.uml.ui@default:default,org.eclipse.ocl.uml@default:default,org.eclipse.ocl@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi.util@default:default,org.eclipse.osgi@-1:true,org.eclipse.papyrus.customization.palette@default:default,org.eclipse.papyrus.customization.paletteconfiguration@default:default,org.eclipse.papyrus.customization.properties.generation@default:default,org.eclipse.papyrus.customization.properties.model.xwt@default:default,org.eclipse.papyrus.customization.properties@default:default,org.eclipse.papyrus.editor@default:default,org.eclipse.papyrus.extensionpoints.editors@default:default,org.eclipse.papyrus.infra.constraints.edit@default:default,org.eclipse.papyrus.infra.constraints.editor@default:default,org.eclipse.papyrus.infra.constraints@default:default,org.eclipse.papyrus.infra.core.log@default:default,org.eclipse.papyrus.infra.core.sasheditor.di@default:default,org.eclipse.papyrus.infra.core.sasheditor@default:default,org.eclipse.papyrus.infra.core@default:default,org.eclipse.papyrus.infra.discovery.ui.menu@default:default,org.eclipse.papyrus.infra.discovery.ui@default:default,org.eclipse.papyrus.infra.discovery@default:default,org.eclipse.papyrus.infra.emf.appearance@default:default,org.eclipse.papyrus.infra.emf.diagram.common@default:default,org.eclipse.papyrus.infra.emf.facet.queries@default:default,org.eclipse.papyrus.infra.emf.readonly@default:default,org.eclipse.papyrus.infra.emf@default:default,org.eclipse.papyrus.infra.export@default:default,org.eclipse.papyrus.infra.extendedtypes.emf@default:default,org.eclipse.papyrus.infra.extendedtypes@default:default,org.eclipse.papyrus.infra.gmfdiag.commands@default:default,org.eclipse.papyrus.infra.gmfdiag.common@default:default,org.eclipse.papyrus.infra.gmfdiag.css.model@default:default,org.eclipse.papyrus.infra.gmfdiag.dnd@default:default,org.eclipse.papyrus.infra.gmfdiag.hyperlink@default:default,org.eclipse.papyrus.infra.gmfdiag.modelexplorer@default:default,org.eclipse.papyrus.infra.gmfdiag.navigation@default:default,org.eclipse.papyrus.infra.gmfdiag.outline@default:default,org.eclipse.papyrus.infra.gmfdiag.preferences@default:default,org.eclipse.papyrus.infra.gmfdiag.properties@default:default,org.eclipse.papyrus.infra.gmfdiag.widgets@default:default,org.eclipse.papyrus.infra.hyperlink@default:default,org.eclipse.papyrus.infra.onefile@default:default,org.eclipse.papyrus.infra.queries.core.configuration.edit@default:default,org.eclipse.papyrus.infra.queries.core.configuration@default:default,org.eclipse.papyrus.infra.queries.core@default:default,org.eclipse.papyrus.infra.services.controlmode.history@default:default,org.eclipse.papyrus.infra.services.controlmode@default:default,org.eclipse.papyrus.infra.services.decoration@default:default,org.eclipse.papyrus.infra.services.edit@default:default,org.eclipse.papyrus.infra.services.labelprovider@default:default,org.eclipse.papyrus.infra.services.markerlistener@default:default,org.eclipse.papyrus.infra.services.resourceloading.preferences@default:default,org.eclipse.papyrus.infra.services.resourceloading@default:default,org.eclipse.papyrus.infra.services.semantic@default:default,org.eclipse.papyrus.infra.services.validation@default:default,org.eclipse.papyrus.infra.table.common@default:default,org.eclipse.papyrus.infra.table.controlmode@default:default,org.eclipse.papyrus.infra.table.instance@default:default,org.eclipse.papyrus.infra.table.menu@default:default,org.eclipse.papyrus.infra.table.modelexplorer@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel.edit@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel.editor@default:default,org.eclipse.papyrus.infra.table.papyrustableconfiguration.metamodel@default:default,org.eclipse.papyrus.infra.table.properties@default:default,org.eclipse.papyrus.infra.tools@default:default,org.eclipse.papyrus.infra.ui.resources@default:default,org.eclipse.papyrus.infra.widgets.toolbox@default:default,org.eclipse.papyrus.infra.widgets@default:default,org.eclipse.papyrus.sysml.diagram.blockdefinition@default:default,org.eclipse.papyrus.sysml.diagram.common@default:default,org.eclipse.papyrus.sysml.diagram.internalblock@default:default,org.eclipse.papyrus.sysml.diagram.requirement@default:default,org.eclipse.papyrus.sysml.diagram.ui@default:default,org.eclipse.papyrus.sysml.edit@default:default,org.eclipse.papyrus.sysml.facets@default:default,org.eclipse.papyrus.sysml.modelexplorer@default:default,org.eclipse.papyrus.sysml.properties@default:default,org.eclipse.papyrus.sysml.service.types@default:default,org.eclipse.papyrus.sysml.table.allocation@default:default,org.eclipse.papyrus.sysml.table.requirement@default:default,org.eclipse.papyrus.sysml@default:default,org.eclipse.papyrus.uml.alf.ui@default:default,org.eclipse.papyrus.uml.alf@default:default,org.eclipse.papyrus.uml.appearance@default:default,org.eclipse.papyrus.uml.commands@default:default,org.eclipse.papyrus.uml.controlmode.profile@default:default,org.eclipse.papyrus.uml.diagram.activity@default:default,org.eclipse.papyrus.uml.diagram.clazz@default:default,org.eclipse.papyrus.uml.diagram.common.groups@default:default,org.eclipse.papyrus.uml.diagram.common.palette.customaction@default:default,org.eclipse.papyrus.uml.diagram.common@default:default,org.eclipse.papyrus.uml.diagram.communication@default:default,org.eclipse.papyrus.uml.diagram.component@default:default,org.eclipse.papyrus.uml.diagram.composite@default:default,org.eclipse.papyrus.uml.diagram.deployment@default:default,org.eclipse.papyrus.uml.diagram.dnd@default:default,org.eclipse.papyrus.uml.diagram.emftree@default:default,org.eclipse.papyrus.uml.diagram.icons@default:default,org.eclipse.papyrus.uml.diagram.menu@default:default,org.eclipse.papyrus.uml.diagram.modelexplorer@default:default,org.eclipse.papyrus.uml.diagram.navigation@default:default,org.eclipse.papyrus.uml.diagram.package@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration.edit@default:default,org.eclipse.papyrus.uml.diagram.paletteconfiguration@default:default,org.eclipse.papyrus.uml.diagram.profile@default:default,org.eclipse.papyrus.uml.diagram.sequence@default:default,org.eclipse.papyrus.uml.diagram.statemachine@default:default,org.eclipse.papyrus.uml.diagram.usecase@default:default,org.eclipse.papyrus.uml.diagram.wizards@default:default,org.eclipse.papyrus.uml.documentation.profile@default:default,org.eclipse.papyrus.uml.extensionpoints@default:default,org.eclipse.papyrus.uml.icons@default:default,org.eclipse.papyrus.uml.import@default:default,org.eclipse.papyrus.uml.modelexplorer.widgets@default:default,org.eclipse.papyrus.uml.modelexplorer@default:default,org.eclipse.papyrus.uml.oclconstraintevaluation@default:default,org.eclipse.papyrus.uml.pastemanager@default:default,org.eclipse.papyrus.uml.perspective@default:default,org.eclipse.papyrus.uml.profile@default:default,org.eclipse.papyrus.uml.profilefacet.generation@default:default,org.eclipse.papyrus.uml.profilefacet.metamodel@default:default,org.eclipse.papyrus.uml.profilefacet@default:default,org.eclipse.papyrus.uml.properties@default:default,org.eclipse.papyrus.uml.resourceloading.profile@default:default,org.eclipse.papyrus.uml.service.types@default:default,org.eclipse.papyrus.uml.table.common@default:default,org.eclipse.papyrus.uml.table.default@default:default,org.eclipse.papyrus.uml.table.widgets.celleditors@default:default,org.eclipse.papyrus.uml.templaterepository@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.collaborationuse.xtext@default:default,org.eclipse.papyrus.uml.textedit.common.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.common.xtext@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.connectionpointreference.xtext@default:default,org.eclipse.papyrus.uml.textedit.constraintwithessentialocl.xtext@default:default,org.eclipse.papyrus.uml.textedit.javaconstraint@default:default,org.eclipse.papyrus.uml.textedit.message.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.message.xtext@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.parameter.xtext@default:default,org.eclipse.papyrus.uml.textedit.property.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.property.xtext@default:default,org.eclipse.papyrus.uml.textedit.state.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.state.xtext@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.stereotypeproperty.xtext@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext.ui@default:default,org.eclipse.papyrus.uml.textedit.transition.xtext@default:default,org.eclipse.papyrus.uml.tools.extendedtypes@default:default,org.eclipse.papyrus.uml.tools.utils@default:default,org.eclipse.papyrus.uml.tools@default:default,org.eclipse.papyrus.views.modelexplorer.resourceloading@default:default,org.eclipse.papyrus.views.modelexplorer.widgets@default:default,org.eclipse.papyrus.views.modelexplorer@default:default,org.eclipse.papyrus.views.properties.model.edit@default:default,org.eclipse.papyrus.views.properties.model.editor@default:default,org.eclipse.papyrus.views.properties.model@default:default,org.eclipse.papyrus.views.properties@default:default,org.eclipse.papyrus.xwt@default:default,org.eclipse.pde.api.tools.ui@default:default,org.eclipse.pde.api.tools@default:default,org.eclipse.pde.build@default:default,org.eclipse.pde.core@default:default,org.eclipse.pde.doc.user@default:default,org.eclipse.pde.ds.core@default:default,org.eclipse.pde.ds.ui@default:default,org.eclipse.pde.junit.runtime@default:default,org.eclipse.pde.launching@default:default,org.eclipse.pde.runtime@default:default,org.eclipse.pde.ua.core@default:default,org.eclipse.pde.ua.ui@default:default,org.eclipse.pde.ui.templates@default:default,org.eclipse.pde.ui@default:default,org.eclipse.pde@default:default,org.eclipse.platform.doc.isv@default:default,org.eclipse.platform.doc.user@default:default,org.eclipse.platform@default:default,org.eclipse.rcp@default:default,org.eclipse.sdk@default:default,org.eclipse.search@default:default,org.eclipse.swt.win32.win32.x86@default:default,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.team.cvs.core@default:default,org.eclipse.team.cvs.ssh2@default:default,org.eclipse.team.cvs.ui@default:default,org.eclipse.team.svn.core@default:default,org.eclipse.team.svn.help@default:default,org.eclipse.team.svn.mylyn@default:default,org.eclipse.team.svn.resource.ignore.rules.jdt@default:default,org.eclipse.team.svn.ui@default:default,org.eclipse.team.svn@default:default,org.eclipse.team.ui@default:default,org.eclipse.text@default:default,org.eclipse.ui.browser@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.externaltools@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro.universal@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator.resources@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.net@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.log@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.win32@default:false,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.uml2.codegen.ecore.ui@default:default,org.eclipse.uml2.codegen.ecore@default:default,org.eclipse.uml2.common.edit@default:default,org.eclipse.uml2.common@default:default,org.eclipse.uml2.doc@default:default,org.eclipse.uml2.examples.uml.ui@default:default,org.eclipse.uml2.examples@default:default,org.eclipse.uml2.types@default:default,org.eclipse.uml2.uml.ecore.exporter@default:default,org.eclipse.uml2.uml.ecore.importer@default:default,org.eclipse.uml2.uml.edit@default:default,org.eclipse.uml2.uml.editor@default:default,org.eclipse.uml2.uml.profile.l2@default:default,org.eclipse.uml2.uml.profile.l3@default:default,org.eclipse.uml2.uml.resources@default:default,org.eclipse.uml2.uml@default:default,org.eclipse.uml2@default:default,org.eclipse.update.configurator@3:true,org.eclipse.wst.common.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.xpand.activities@default:default,org.eclipse.xpand.doc@default:default,org.eclipse.xpand.examples@default:default,org.eclipse.xpand.ui@default:default,org.eclipse.xpand@default:default,org.eclipse.xsd@default:default,org.eclipse.xtend.check.ui@default:default,org.eclipse.xtend.core@default:default,org.eclipse.xtend.doc@default:default,org.eclipse.xtend.examples@default:default,org.eclipse.xtend.ide@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtend.m2e@default:default,org.eclipse.xtend.macro.lang.ui@default:default,org.eclipse.xtend.macro.lang@default:default,org.eclipse.xtend.macro@default:default,org.eclipse.xtend.profiler@default:default,org.eclipse.xtend.shared.ui@default:default,org.eclipse.xtend.typesystem.emf.ui@default:default,org.eclipse.xtend.typesystem.emf@default:default,org.eclipse.xtend.typesystem.uml2.ui@default:default,org.eclipse.xtend.typesystem.uml2@default:default,org.eclipse.xtend.typesystem.xsd.ui@default:default,org.eclipse.xtend.typesystem.xsd@default:default,org.eclipse.xtend.ui@default:default,org.eclipse.xtend.util.stdlib@default:default,org.eclipse.xtend2.lib@default:default,org.eclipse.xtend@default:default,org.eclipse.xtext.activities@default:default,org.eclipse.xtext.builder@default:default,org.eclipse.xtext.common.types.edit@default:default,org.eclipse.xtext.common.types.shared.jdt38@default:default,org.eclipse.xtext.common.types.shared@default:default,org.eclipse.xtext.common.types.ui@default:default,org.eclipse.xtext.common.types@default:default,org.eclipse.xtext.doc@default:default,org.eclipse.xtext.ecore@default:default,org.eclipse.xtext.generator@default:default,org.eclipse.xtext.gmf.glue@default:default,org.eclipse.xtext.junit4@default:default,org.eclipse.xtext.junit@default:default,org.eclipse.xtext.logging@default:default,org.eclipse.xtext.purexbase.ui@default:default,org.eclipse.xtext.purexbase@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.ui.codetemplates.ui@default:default,org.eclipse.xtext.ui.codetemplates@default:default,org.eclipse.xtext.ui.ecore@default:default,org.eclipse.xtext.ui.junit@default:default,org.eclipse.xtext.ui.shared@default:default,org.eclipse.xtext.ui@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.junit@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext.xbase.ui@default:default,org.eclipse.xtext.xbase@default:default,org.eclipse.xtext.xtext.ui.examples@default:default,org.eclipse.xtext.xtext.ui.graph@default:default,org.eclipse.xtext.xtext.ui@default:default,org.eclipse.xtext@default:default,org.eclipse.zest.core@default:default,org.eclipse.zest.doc.isv@default:default,org.eclipse.zest.layouts@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.jsoup@default:default,org.junit*3.8.2.v3_8_2_v20100427-1100@default:default,org.junit*4.10.0.v4_10_0_v20120426-0900@default:default,org.junit4@default:default,org.objectweb.asm@default:default,org.polarion.eclipse.team.svn.connector.svnkit17@default:default,org.polarion.eclipse.team.svn.connector@default:default,org.sat4j.core@default:default,org.sat4j.pb@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.0.v200806040011@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.papyrus.uml.diagram.common@default:default,org.eclipse.papyrus.uml.diagram.timing.tests@default:default,org.eclipse.papyrus.uml.diagram.timing@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java
new file mode 100644
index 00000000000..45af84397ed
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/Activator.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.timing.tests";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java
new file mode 100644
index 00000000000..4e093c45a3f
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/AllTests.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests;
+
+import org.eclipse.papyrus.uml.diagram.timing.tests.canonical.AllCanonicalTests;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+//@formatter:off
+@RunWith(Suite.class)
+@SuiteClasses({
+ // canonical
+ AllCanonicalTests.class
+})
+//@formatter:on
+public class AllTests {
+ // Junit 4 test case
+} \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java
new file mode 100644
index 00000000000..d511540c5e1
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AbstractTimingDiagramTestCase.java
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.uml.diagram.timing.custom.CreateTimingDiagramCommand;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.DestructionOccurrenceSpecificationEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantVerticalLineEditPart;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionCompartmentEditPartTN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.MessageOccurrenceSpecificationEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
+import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.timing.tests.generic.AbstractPapyrusTestCase;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.DestructionOccurrenceSpecification;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.InteractionFragment;
+import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+import org.eclipse.uml2.uml.OpaqueExpression;
+import org.eclipse.uml2.uml.StateInvariant;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+public class AbstractTimingDiagramTestCase extends AbstractPapyrusTestCase {
+
+ private InteractionEditPartTN interactionEditPart;
+ private InteractionCompartmentEditPartTN interactionCompartment;
+ private FullLifelineEditPartCN fullLifelineEditPart;
+ private CompactLifelineEditPartCN compactLifelineEditPart;
+ private FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment;
+ private FullLifelineTimelineCompartmentEditPartCN fullLifelineTimelineCompartment;
+ private CompactLifelineCompartmentEditPartCN compactLifelineTimelineCompartment;
+
+ @Override
+ protected ICreationCommand getDiagramCommandCreation() {
+ return new CreateTimingDiagramCommand();
+ }
+
+ /** Creates the default Interaction (use this when only one Interaction will be used in a test) */
+ protected void createDefaultInteraction(final Point position, final Dimension size) {
+ this.interactionEditPart = createInteraction(position, size);
+ this.interactionCompartment = (InteractionCompartmentEditPartTN) EditPartUtils.findFirstChildEditPartWithId(this.interactionEditPart,
+ InteractionCompartmentEditPartTN.VISUAL_ID);
+ assertNotNull("The interaction compartment was not found", this.interactionCompartment);
+ }
+
+ /** Creates the default Interaction (use this when only one Interaction will be used in a test) */
+ protected void createDefaultInteraction() {
+ createDefaultInteraction(new Point(0, 0), new Dimension(800, 600));
+ }
+
+ /**
+ * Creates the default full Lifeline in the default Interaction (use this when only one Interaction and one Lifeline
+ * will be used in a test)
+ */
+ protected void createDefaultFullLifeline() {
+ this.fullLifelineEditPart = createFullLifeline(getDefaultInteractionEditPart());
+ this.stateDefinitionCompartment = (FullLifelineStateDefinitionCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ this.fullLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
+ assertNotNull("The StateDefinition compartment must exist", this.stateDefinitionCompartment);
+ this.fullLifelineTimelineCompartment = (FullLifelineTimelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ this.fullLifelineEditPart, FullLifelineTimelineCompartmentEditPartCN.VISUAL_ID);
+ assertNotNull("The timeline compartment must exist", this.fullLifelineTimelineCompartment);
+ }
+
+ /**
+ * Creates the default compact Lifeline in the default Interaction (use this when only one Interaction and one
+ * Lifeline will be used in a test)
+ */
+ protected void createDefaultCompactLifeline() {
+ this.compactLifelineEditPart = createCompactLifeline(getDefaultInteractionEditPart());
+ this.compactLifelineTimelineCompartment = (CompactLifelineCompartmentEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ this.compactLifelineEditPart, CompactLifelineCompartmentEditPartCN.VISUAL_ID);
+ assertNotNull("The timeline compartment must exist", this.compactLifelineTimelineCompartment);
+ }
+
+ /** Creates 3 state definitions in the default Lifeline */
+ protected void createThreeStateDefinitionsInDefaultFullLifeline() {
+ createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment);
+ createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment);
+ createView(UMLElementTypes.Node_9, this.stateDefinitionCompartment);
+ }
+
+ /**
+ * Creates a new StateDefinition in the default Lifeline using a Request.
+ *
+ * @return the created StateDefinition's EditPart
+ */
+ protected StateDefinitionEditPart createStateDefinitionInDefaultFullLifeline() {
+ return createStateDefinition(getDefaultFullLifelineEditPart());
+ }
+
+ /**
+ * Creates a new StateDefinition in the given Lifeline using a Request.
+ *
+ * @return the created StateDefinition's EditPart
+ */
+ protected StateDefinitionEditPart createStateDefinition(final FullLifelineEditPartCN parentLifelineEditPart) {
+ final FullLifelineStateDefinitionCompartmentEditPartCN compartment = (FullLifelineStateDefinitionCompartmentEditPartCN) EditPartUtils
+ .findFirstChildEditPartWithId(parentLifelineEditPart, FullLifelineStateDefinitionCompartmentEditPartCN.VISUAL_ID);
+ final View stateDefinitionView = createView(UMLElementTypes.Node_9, compartment);
+ assertNotNull("The StateDefinition View should be created", stateDefinitionView);
+ return (StateDefinitionEditPart) findChildEditPartAssociatedToView(compartment, stateDefinitionView);
+ }
+
+ /**
+ * Create a new full Lifeline in the default Interaction using a Request.
+ *
+ * @return the created full Lifeline's EditPart
+ */
+ protected FullLifelineEditPartCN createFullLifelineInDefaultInteraction() {
+ return createFullLifeline(getDefaultInteractionEditPart());
+ }
+
+ /**
+ * Create a new full Lifeline in the given Interaction using a Request.
+ *
+ * @return the created full Lifeline's EditPart
+ */
+ protected FullLifelineEditPartCN createFullLifeline(final InteractionEditPartTN parentInteractionEditPart) {
+ final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(parentInteractionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
+ assertNotNull("The compartment must not be null", compartment);
+ final View view = createView(UMLElementTypes.Lifeline_19, compartment);
+ assertNotNull("The FullLifeline View should be created", view);
+ return (FullLifelineEditPartCN) findChildEditPartAssociatedToView(compartment, view);
+ }
+
+ /**
+ * Create a new compact Lifeline in the default Interaction using a Request.
+ *
+ * @return the created compact Lifeline's EditPart
+ */
+ protected CompactLifelineEditPartCN createCompactLifelineInDefaultInteraction() {
+ return createCompactLifeline(getDefaultInteractionEditPart());
+ }
+
+ /**
+ * Create a new compact Lifeline in the given Interaction using a Request.
+ *
+ * @return the created compact Lifeline's EditPart
+ */
+ protected CompactLifelineEditPartCN createCompactLifeline(final InteractionEditPartTN parentInteractionEditPart) {
+ final EditPart compartment = EditPartUtils.findFirstChildEditPartWithId(parentInteractionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
+ assertNotNull("The compartment must not be null", compartment);
+ final View view = createView(UMLElementTypes.Lifeline_20, compartment);
+ assertNotNull("The CompactLifeline View should be created", view);
+ return (CompactLifelineEditPartCN) findChildEditPartAssociatedToView(compartment, view);
+ }
+
+ /**
+ * Create a new Interaction in the default diagram using a Request.
+ *
+ * @param location
+ * the position for the new Interaction
+ * @param dimension
+ * the size of the new Interaction
+ * @return the created Interaction's EditPart
+ */
+ protected InteractionEditPartTN createInteraction(final Point location, final Dimension dimension) {
+ createView(UMLElementTypes.Interaction_2, location, dimension, getDiagramEditPart());
+ final InteractionEditPartTN interactionEditPart = (InteractionEditPartTN) EditPartUtils.findFirstChildEditPartWithId(getDiagramEditPart(),
+ InteractionEditPartTN.VISUAL_ID);
+ assertNotNull("The interaction EditPart was not found under the diagram EditPart", interactionEditPart);
+ final InteractionCompartmentEditPartTN interactionCompartment = (InteractionCompartmentEditPartTN) EditPartUtils.findFirstChildEditPartWithId(
+ interactionEditPart, InteractionCompartmentEditPartTN.VISUAL_ID);
+ assertNotNull("The interaction compartment was not found", interactionCompartment);
+ return interactionEditPart;
+ }
+
+ /**
+ * Create a new Interaction with a default size in the default diagram using a Request.
+ *
+ * @return the created Interaction's EditPart
+ */
+ protected InteractionEditPartTN createInteraction() {
+ return createInteraction(new Point(0, 0), new Dimension(800, 400));
+ }
+
+ /**
+ * Create three occurrence specifications in the default Lifeline:
+ * <ul>
+ * <li>click at 1/4 on the single StateInvariant (automatically created at the beginning; takes the whole width)
+ * <li>click at 1/3 on the just created second StateInvariant (that takes 3/4 of the width)
+ * <li>click at 1/2 on the just created second StateInvariant (that takes 1/2 of the width)
+ * <li>this results in three regularly spaced occurrence specifications
+ * <ul>
+ *
+ */
+ protected void createThreeOccurrenceSpecificationsInDefaultFullLifeline() {
+ createOccurrenceSpecificationInLastFullStateInvariantWithRatio(1, 1.0 / 4.0);
+ createOccurrenceSpecificationInLastFullStateInvariantWithRatio(2, 1.0 / 3.0);
+ createOccurrenceSpecificationInLastFullStateInvariantWithRatio(3, 1.0 / 2.0);
+ }
+
+ /**
+ * Create three occurrence specifications in the default Lifeline:
+ * <ul>
+ * <li>click at 1/4 on the single StateInvariant (automatically created at the beginning; takes the whole width)
+ * <li>click at 1/3 on the just created second StateInvariant (that takes 3/4 of the width)
+ * <li>click at 1/2 on the just created second StateInvariant (that takes 1/2 of the width)
+ * <li>this results in three regularly spaced occurrence specifications
+ * <ul>
+ *
+ */
+ protected void createThreeOccurrenceSpecificationsInDefaultCompactLifeline() {
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(1, 1.0 / 4.0);
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(2, 1.0 / 3.0);
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(3, 1.0 / 2.0);
+ }
+
+ /**
+ * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
+ *
+ * @param expectedNumberOfStateInvariants
+ * the number of state invariants that is expected (for checking)
+ * @param xPos
+ * the position starting from the left of the StateInvariant
+ */
+ protected void createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
+ // we need to wait for GMF to do its layout in order to have correct coordinates
+ flushEventLoop();
+ final FullStateInvariantEditPartCN lastStateInvariant = getAndAssertLastFullStateInvariant(expectedNumberOfStateInvariants);
+ final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
+ assertTrue("position out of bounds", xPos < bounds.width);
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + xPos, bounds.y));
+ }
+
+ /**
+ * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default Lifeline
+ *
+ * @param expectedNumberOfStateInvariants
+ * the number of state invariants that is expected (for checking)
+ * @param xPos
+ * the position starting from the left of the StateInvariant
+ */
+ protected void createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(final int expectedNumberOfStateInvariants, final int xPos) {
+ // we need to wait for GMF to do its layout in order to have correct coordinates
+ flushEventLoop();
+ final CompactStateInvariantEditPartCN lastStateInvariant = getAndAssertLastCompactStateInvariant(expectedNumberOfStateInvariants);
+ final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
+ assertTrue("position out of bounds", xPos < bounds.width);
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + xPos, bounds.y));
+ }
+
+ /**
+ * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default full Lifeline
+ *
+ * @param expectedNumberOfStateInvariants
+ * the number of state invariants that is expected (for checking)
+ * @param ratio
+ * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
+ */
+ protected void createOccurrenceSpecificationInLastFullStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
+ assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
+ // we need to wait for GMF to do its layout in order to have correct coordinates
+ flushEventLoop();
+ final FullStateInvariantEditPartCN lastStateInvariant = getAndAssertLastFullStateInvariant(expectedNumberOfStateInvariants);
+ final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int) (bounds.width * ratio), bounds.y));
+ }
+
+ /**
+ * Create an OccurrenceSpecification on the last StateInvariant in the timeline of the default compact Lifeline
+ *
+ * @param expectedNumberOfStateInvariants
+ * the number of state invariants that is expected (for checking)
+ * @param ratio
+ * where to click in the StateInvariant (0.0 = beginning; 1.0 = end)
+ */
+ protected void createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(final int expectedNumberOfStateInvariants, final double ratio) {
+ assertTrue("invalid ratio", ratio >= 0.0 && ratio <= 1.0);
+ // we need to wait for GMF to do its layout in order to have correct coordinates
+ flushEventLoop();
+ final CompactStateInvariantEditPartCN lastStateInvariant = getAndAssertLastCompactStateInvariant(expectedNumberOfStateInvariants);
+ final Rectangle bounds = getAbsoluteBounds(lastStateInvariant);
+ sendOpenSelectionRequest(lastStateInvariant, new Point(bounds.x + (int) (bounds.width * ratio), bounds.y));
+ }
+
+ private FullStateInvariantEditPartCN getAndAssertLastFullStateInvariant(final int expectedNumberOfStateInvariants) {
+ final List<FullStateInvariantEditPartCN> stateInvariants = findStateInvariantsInDefaultFullLifeline();
+ assertEquals("Wrong number of StateInvariants", expectedNumberOfStateInvariants, stateInvariants.size());
+ final FullStateInvariantEditPartCN lastStateInvariant = stateInvariants.get(expectedNumberOfStateInvariants - 1);
+ return lastStateInvariant;
+ }
+
+ private CompactStateInvariantEditPartCN getAndAssertLastCompactStateInvariant(final int expectedNumberOfStateInvariants) {
+ final List<CompactStateInvariantEditPartCN> stateInvariants = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("Wrong number of StateInvariants", expectedNumberOfStateInvariants, stateInvariants.size());
+ final CompactStateInvariantEditPartCN lastStateInvariant = stateInvariants.get(expectedNumberOfStateInvariants - 1);
+ return lastStateInvariant;
+ }
+
+ /** @return all OccurrenceSpecification EditParts found in the default Lifeline */
+ @SuppressWarnings("unchecked")
+ protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultFullLifeline() {
+ return (List<OccurrenceSpecificationEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(),
+ OccurrenceSpecificationEditPartCN.VISUAL_ID);
+ }
+
+ /** @return all OccurrenceSpecification EditParts found in the default Lifeline */
+ @SuppressWarnings("unchecked")
+ protected List<OccurrenceSpecificationEditPartCN> findOccurrenceSpecificationsInDefaultCompactLifeline() {
+ return (List<OccurrenceSpecificationEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(),
+ OccurrenceSpecificationEditPartCN.VISUAL_ID);
+ }
+
+ /** @return all StateInvariant EditParts found in the default Lifeline */
+ @SuppressWarnings("unchecked")
+ protected List<FullStateInvariantEditPartCN> findStateInvariantsInDefaultFullLifeline() {
+ return (List<FullStateInvariantEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(),
+ FullStateInvariantEditPartCN.VISUAL_ID);
+ }
+
+ /** @return all StateInvariant EditParts found in the default Lifeline */
+ @SuppressWarnings("unchecked")
+ protected List<CompactStateInvariantEditPartCN> findStateInvariantsInDefaultCompactLifeline() {
+ return (List<CompactStateInvariantEditPartCN>) EditPartUtils.findChildEditPartsWithId(getDefaultCompactLifelineEditPart(),
+ CompactStateInvariantEditPartCN.VISUAL_ID);
+ }
+
+ /** @return all StateDefinition EditParts found in the default Lifeline */
+ @SuppressWarnings("unchecked")
+ protected List<StateDefinitionEditPart> findStateDefinitions() {
+ return (List<StateDefinitionEditPart>) EditPartUtils.findChildEditPartsWithId(getDefaultFullLifelineEditPart(), StateDefinitionEditPart.VISUAL_ID);
+ }
+
+ /**
+ * Check that the fragments in the default interaction are ordered following the given pattern.
+ *
+ * @param pattern
+ * the pattern, where "o" means OccurrenceSpecification, and "-" means StateInvariant
+ */
+ protected void checkInteractionFragmentsWithPattern(final String expectedPattern) {
+ final String fragmentsStringPattern = computeInteractionFragmentsStringPattern();
+ assertEquals("The timeline does not follow the expected pattern", expectedPattern, fragmentsStringPattern);
+ }
+
+ protected String computeInteractionFragmentsStringPattern() {
+ final StringBuilder pattern = new StringBuilder();
+ final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ final EList<InteractionFragment> fragments = interaction.getFragments();
+ for (final InteractionFragment fragment : fragments) {
+ if (fragment instanceof StateInvariant) {
+ pattern.append("-");
+ } else if (fragment instanceof DestructionOccurrenceSpecification) {
+ pattern.append("x");
+ } else if (fragment instanceof MessageOccurrenceSpecification) {
+ pattern.append("m");
+ } else if (fragment instanceof OccurrenceSpecification) {
+ pattern.append("o");
+ }
+ }
+ return pattern.toString();
+ }
+
+ protected InteractionCompartmentEditPartTN getDefaultInteractionCompartment() {
+ return this.interactionCompartment;
+ }
+
+ protected InteractionEditPartTN getDefaultInteractionEditPart() {
+ return this.interactionEditPart;
+ }
+
+ protected FullLifelineEditPartCN getDefaultFullLifelineEditPart() {
+ return this.fullLifelineEditPart;
+ }
+
+ protected FullLifelineStateDefinitionCompartmentEditPartCN getDefaultStateDefinitionCompartment() {
+ return this.stateDefinitionCompartment;
+ }
+
+ protected FullLifelineTimelineCompartmentEditPartCN getDefaultFullLifelineTimelineCompartment() {
+ return this.fullLifelineTimelineCompartment;
+ }
+
+ protected CompactLifelineEditPartCN getDefaultCompactLifelineEditPart() {
+ return this.compactLifelineEditPart;
+ }
+
+ protected CompactLifelineCompartmentEditPartCN getDefaultCompactLifelineTimelineCompartment() {
+ return this.compactLifelineTimelineCompartment;
+ }
+
+ /**
+ * Click in the middle of the given compact StateInvariant with the OccurrenceSpecification tool in order to create
+ * an OccurrenceSpecification over it.
+ *
+ * @param compactStateInvariant
+ * the StateInvariant on which to create an OccurrenceSpecification
+ * @param bottom
+ * whether to click at the bottom of the StateInvariant, instead of at the top
+ */
+ protected void createOccurrenceSpecificationOverCompactStateInvariant(final CompactStateInvariantEditPartCN compactStateInvariant, final boolean bottom) {
+ final Rectangle bounds = getBounds(compactStateInvariant);
+ final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + (bottom ? bounds.height - 2 : 2));
+ compactStateInvariant.getFigure().getParent().translateToAbsolute(point);
+ clickTool("createOccurrenceSpecificationCreationTool", point);
+ }
+
+ protected void checkFullTimelinePattern(final String expectedPattern) {
+ final String timelineStringPattern = computeFullTimelineStringPattern();
+ assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
+ }
+
+ protected String computeFullTimelineStringPattern() {
+ flushEventLoop();
+ final StringBuilder pattern = new StringBuilder();
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = timelineCompartment.getChildren();
+ for (final EditPart editPart : children) {
+ if (editPart instanceof FullStateInvariantEditPartCN) {
+ outputFullStateInvariantPattern((FullStateInvariantEditPartCN) editPart, pattern);
+ } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ outputFullOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN) editPart, pattern);
+ } else if (editPart instanceof FullStateInvariantVerticalLineEditPart) {
+ pattern.append("VerticalLine;");
+ } else {
+ fail("unexpected element");
+ }
+ }
+ return pattern.toString();
+ }
+
+ private static void outputFullStateInvariantPattern(final FullStateInvariantEditPartCN editPart, final StringBuilder pattern) {
+ final View view = (View) editPart.getModel();
+ assertNotNull("The EditPart must have a View", view);
+ final StateInvariant stateInvariant = (StateInvariant) view.getElement();
+ assertNotNull("The View must have a semantic element", view);
+ final Constraint constraint = stateInvariant.getInvariant();
+ assertNotNull("The StateInvariant must have a Constraint", constraint);
+ final ValueSpecification specification = constraint.getSpecification();
+ assertNotNull("The Constraint must have a ValueSpecification", specification);
+ assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
+ final OpaqueExpression opaqueExpression = (OpaqueExpression) specification;
+ assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
+ assertEquals("The OpaqueExpression must have one Body", 1, opaqueExpression.getBodies().size());
+ pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
+ }
+
+ private static void outputFullOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
+ final View view = (View) editPart.getModel();
+ assertNotNull("The EditPart must have a View", view);
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) view.getElement();
+ assertNotNull("The View must have a semantic element", occurrenceSpecification);
+ final String name = occurrenceSpecification.getName();
+ pattern.append("OccurrenceSpecification(").append(name).append(");");
+ }
+
+ protected void checkCompactTimelinePattern(final String expectedPattern) {
+ final String timelineStringPattern = computeCompactTimelineStringPattern();
+ assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
+ }
+
+ protected String computeCompactTimelineStringPattern() {
+ flushEventLoop();
+ final StringBuilder pattern = new StringBuilder();
+ final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = timelineCompartment.getChildren();
+ for (final EditPart editPart : children) {
+ if (editPart instanceof CompactStateInvariantEditPartCN) {
+ outputCompactStateInvariantPattern((CompactStateInvariantEditPartCN) editPart, pattern);
+ } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ outputCompactOccurrenceSpecificationPattern((OccurrenceSpecificationEditPartCN) editPart, pattern);
+ } else {
+ fail("unexpected element");
+ }
+ }
+ return pattern.toString();
+ }
+
+ private static void outputCompactStateInvariantPattern(final CompactStateInvariantEditPartCN editPart, final StringBuilder pattern) {
+ final View view = (View) editPart.getModel();
+ assertNotNull("The EditPart must have a View", view);
+ final StateInvariant stateInvariant = (StateInvariant) view.getElement();
+ assertNotNull("The View must have a semantic element", view);
+ final Constraint constraint = stateInvariant.getInvariant();
+ assertNotNull("The StateInvariant must have a Constraint", constraint);
+ final ValueSpecification specification = constraint.getSpecification();
+ assertNotNull("The Constraint must have a ValueSpecification", specification);
+ assertTrue("The ValueSpecification must be an OpaqueExpression", specification instanceof OpaqueExpression);
+ final OpaqueExpression opaqueExpression = (OpaqueExpression) specification;
+ assertNotNull("The OpaqueExpression must not have a null list of bodies", opaqueExpression.getBodies());
+ if (opaqueExpression.getBodies().isEmpty()) {
+ pattern.append("StateInvariant(unnamed);");
+ } else {
+ pattern.append("StateInvariant(").append(opaqueExpression.getBodies().get(0)).append(");");
+ }
+ }
+
+ private static void outputCompactOccurrenceSpecificationPattern(final OccurrenceSpecificationEditPartCN editPart, final StringBuilder pattern) {
+ final View view = (View) editPart.getModel();
+ assertNotNull("The EditPart must have a View", view);
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) view.getElement();
+ assertNotNull("The View must have a semantic element", occurrenceSpecification);
+ final String name = occurrenceSpecification.getName();
+ pattern.append("OccurrenceSpecification(").append(name).append(");");
+ }
+
+ protected void checkSimpleFullTimelinePattern(final String expectedPattern) {
+ final String timelineStringPattern = computeSimpleFullTimelineStringPattern();
+ assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
+ }
+
+ protected String computeSimpleFullTimelineStringPattern() {
+ flushEventLoop();
+ final StringBuilder pattern = new StringBuilder();
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = timelineCompartment.getChildren();
+ for (final EditPart editPart : children) {
+ if (editPart instanceof FullStateInvariantEditPartCN) {
+ pattern.append("-");
+ } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ pattern.append("o");
+ } else if (editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
+ pattern.append("m");
+ } else if (editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
+ pattern.append("x");
+ } else if (editPart instanceof FullStateInvariantVerticalLineEditPart) {
+ pattern.append("|");
+ } else {
+ fail("unexpected element");
+ }
+ }
+ return pattern.toString();
+ }
+
+ /**
+ * Check that the timeline contains the expected elements in the expected order.
+ *
+ * @param expectedPattern
+ * a pattern where
+ * <ul>
+ * <li>"o" represents an OccurrenceSpecification
+ * <li>"-" represents a StateInvariant
+ * </ul>
+ */
+ protected void checkSimpleCompactTimelinePattern(final String expectedPattern) {
+ final String timelineStringPattern = computeSimpleCompactTimelineStringPattern();
+ assertEquals("The timeline does not follow the expected pattern", expectedPattern, timelineStringPattern);
+ }
+
+ protected String computeSimpleCompactTimelineStringPattern() {
+ flushEventLoop();
+ final StringBuilder pattern = new StringBuilder();
+ final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = timelineCompartment.getChildren();
+ for (final EditPart editPart : children) {
+ if (editPart instanceof CompactStateInvariantEditPartCN) {
+ pattern.append("-");
+ } else if (editPart instanceof OccurrenceSpecificationEditPartCN) {
+ pattern.append("o");
+ } else if (editPart instanceof MessageOccurrenceSpecificationEditPartCN) {
+ pattern.append("m");
+ } else if (editPart instanceof DestructionOccurrenceSpecificationEditPartCN) {
+ pattern.append("x");
+ } else {
+ fail("unexpected element");
+ }
+ }
+ return pattern.toString();
+ }
+
+ /**
+ * Test that the modifications can all be undone and redone, and that the dirty state is consistent throughout the
+ * undo/redo operations.
+ *
+ * @param nElementsToUndo
+ * the number of elements that should be undoable before reaching the non-dirty state
+ */
+ protected void testDirtyStateForFullUndoRedo(final int nElementsToUndo) {
+ assertTrue("The editor should be dirty after all the modifications", this.diagramEditor.isDirty());
+ for (int i = 0; i < nElementsToUndo; i++) {
+ undoOnUIThread();
+ // editor should be dirty for all states except the initial state
+ if (i == nElementsToUndo - 1) {
+ assertFalse("The editor should not be dirty after we undid all previous modifications", this.diagramEditor.isDirty());
+ } else {
+ assertTrue("The editor should be dirty until we undo all previous modifications", this.diagramEditor.isDirty());
+ }
+ }
+ for (int i = 0; i < nElementsToUndo; i++) {
+ redoOnUIThread();
+ assertTrue("The editor should be dirty after we redo", this.diagramEditor.isDirty());
+ }
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
new file mode 100644
index 00000000000..1620ec4b736
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/AllCanonicalTests.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+//@formatter:off
+@RunWith(Suite.class)
+@SuiteClasses({
+ TestTimingDiagramInteraction.class,
+ TestTimingDiagramFullLifeline.class,
+ TestTimingDiagramCompactLifeline.class,
+
+ TestTimingDiagramFullStateInvariant.class,
+ TestTimingDiagramCompactStateInvariant.class,
+
+ TestTimingDiagramFullOccurrenceSpecification.class,
+ TestTimingDiagramCompactOccurrenceSpecification.class,
+
+ TestTimingDiagramStateDefinition.class,
+ TestTimingDiagramFullLifelineLayout.class,
+
+ TestTimingDiagramMessages.class,
+})
+//@formatter:on
+public class AllCanonicalTests {
+ // Junit 4 test case
+} \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
new file mode 100644
index 00000000000..e8ea411ba12
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactLifeline.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineNameEditPart;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.UMLEditPartFactory;
+import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.Test;
+
+public class TestTimingDiagramCompactLifeline extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ }
+
+ @Test
+ public void testCreateLifeline() {
+ createCompactLifelineInDefaultInteraction();
+ }
+
+ @Test
+ public void testHideLifeline() {
+ final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
+ testHide(lifelineEditPart);
+ }
+
+ @Test
+ public void testDeleteLifeline() {
+ final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
+ testDelete(lifelineEditPart);
+ }
+
+ @Test
+ public void testDropLifeline() {
+ // create a compact Lifeline and hide its View, so as to be able to drop it after that
+ final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
+ final Lifeline lifeline = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ assertNotNull("The lifeline should not be null", lifeline);
+ testHide(lifelineEditPart);
+ testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
+ }
+
+ @Test
+ public void testCellEditorLocator() {
+ final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
+ final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
+ lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
+ assertNotNull("The CompactLifelineNameEditPart was not found", compactLifelineNameEditPart);
+ final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(compactLifelineNameEditPart);
+ assertTrue("The cell editor locator must be the one specific to the vertical label",
+ textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
+ }
+
+ @Test
+ public void testEditLifelineName() {
+ final CompactLifelineEditPartCN lifelineEditPart = createCompactLifelineInDefaultInteraction();
+ final CompactLifelineNameEditPart compactLifelineNameEditPart = (CompactLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
+ lifelineEditPart, CompactLifelineNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ testSetNameWithDirectEditRequest(compactLifelineNameEditPart, namedElement);
+ }
+
+ @Test
+ public void create3LifelinesTest() {
+ final EditPart interactionCompartment = getDefaultInteractionCompartment();
+ assertNotNull("The interaction compartment was not found", interactionCompartment);
+ createView(UMLElementTypes.Lifeline_20, interactionCompartment);
+ createView(UMLElementTypes.Lifeline_20, interactionCompartment);
+ createView(UMLElementTypes.Lifeline_20, interactionCompartment);
+ assertEquals("The interaction compartment should only contain the 3 lifelines", 3, interactionCompartment.getChildren().size());
+ final List<? extends EditPart> editParts = EditPartUtils.findChildEditPartsWithId(interactionCompartment, CompactLifelineEditPartCN.VISUAL_ID);
+ assertEquals("The interaction compartment should contain 3 lifelines", 3, editParts.size());
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
new file mode 100644
index 00000000000..f1e08a79306
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactOccurrenceSpecification.java
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+import org.eclipse.uml2.uml.StateInvariant;
+import org.junit.Test;
+
+public class TestTimingDiagramCompactOccurrenceSpecification extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ createDefaultCompactLifeline();
+ }
+
+ @Test
+ public void testCreateThreeOccurrenceSpecifications() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ final View interactionView = (View) getDefaultInteractionEditPart().getModel();
+ final Interaction interaction = (Interaction) interactionView.getElement();
+ assertTrue("The interaction should be in a Model", isInModel(interaction));
+ // We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
+ // OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
+ // So, it should look like : "-o-o-o-" (with "-" for StateInvariant and "o" for OccurrenceSpecification)
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ }
+
+ @Test
+ public void testDeleteOccurrenceSpecification() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecifications = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
+ final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
+
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) ((View) middleOccurrence.getModel()).getElement();
+ assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+
+ // destroy the middle OccurrenceSpecification
+ final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
+ final Command command = middleOccurrence.getCommand(destroyElementRequest);
+ checkCommand(command);
+ execute(command);
+ assertEquals("There should be one less OccurrenceSpecification", 2, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
+ assertFalse("The OccurrenceSpecification should not be in the Model after deleting it", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+
+ // test undo
+ undo();
+ assertEquals("The OccurrenceSpecification should be back after the undo", 3, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
+ assertTrue("The OccurrenceSpecification should be back in the Model after undoing the deletion", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+
+ // test redo
+ redo();
+ assertEquals("The OccurrenceSpecification should be removed after the redo", 2, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
+ assertFalse("The OccurrenceSpecification should not be in the Model after redoing the deletion", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+ }
+
+ @Test
+ public void testCreateOccurrenceSpecificationWithDoubleClick() {
+ final CompactStateInvariantEditPartCN stateInvariantEditPart = (CompactStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ getDefaultCompactLifelineEditPart(), CompactStateInvariantEditPartCN.VISUAL_ID);
+ assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
+ assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultCompactLifeline().size());
+ final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ assertNotNull("The StateInvariant must not be null", stateInvariant);
+
+ final IFigure figure = stateInvariantEditPart.getFigure();
+ final Rectangle bounds = new Rectangle(figure.getBounds());
+ figure.getParent().translateToAbsolute(bounds);
+
+ // click at the center of the StateInvariant line
+ final int x = bounds.x + bounds.width / 2;
+ final int y = bounds.y + bounds.height / 2;
+
+ // send the open request (corresponding to a double-click)
+ sendOpenSelectionRequest(stateInvariantEditPart, new Point(x, y));
+
+ checkCreatedStateInvariants();
+ checkCreatedOccurrenceSpecification();
+
+ // test undo
+ undoOnUIThread();
+ assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultCompactLifeline().size());
+ assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultCompactLifeline().size());
+
+ // test redo
+ redoOnUIThread();
+ assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultCompactLifeline().size());
+ checkCreatedOccurrenceSpecification();
+ }
+
+ @Test
+ public void testMoveOccurrenceSpecification() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ flushEventLoop();
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
+ final OccurrenceSpecificationEditPartCN third = occurrenceSpecificationEditParts.get(2);
+
+ final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
+
+ final int minX = getBounds(first).x;
+ final int maxX = getBounds(third).x;
+
+ // shift to the left
+ Rectangle boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-9, 0));
+ Rectangle boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 9 pixels to the left", boundsBefore.x - 9, boundsAfter.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // shift to the right
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(13, 0));
+ boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 13 pixels to the right", boundsBefore.x + 13, boundsAfter.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move past the previous OccurrenceSpecification (should be forbidden)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-(boundsBefore.x - minX + 10), 0));
+ boundsAfter = getBounds(second);
+ assertTrue("The Figure should be constrained, but still move", boundsAfter.x < boundsBefore.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move past the following OccurrenceSpecification (should be forbidden)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(maxX - boundsBefore.x + 10, 0));
+ boundsAfter = getBounds(second);
+ assertTrue("The Figure should be constrained, but still move", boundsAfter.x > boundsBefore.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move horizontally and vertically at the same time (should be constrained to an horizontal-only move)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-17, 123));
+ boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 17 pixels to the left", boundsBefore.x - 17, boundsAfter.x);
+ assertEquals("The Figure should not move vertically", boundsBefore.y, boundsAfter.y);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+ }
+
+ /**
+ * When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
+ * the future positions of the elements being moved.
+ */
+ @Test
+ public void testMoveAdjacentOccurrenceSpecifications() {
+ // create two OccurrenceSpecifications close to each other
+ createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(1, 100);
+ createOccurrenceSpecificationInLastCompactStateInvariantAtAbsolutePos(2, 10);
+ flushEventLoop();
+
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 2, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
+ final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
+
+ // shift both to the left
+ final Rectangle firstBefore = getBounds(first);
+ final Rectangle secondBefore = getBounds(second);
+ moveEditParts(Arrays.asList(first, second), timelineCompartment, new Point(-50, 0));
+ final Rectangle firstAfter = getBounds(first);
+ final Rectangle secondAfter = getBounds(second);
+ assertEquals("The first Figure should have been moved 50 pixels to the left", firstBefore.x - 50, firstAfter.x);
+ assertEquals("The second Figure should have been moved 50 pixels to the left", secondBefore.x - 50, secondAfter.x);
+ }
+
+ protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
+ assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
+ assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
+ }
+
+ @Test
+ public void testFullUndoRedo() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ // 3 OccurrenceSpecifications + 1 Lifeline + 1 Interaction
+ final int nElementsToUndo = 5;
+ testDirtyStateForFullUndoRedo(nElementsToUndo);
+ }
+
+ @Test
+ public void testCreateOccurrenceSpecificationOnCompactStateInvariant() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ flushEventLoop();
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+
+ final List<CompactStateInvariantEditPartCN> stateInvariantsEditParts = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("Wrong number of StateInvariants", 4, stateInvariantsEditParts.size());
+ final CompactStateInvariantEditPartCN s1 = stateInvariantsEditParts.get(0);
+ final CompactStateInvariantEditPartCN s2 = stateInvariantsEditParts.get(1);
+ final CompactStateInvariantEditPartCN s3 = stateInvariantsEditParts.get(2);
+ final CompactStateInvariantEditPartCN s4 = stateInvariantsEditParts.get(3);
+
+ createOccurrenceSpecificationOverCompactStateInvariant(s1, false);
+ createOccurrenceSpecificationOverCompactStateInvariant(s2, true);
+ createOccurrenceSpecificationOverCompactStateInvariant(s3, false);
+ createOccurrenceSpecificationOverCompactStateInvariant(s4, true);
+ flushEventLoop();
+ checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
+
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 7, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN o1 = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN o2 = occurrenceSpecificationEditParts.get(1);
+ final OccurrenceSpecificationEditPartCN o3 = occurrenceSpecificationEditParts.get(2);
+ final OccurrenceSpecificationEditPartCN o4 = occurrenceSpecificationEditParts.get(3);
+ final OccurrenceSpecificationEditPartCN o5 = occurrenceSpecificationEditParts.get(4);
+ final OccurrenceSpecificationEditPartCN o6 = occurrenceSpecificationEditParts.get(5);
+ final OccurrenceSpecificationEditPartCN o7 = occurrenceSpecificationEditParts.get(6);
+
+ checkOccurrenceIsMiddleXTopYOfStateInvariant(o1, s1);
+ checkOccurrenceIsRightXMiddleYOfStateInvariant(o2, s1);
+ checkOccurrenceIsMiddleXBottomYOfStateInvariant(o3, s2);
+ checkOccurrenceIsRightXMiddleYOfStateInvariant(o4, s2);
+ checkOccurrenceIsMiddleXTopYOfStateInvariant(o5, s3);
+ checkOccurrenceIsRightXMiddleYOfStateInvariant(o6, s3);
+ checkOccurrenceIsMiddleXBottomYOfStateInvariant(o7, s4);
+ }
+
+ private static void checkOccurrenceIsMiddleXTopYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
+ final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
+ final Rectangle sBounds = getBounds(stateInvariantEditPart);
+ assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - sBounds.y) <= 5);
+ assertTrue("The occurrence should be located horizontally near the middle of the state invariant",
+ Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
+ }
+
+ private static void checkOccurrenceIsMiddleXBottomYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
+ final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
+ final Rectangle sBounds = getBounds(stateInvariantEditPart);
+ assertTrue("The occurrence should be located vertically near the top of the state invariant", Math.abs(oBounds.y - (sBounds.y + sBounds.height)) <= 5);
+ assertTrue("The occurrence should be located horizontally near the middle of the state invariant",
+ Math.abs(oBounds.x - (sBounds.x + sBounds.width / 2)) <= 5);
+ }
+
+ private static void checkOccurrenceIsRightXMiddleYOfStateInvariant(final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart,
+ final CompactStateInvariantEditPartCN stateInvariantEditPart) {
+ final Rectangle oBounds = getBounds(occurrenceSpecificationEditPart);
+ final Rectangle sBounds = getBounds(stateInvariantEditPart);
+ assertTrue("The occurrence should be located vertically near the middle of the state invariant",
+ Math.abs(oBounds.y - (sBounds.y + sBounds.height / 2)) <= 5);
+ assertTrue("The occurrence should be located horizontally near the right of the state invariant",
+ Math.abs(oBounds.x - (sBounds.x + sBounds.width)) <= 5);
+ }
+
+ protected void checkCreatedStateInvariants() {
+ // check the StateInvariants
+ final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("There must be two StateInvariants after creating an OccurrenceSpecification", 2, stateInvariantEditParts.size());
+ checkStateInvariant(stateInvariantEditParts.get(0));
+ checkStateInvariant(stateInvariantEditParts.get(1));
+ }
+
+ private void checkCreatedOccurrenceSpecification() {
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
+ final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
+ final View occurrenceSpecificationView = (View) occurrenceSpecificationEditPart.getModel();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) occurrenceSpecificationView.getElement();
+ assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
+ assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
+ assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
+ final Lifeline lifeline = (Lifeline) ((View) getDefaultCompactLifelineEditPart().getModel()).getElement();
+ assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
+ final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
+ }
+
+ private void checkStateInvariant(final CompactStateInvariantEditPartCN stateInvariantEditPartCN) {
+ final View stateInvariantView = (View) stateInvariantEditPartCN.getModel();
+ final StateInvariant stateInvariant = (StateInvariant) stateInvariantView.getElement();
+ assertNotNull("The StateInvariant must not be null", stateInvariant);
+ assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
+ assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
+ final Lifeline lifeline = (Lifeline) ((View) getDefaultCompactLifelineEditPart().getModel()).getElement();
+ assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
+ final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
new file mode 100644
index 00000000000..9bebb3d371f
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramCompactStateInvariant.java
@@ -0,0 +1,237 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactLifelineCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.CompactStateInvariantNameEditPart;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
+import org.eclipse.uml2.uml.StateInvariant;
+import org.junit.Test;
+
+public class TestTimingDiagramCompactStateInvariant extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ createDefaultCompactLifeline();
+ }
+
+ @Test
+ public void testCutCompactStateInvariants() {
+ final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("We should have one StateInvariant at the beginning of this test", 1, stateInvariantEditParts.size());
+ checkCompactTimelinePattern("StateInvariant(unnamed);");
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(1, 1.0 / 4.0);
+ checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(2, 1.0 / 3.0);
+ createOccurrenceSpecificationInLastCompactStateInvariantWithRatio(3, 1.0 / 2.0);
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ checkCompactTimelinePattern("StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);"
+ + "OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);OccurrenceSpecification(<unnamed>_To_<unnamed>);StateInvariant(unnamed);");
+ }
+
+ @Test
+ public void testEditCompactStateInvariantName() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ final List<CompactStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("We should have four StateInvariants", 4, stateInvariantEditParts.size());
+ int i = 1;
+ for (final CompactStateInvariantEditPartCN stateInvariantEditPart : stateInvariantEditParts) {
+ final CompactStateInvariantNameEditPart nameEditPart = (CompactStateInvariantNameEditPart) EditPartUtils.findFirstChildEditPartWithId(
+ stateInvariantEditPart, CompactStateInvariantNameEditPart.VISUAL_ID);
+ assertNotNull("The name edit part must not be null", nameEditPart);
+ final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ testSetNameWithDirectEditRequest(nameEditPart, stateInvariant, new INameProvider<StateInvariant>() {
+ public String getName(final StateInvariant stateInvariant) {
+ return StateInvariantUtils.getInnerStateInvariantName(stateInvariant);
+ }
+ });
+ setNameWithDirectEditRequest(nameEditPart, "state" + (i % 2 + 1));
+ i++;
+ }
+ checkCompactTimelinePattern("StateInvariant(state2);OccurrenceSpecification(state2_1_To_state1_1);StateInvariant(state1);"
+ + "OccurrenceSpecification(state1_1_To_state2_2);StateInvariant(state2);OccurrenceSpecification(state2_2_To_state1_2);StateInvariant(state1);");
+ }
+
+ @Test
+ public void testDeleteStateInvariants() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(1);
+ executeDestroyCommand(compactStateInvariantEditPart);
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+ undoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ redoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+ }
+
+ @Test
+ public void testDeleteStateInvariantsWithOccurrencesOnTop() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ final CompactStateInvariantEditPartCN s1 = findStateInvariantsInDefaultCompactLifeline().get(0);
+ final CompactStateInvariantEditPartCN s2 = findStateInvariantsInDefaultCompactLifeline().get(1);
+ final CompactStateInvariantEditPartCN s3 = findStateInvariantsInDefaultCompactLifeline().get(2);
+ final CompactStateInvariantEditPartCN s4 = findStateInvariantsInDefaultCompactLifeline().get(3);
+ createOccurrenceSpecificationOverCompactStateInvariant(s1, true);
+ createOccurrenceSpecificationOverCompactStateInvariant(s2, false);
+ createOccurrenceSpecificationOverCompactStateInvariant(s3, false);
+ createOccurrenceSpecificationOverCompactStateInvariant(s4, true);
+ flushEventLoop();
+ checkInteractionFragmentsWithPattern("-oo-oo-oo-o");
+ checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
+
+ executeDestroyCommand(s1);
+ checkInteractionFragmentsWithPattern("-oo-oo-o");
+ checkSimpleCompactTimelinePattern("-oo-oo-o");
+ undoOnUIThread();
+ checkInteractionFragmentsWithPattern("-oo-oo-oo-o");
+ checkSimpleCompactTimelinePattern("-oo-oo-oo-o");
+ redoOnUIThread();
+ checkInteractionFragmentsWithPattern("-oo-oo-o");
+ checkSimpleCompactTimelinePattern("-oo-oo-o");
+
+ executeDestroyCommand(s4);
+ checkInteractionFragmentsWithPattern("-oo-o");
+ checkSimpleCompactTimelinePattern("-oo-o");
+
+ executeDestroyCommand(s2);
+ checkInteractionFragmentsWithPattern("-o");
+ checkSimpleCompactTimelinePattern("-o");
+ }
+
+ @Test
+ public void testHideStateInvariants() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(1);
+ executeHideCommand(compactStateInvariantEditPart);
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+ undoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+ redoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleCompactTimelinePattern("-o-o-");
+ }
+
+ @Test
+ public void testCannotDeleteLastStateInvariant() {
+ checkInteractionFragmentsWithPattern("-");
+ checkSimpleCompactTimelinePattern("-");
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(0);
+ final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
+ final Command command = compactStateInvariantEditPart.getCommand(destroyElementRequest);
+ assertFalse("We shouldn't be able to delete the last state invariant", command.canExecute());
+ }
+
+ @Test
+ public void testCannotHideLastStateInvariant() {
+ checkInteractionFragmentsWithPattern("-");
+ checkSimpleCompactTimelinePattern("-");
+ final CompactStateInvariantEditPartCN compactStateInvariantEditPart = findStateInvariantsInDefaultCompactLifeline().get(0);
+ final GroupRequest deleteViewRequest = new GroupRequest(org.eclipse.gef.RequestConstants.REQ_DELETE);
+ deleteViewRequest.setEditParts(compactStateInvariantEditPart);
+ final Command command = compactStateInvariantEditPart.getCommand(deleteViewRequest);
+ assertFalse("We shouldn't be able to hide the last state invariant", command.canExecute());
+ }
+
+ @Test
+ public void testResizeCompactStateInvariant() {
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ flushEventLoop();
+ checkSimpleCompactTimelinePattern("-o-o-o-");
+
+ final List<CompactStateInvariantEditPartCN> stateInvariantsEditParts = findStateInvariantsInDefaultCompactLifeline();
+ assertEquals("Wrong number of StateInvariants", 4, stateInvariantsEditParts.size());
+ final CompactStateInvariantEditPartCN s2 = stateInvariantsEditParts.get(1);
+ final CompactStateInvariantEditPartCN s3 = stateInvariantsEditParts.get(2);
+
+ createOccurrenceSpecificationOverCompactStateInvariant(s2, false);
+ createOccurrenceSpecificationOverCompactStateInvariant(s3, true);
+ flushEventLoop();
+ checkSimpleCompactTimelinePattern("-o-oo-oo-");
+
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultCompactLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 5, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN o1 = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN o2 = occurrenceSpecificationEditParts.get(1);
+ final OccurrenceSpecificationEditPartCN o3 = occurrenceSpecificationEditParts.get(2);
+ final OccurrenceSpecificationEditPartCN o4 = occurrenceSpecificationEditParts.get(3);
+ final OccurrenceSpecificationEditPartCN o5 = occurrenceSpecificationEditParts.get(4);
+
+ final CompactLifelineCompartmentEditPartCN timelineCompartment = getDefaultCompactLifelineTimelineCompartment();
+
+ // test shrink
+ testResizeCompactStateInvariant(s2, -9, o1, o2, o3, o4, o5, timelineCompartment);
+ // test grow
+ testResizeCompactStateInvariant(s2, 42, o1, o2, o3, o4, o5, timelineCompartment);
+ }
+
+ private void testResizeCompactStateInvariant(final CompactStateInvariantEditPartCN s2, final int widthDelta, final OccurrenceSpecificationEditPartCN o1,
+ final OccurrenceSpecificationEditPartCN o2, final OccurrenceSpecificationEditPartCN o3, final OccurrenceSpecificationEditPartCN o4,
+ final OccurrenceSpecificationEditPartCN o5, final CompactLifelineCompartmentEditPartCN timelineCompartment) {
+ final Rectangle o1Before = getBounds(o1);
+ final Rectangle o2Before = getBounds(o2);
+ final Rectangle o3Before = getBounds(o3);
+ final Rectangle o4Before = getBounds(o4);
+ final Rectangle o5Before = getBounds(o5);
+ final Rectangle boundsBefore = getBounds(s2);
+ resizeEditPart(s2, timelineCompartment, new Dimension(widthDelta, 0), PositionConstants.EAST);
+ final Rectangle o1After = getBounds(o1);
+ final Rectangle o2After = getBounds(o2);
+ final Rectangle o3After = getBounds(o3);
+ final Rectangle o4After = getBounds(o4);
+ final Rectangle o5After = getBounds(o5);
+ final Rectangle boundsAfter = getBounds(s2);
+ assertEquals("The Figure should have been resized horizontally", boundsBefore.width + widthDelta, boundsAfter.width);
+ assertEquals("The OccurrenceSpecification before it shouldn't have moved", o1Before.x, o1After.x);
+ assertEquals("The OccurrenceSpecification on top of it shouldn't have moved", o2Before.x, o2After.x);
+ assertEquals("The OccurrenceSpecifications after it should have moved", o3Before.x + widthDelta, o3After.x);
+ assertEquals("The OccurrenceSpecifications on the bottom of another state shouldn't have moved", o4Before.x, o4After.x);
+ assertEquals("The OccurrenceSpecifications after it should have moved", o5Before.x + widthDelta, o5After.x);
+ testUndoRedoChangeBoundsEditPart(s2, boundsBefore);
+ }
+
+ protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
+ assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
+ assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
new file mode 100644
index 00000000000..d032507fc50
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifeline.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.LifelineVerticalLabelCellEditorLocator;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineNameEditPart;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.UMLEditPartFactory;
+import org.eclipse.papyrus.uml.diagram.timing.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.Test;
+
+public class TestTimingDiagramFullLifeline extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ }
+
+ @Test
+ public void testCreateLifeline() {
+ createFullLifelineInDefaultInteraction();
+ }
+
+ @Test
+ public void testHideLifeline() {
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
+ testHide(lifelineEditPart);
+ }
+
+ @Test
+ public void testDeleteLifeline() {
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
+ testDelete(lifelineEditPart);
+ }
+
+ @Test
+ public void testDropLifeline() {
+ // create a Lifeline and hide its View, so as to be able to drop it after that
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
+ final Lifeline lifeline = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ assertNotNull("The lifeline should not be null", lifeline);
+ testHide(lifelineEditPart);
+ testDrop(getDefaultInteractionCompartment(), getDefaultInteractionCompartment(), lifeline);
+ }
+
+ @Test
+ public void testCellEditorLocator() {
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
+ final FullLifelineNameEditPart fullLifelineNameEditPart = (FullLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart,
+ FullLifelineNameEditPart.VISUAL_ID);
+ assertNotNull("The FullLifelineNameEditPart was not found", fullLifelineNameEditPart);
+ final CellEditorLocator textCellEditorLocator = UMLEditPartFactory.getTextCellEditorLocator(fullLifelineNameEditPart);
+ assertTrue("The cell editor locator must be the one specific to the vertical label",
+ textCellEditorLocator instanceof LifelineVerticalLabelCellEditorLocator);
+ }
+
+ @Test
+ public void testEditLifelineName() {
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifelineInDefaultInteraction();
+ final FullLifelineNameEditPart lifelineNameEditPart = (FullLifelineNameEditPart) EditPartUtils.findFirstChildEditPartWithId(lifelineEditPart,
+ FullLifelineNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Lifeline) ((View) lifelineEditPart.getModel()).getElement();
+ testSetNameWithDirectEditRequest(lifelineNameEditPart, namedElement);
+ }
+
+ @Test
+ public void create3LifelinesTest() {
+ final EditPart interactionCompartment = getDefaultInteractionCompartment();
+ assertNotNull("The interaction compartment was not found", interactionCompartment);
+ createView(UMLElementTypes.Lifeline_19, interactionCompartment);
+ createView(UMLElementTypes.Lifeline_19, interactionCompartment);
+ createView(UMLElementTypes.Lifeline_19, interactionCompartment);
+ assertEquals("The interaction compartment should only contain the 3 lifelines", 3, interactionCompartment.getChildren().size());
+ final List<? extends EditPart> editParts = EditPartUtils.findChildEditPartsWithId(interactionCompartment, FullLifelineEditPartCN.VISUAL_ID);
+ assertEquals("The interaction compartment should contain 3 lifelines", 3, editParts.size());
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
new file mode 100644
index 00000000000..d6656d9412e
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullLifelineLayout.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
+import org.junit.Test;
+
+public class TestTimingDiagramFullLifelineLayout extends AbstractTimingDiagramTestCase {
+
+ /**
+ * This tests the layout of StateDefinitions, with some error margins in order to accommodate possible future
+ * modifications of the layout.
+ */
+ @Test
+ public void testStateDefinitionsLayout() {
+ final Point interactionLocation = new Point(12, 17);
+ final Dimension interactionSize = new Dimension(867, 729);
+ final InteractionEditPartTN interactionEditPart = createInteraction(interactionLocation, interactionSize);
+ assertBounds(interactionEditPart, interactionLocation, interactionSize, 0, 0, 0, 0);
+ final FullLifelineEditPartCN lifelineEditPart = createFullLifeline(interactionEditPart);
+ assertBounds(lifelineEditPart, new Rectangle(23, 45, 845, 694), 50, 50, 100, 100);
+ // a single StateDefinition: should be centered
+ final StateDefinitionEditPart stateDefinition1 = createStateDefinition(lifelineEditPart);
+ assertBounds(stateDefinition1, new Rectangle(84, 382, 40, 20), 50, 50, 30, 10);
+ // two StateDefinitions: should be regularly spaced
+ final StateDefinitionEditPart stateDefinition2 = createStateDefinition(lifelineEditPart);
+ assertBounds(stateDefinition1, new Rectangle(84, 266, 40, 20), 50, 50, 30, 10);
+ assertBounds(stateDefinition2, new Rectangle(84, 498, 40, 20), 50, 50, 30, 10);
+ // three StateDefinitions: should be regularly spaced
+ final StateDefinitionEditPart stateDefinition3 = createStateDefinition(lifelineEditPart);
+ assertBounds(stateDefinition1, new Rectangle(84, 151, 40, 20), 50, 50, 30, 10);
+ assertBounds(stateDefinition2, new Rectangle(84, 382, 40, 20), 50, 50, 30, 10);
+ assertBounds(stateDefinition3, new Rectangle(84, 613, 40, 20), 50, 50, 30, 10);
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
new file mode 100644
index 00000000000..9b7d8abbf0b
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullOccurrenceSpecification.java
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineTimelineCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.OccurrenceSpecificationEditPartCN;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+import org.eclipse.uml2.uml.StateInvariant;
+import org.junit.Test;
+
+public class TestTimingDiagramFullOccurrenceSpecification extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ createDefaultFullLifeline();
+ createThreeStateDefinitionsInDefaultFullLifeline();
+ }
+
+ @Test
+ public void testModelWithThreeOccurrenceSpecifications() {
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ final View interactionView = (View) getDefaultInteractionEditPart().getModel();
+ final Interaction interaction = (Interaction) interactionView.getElement();
+ assertTrue("The interaction should be in a Model", isInModel(interaction));
+ // We created 3 OccurrenceSpecifications. The model starts and ends with a StateInvariant, and when creating an
+ // OccurrenceSpecification, we split a StateInvariant in two and insert the OccurrenceSpecification.
+ // So, it should look like : "-o-o-o-" (with "-" for StateInvariant and "O" for OccurrenceSpecification)
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ }
+
+ @Test
+ public void testDeleteOccurrenceSpecification() {
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecifications = findOccurrenceSpecificationsInDefaultFullLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecifications.size());
+ final OccurrenceSpecificationEditPartCN middleOccurrence = occurrenceSpecifications.get(1);
+
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) ((View) middleOccurrence.getModel()).getElement();
+ assertTrue("The OccurrenceSpecification should be in a Model", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+
+ // destroy the middle OccurrenceSpecification
+ final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
+ final Command command = middleOccurrence.getCommand(destroyElementRequest);
+ checkCommand(command);
+ execute(command);
+ assertEquals("There should be one less OccurrenceSpecification", 2, findOccurrenceSpecificationsInDefaultFullLifeline().size());
+ assertFalse("The OccurrenceSpecification should not be in the Model after deleting it", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-");
+
+ // test undo
+ undo();
+ assertEquals("The OccurrenceSpecification should be back after the undo", 3, findOccurrenceSpecificationsInDefaultFullLifeline().size());
+ assertTrue("The OccurrenceSpecification should be back in the Model after undoing the deletion", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+
+ // test redo
+ redo();
+ assertEquals("The OccurrenceSpecification should be removed after the redo", 2, findOccurrenceSpecificationsInDefaultFullLifeline().size());
+ assertFalse("The OccurrenceSpecification should not be in the Model after redoing the deletion", isInModel(occurrenceSpecification));
+ checkInteractionFragmentsWithPattern("-o-o-");
+ }
+
+ @Test
+ public void testCreateOccurrenceSpecificationWithDoubleClick() {
+ final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
+ assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
+ assertEquals("There must always be only one StateInvariant initially", 1, findStateInvariantsInDefaultFullLifeline().size());
+ final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ assertNotNull("The StateInvariant must not be null", stateInvariant);
+
+ final IFigure figure = stateInvariantEditPart.getFigure();
+ final Rectangle bounds = new Rectangle(figure.getBounds());
+ figure.getParent().translateToAbsolute(bounds);
+
+ // click at the center of the StateInvariant line
+ final int x = bounds.x + bounds.width / 2;
+ final int y = bounds.y + bounds.height / 2;
+
+ // send the open request (corresponding to a double-click)
+ sendOpenSelectionRequest(stateInvariantEditPart, new Point(x, y));
+
+ checkCreatedStateInvariants();
+ checkCreatedOccurrenceSpecification();
+
+ // test undo
+ undoOnUIThread();
+ assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultFullLifeline().size());
+ assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultFullLifeline().size());
+
+ // test redo
+ redoOnUIThread();
+ assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultFullLifeline().size());
+ checkCreatedOccurrenceSpecification();
+ }
+
+ @Test
+ public void testCreateOccurrenceSpecificationWithPaletteTool() {
+ // let GMF do its layout (in order for the Figure coordinates to be set)
+ flushEventLoop();
+ final FullStateInvariantEditPartCN stateInvariantEditPart = (FullStateInvariantEditPartCN) EditPartUtils.findFirstChildEditPartWithId(
+ getDefaultFullLifelineEditPart(), FullStateInvariantEditPartCN.VISUAL_ID);
+ assertNotNull("A StateInvariant must always exist", stateInvariantEditPart);
+
+ // use the OccurrenceSpecification creation tool to create a new OccurrenceSpecification
+ clickTool("createOccurrenceSpecificationCreationTool", stateInvariantEditPart);
+
+ checkCreatedStateInvariants();
+ checkCreatedOccurrenceSpecification();
+
+ // test undo
+ undoOnUIThread();
+ assertEquals("There must be one StateInvariant after undo", 1, findStateInvariantsInDefaultFullLifeline().size());
+ assertEquals("There must be no OccurrenceSpecification after undo", 0, findOccurrenceSpecificationsInDefaultFullLifeline().size());
+
+ // test redo
+ redoOnUIThread();
+ assertEquals("There must be two StateInvariants after redo", 2, findStateInvariantsInDefaultFullLifeline().size());
+ checkCreatedOccurrenceSpecification();
+ }
+
+ @Test
+ public void testMoveOccurrenceSpecification() {
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ flushEventLoop();
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 3, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
+ final OccurrenceSpecificationEditPartCN third = occurrenceSpecificationEditParts.get(2);
+
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
+
+ final int minX = getBounds(first).x;
+ final int maxX = getBounds(third).x;
+
+ // shift to the left
+ Rectangle boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-9, 0));
+ Rectangle boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 9 pixels to the left", boundsBefore.x - 9, boundsAfter.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // shift to the right
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(13, 0));
+ boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 13 pixels to the right", boundsBefore.x + 13, boundsAfter.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move past the previous OccurrenceSpecification (should be forbidden)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-(boundsBefore.x - minX + 10), 0));
+ boundsAfter = getBounds(second);
+ assertTrue("The Figure should be constrained, but still move", boundsAfter.x < boundsBefore.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move past the following OccurrenceSpecification (should be forbidden)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(maxX - boundsBefore.x + 10, 0));
+ boundsAfter = getBounds(second);
+ assertTrue("The Figure should be constrained, but still move", boundsAfter.x > boundsBefore.x);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+
+ // try to move horizontally and vertically at the same time (should be constrained to an horizontal-only move)
+ boundsBefore = getBounds(second);
+ moveEditPart(second, timelineCompartment, new Point(-17, 123));
+ boundsAfter = getBounds(second);
+ assertEquals("The Figure should have been moved 17 pixels to the left", boundsBefore.x - 17, boundsAfter.x);
+ assertEquals("The Figure should not move vertically", boundsBefore.y, boundsAfter.y);
+ checkBounds(boundsAfter, minX, maxX);
+ testUndoRedoChangeBoundsEditPart(second, boundsBefore);
+ }
+
+ /**
+ * When moving several OccurrenceSpecifications, we don't want the previous positions of the elements to constrain
+ * the future positions of the elements being moved.
+ */
+ @Test
+ public void testMoveAdjacentOccurrenceSpecifications() {
+ // create two OccurrenceSpecifications close to each other
+ createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(1, 100);
+ createOccurrenceSpecificationInLastFullStateInvariantAtAbsolutePos(2, 10);
+ flushEventLoop();
+
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
+ assertEquals("Wrong number of OccurrenceSpecifications", 2, occurrenceSpecificationEditParts.size());
+
+ final OccurrenceSpecificationEditPartCN first = occurrenceSpecificationEditParts.get(0);
+ final OccurrenceSpecificationEditPartCN second = occurrenceSpecificationEditParts.get(1);
+ final FullLifelineTimelineCompartmentEditPartCN timelineCompartment = getDefaultFullLifelineTimelineCompartment();
+
+ // shift both to the left
+ final Rectangle firstBefore = getBounds(first);
+ final Rectangle secondBefore = getBounds(second);
+ moveEditParts(Arrays.asList(first, second), timelineCompartment, new Point(-50, 0));
+ final Rectangle firstAfter = getBounds(first);
+ final Rectangle secondAfter = getBounds(second);
+ assertEquals("The first Figure should have been moved 50 pixels to the left", firstBefore.x - 50, firstAfter.x);
+ assertEquals("The second Figure should have been moved 50 pixels to the left", secondBefore.x - 50, secondAfter.x);
+ }
+
+ protected static void checkBounds(final Rectangle boundsAfter, final int minX, final int maxX) {
+ assertTrue("The second OccurrenceSpecification should always be after the first", boundsAfter.x > minX);
+ assertTrue("The second OccurrenceSpecification should always be before the third", boundsAfter.x < maxX);
+ }
+
+ @Test
+ public void testMoveVerticalLine() {
+ // TODO: test that moving a vertical line moves the preceding occurrence specification
+ }
+
+ @Test
+ public void testFullUndoRedo() {
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ // 3 OccurrenceSpecifications + 3 StateDefinitions + 1 Lifeline + 1 Interaction
+ final int nElementsToUndo = 8;
+ testDirtyStateForFullUndoRedo(nElementsToUndo);
+ }
+
+ protected void checkCreatedStateInvariants() {
+ // check the StateInvariants
+ final List<FullStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultFullLifeline();
+ assertEquals("There must be two StateInvariants after creating an OccurrenceSpecification", 2, stateInvariantEditParts.size());
+ checkStateInvariant(stateInvariantEditParts.get(0));
+ checkStateInvariant(stateInvariantEditParts.get(1));
+ }
+
+ private void checkCreatedOccurrenceSpecification() {
+ final List<OccurrenceSpecificationEditPartCN> occurrenceSpecificationEditParts = findOccurrenceSpecificationsInDefaultFullLifeline();
+ assertEquals("There must be one OccurrenceSpecification", 1, occurrenceSpecificationEditParts.size());
+ final OccurrenceSpecificationEditPartCN occurrenceSpecificationEditPart = occurrenceSpecificationEditParts.get(0);
+ final View occurrenceSpecificationView = (View) occurrenceSpecificationEditPart.getModel();
+ final OccurrenceSpecification occurrenceSpecification = (OccurrenceSpecification) occurrenceSpecificationView.getElement();
+ assertNotNull("The OccurrenceSpecification must not be null", occurrenceSpecification);
+ assertTrue("The OccurrenceSpecification must be in the model", isInModel(occurrenceSpecification));
+ assertEquals("The OccurrenceSpecification must cover one Lifeline", 1, occurrenceSpecification.getCovereds().size());
+ final Lifeline lifeline = (Lifeline) ((View) getDefaultFullLifelineEditPart().getModel()).getElement();
+ assertEquals("The OccurrenceSpecification must cover the Lifeline", lifeline, occurrenceSpecification.getCovereds().get(0));
+ final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ assertTrue("The OccurrenceSpecification must be in the Interaction", interaction.getFragments().contains(occurrenceSpecification));
+ }
+
+ private void checkStateInvariant(final FullStateInvariantEditPartCN fullStateInvariantEditPartCN) {
+ final View stateInvariantView = (View) fullStateInvariantEditPartCN.getModel();
+ final StateInvariant stateInvariant = (StateInvariant) stateInvariantView.getElement();
+ assertNotNull("The StateInvariant must not be null", stateInvariant);
+ assertTrue("The StateInvariant must be in the model", isInModel(stateInvariant));
+ assertEquals("The StateInvariant must cover one Lifeline", 1, stateInvariant.getCovereds().size());
+ final Lifeline lifeline = (Lifeline) ((View) getDefaultFullLifelineEditPart().getModel()).getElement();
+ assertEquals("The StateInvariant must cover the Lifeline", lifeline, stateInvariant.getCovereds().get(0));
+ final Interaction interaction = (Interaction) ((View) getDefaultInteractionEditPart().getModel()).getElement();
+ assertTrue("The StateInvariant must be in the Interaction", interaction.getFragments().contains(stateInvariant));
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
new file mode 100644
index 00000000000..1908fb3e67d
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramFullStateInvariant.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionEditPart;
+import org.junit.Test;
+
+public class TestTimingDiagramFullStateInvariant extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction(new Point(0, 0), new Dimension(800, 600));
+ createDefaultFullLifeline();
+ createThreeStateDefinitionsInDefaultFullLifeline();
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ }
+
+ @Test
+ public void testMoveStateInvariants() {
+ final List<FullStateInvariantEditPartCN> stateInvariantEditParts = findStateInvariantsInDefaultFullLifeline();
+ assertEquals("We should have 4 StateInvariants at the beginning of this test", 4, stateInvariantEditParts.size());
+ final List<StateDefinitionEditPart> stateDefinitionEditParts = findStateDefinitions();
+ assertEquals("We should have 3 StateDefinitions at the beginning of this test", 3, stateDefinitionEditParts.size());
+
+ // computeTimelineStringPattern();
+ checkFullTimelinePattern("StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_3_To_State 1_4);VerticalLine;" + "StateInvariant(State 1);");
+
+ final Rectangle stateDefBounds1 = getAbsoluteBounds(stateDefinitionEditParts.get(0));
+ final Rectangle stateDefBounds2 = getAbsoluteBounds(stateDefinitionEditParts.get(1));
+ // final Rectangle stateDefBounds3 = getAbsoluteBounds(stateDefinitionEditParts.get(2));
+ final int distanceBetweenStates = stateDefBounds2.y - stateDefBounds1.y;
+
+ // final Rectangle stateInvBounds1 = getAbsoluteBounds(stateInvariantEditParts.get(0));
+ // final Rectangle stateInvBounds2 = getAbsoluteBounds(stateInvariantEditParts.get(1));
+ // final Rectangle stateInvBounds3 = getAbsoluteBounds(stateInvariantEditParts.get(2));
+ // final Rectangle stateInvBounds4 = getAbsoluteBounds(stateInvariantEditParts.get(3));
+
+ // TODO: check state invariant in front of state definitions
+
+ moveEditPart(stateInvariantEditParts.get(0), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_2_To_State 1_3);VerticalLine;StateInvariant(State 1);");
+ moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 1_2);VerticalLine;StateInvariant(State 1);");
+ moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;StateInvariant(State 2);");
+ moveEditPart(stateInvariantEditParts.get(3), getDefaultFullLifelineTimelineCompartment(), new Point(0, distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 1_1);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 3_2);VerticalLine;StateInvariant(State 3);");
+ moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, 2 * distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 3_2);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_2_To_State 3_3);VerticalLine;StateInvariant(State 3);");
+ moveEditPart(stateInvariantEditParts.get(2), getDefaultFullLifelineTimelineCompartment(), new Point(0, -distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 3_1);VerticalLine;"
+ + "StateInvariant(State 3);OccurrenceSpecification(State 3_1_To_State 2_2);VerticalLine;"
+ + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_2);VerticalLine;StateInvariant(State 3);");
+ moveEditPart(stateInvariantEditParts.get(1), getDefaultFullLifelineTimelineCompartment(), new Point(0, -2 * distanceBetweenStates));
+ checkFullTimelinePattern("StateInvariant(State 2);OccurrenceSpecification(State 2_1_To_State 1_1);VerticalLine;"
+ + "StateInvariant(State 1);OccurrenceSpecification(State 1_1_To_State 2_2);VerticalLine;"
+ + "StateInvariant(State 2);OccurrenceSpecification(State 2_2_To_State 3_1);VerticalLine;StateInvariant(State 3);");
+ }
+
+ @Test
+ public void testDeleteStateInvariants() {
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-o|-");
+ final FullStateInvariantEditPartCN stateInvariantEditPart = findStateInvariantsInDefaultFullLifeline().get(1);
+ executeDestroyCommand(stateInvariantEditPart);
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-");
+ undoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-o|-");
+ redoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-");
+ }
+
+ @Test
+ public void testHideStateInvariants() {
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-o|-");
+ final FullStateInvariantEditPartCN stateInvariantEditPart = findStateInvariantsInDefaultFullLifeline().get(1);
+ executeHideCommand(stateInvariantEditPart);
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-");
+ undoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-o|-");
+ redoOnUIThread();
+ checkInteractionFragmentsWithPattern("-o-o-o-");
+ checkSimpleFullTimelinePattern("-o|-o|-");
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
new file mode 100644
index 00000000000..ad64befd2d6
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramInteraction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionEditPartTN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.InteractionNameEditPart;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.Test;
+
+public class TestTimingDiagramInteraction extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ }
+
+ @Test
+ public void testCreateInteraction() {
+ createInteraction();
+ }
+
+ @Test
+ public void testHideInteraction() {
+ final InteractionEditPartTN interaction = createInteraction();
+ testHide(interaction);
+ }
+
+ @Test
+ public void testDeleteInteraction() {
+ final InteractionEditPartTN interaction = createInteraction();
+ testDelete(interaction);
+ }
+
+ @Test
+ public void testDropInteraction() {
+ // create an Interaction and hide its View, so as to be able to drop it after that
+ final InteractionEditPartTN interactionEditPart = createInteraction();
+ final Interaction interaction = (Interaction) ((View) interactionEditPart.getModel()).getElement();
+ assertNotNull("The interaction should not be null", interaction);
+ hide(interactionEditPart);
+
+ testDrop(getDiagramEditPart(), getDiagramEditPart(), interaction);
+ }
+
+ @Test
+ public void testCreateThreeInteractions() {
+ final InteractionEditPartTN interaction1 = createInteraction();
+ final InteractionEditPartTN interaction2 = createInteraction();
+ final InteractionEditPartTN interaction3 = createInteraction();
+ assertEquals("The diagram should only contain the 3 interactions", 3, getDiagramEditPart().getChildren().size());
+ assertTrue("The first interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction1));
+ assertTrue("The second interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction2));
+ assertTrue("The third interaction should be found in the diagram", getDiagramEditPart().getChildren().contains(interaction3));
+ }
+
+ @Test
+ public void testEditInteractionName() {
+ final InteractionEditPartTN interactionEditPart = createInteraction();
+ final InteractionNameEditPart interactionNameEditPart = (InteractionNameEditPart) EditPartUtils.findFirstChildEditPartWithId(interactionEditPart,
+ InteractionNameEditPart.VISUAL_ID);
+ final NamedElement namedElement = (Interaction) ((View) interactionEditPart.getModel()).getElement();
+ testSetNameWithDirectEditRequest(interactionNameEditPart, namedElement);
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
new file mode 100644
index 00000000000..5a8cbdb3a2d
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramMessages.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import org.eclipse.swt.widgets.Text;
+import org.junit.Test;
+
+public class TestTimingDiagramMessages extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ createDefaultFullLifeline();
+ createDefaultCompactLifeline();
+ createStateDefinitionInDefaultFullLifeline();
+ createThreeOccurrenceSpecificationsInDefaultFullLifeline();
+ createThreeOccurrenceSpecificationsInDefaultCompactLifeline();
+ }
+
+ @Test
+ public void testCreateSyncMessage() {
+ clickTwiceWithTool("createMessageSyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0),
+ findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
+ final Text text = findVisibleTextWidgetOnDiagram();
+ setText(text, "abc");
+
+ checkSimpleFullTimelinePattern("-m|-o|-o|-");
+ checkSimpleCompactTimelinePattern("-o-m-o-");
+ checkInteractionFragmentsWithPattern("--m-o-o-o-m-o-");
+
+ // TODO: check covered fragments on lifelines
+ // TODO: check sync Message instance
+ }
+
+ @Test
+ public void testCreateAsyncMessage() {
+ clickTwiceWithTool("createMessageAsyncCreationTool", findOccurrenceSpecificationsInDefaultFullLifeline().get(0),
+ findOccurrenceSpecificationsInDefaultCompactLifeline().get(1));
+ final Text text = findVisibleTextWidgetOnDiagram();
+ setText(text, "def");
+ // TODO: check async Message instance
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
new file mode 100644
index 00000000000..54100b5e855
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/canonical/TestTimingDiagramStateDefinition.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.canonical;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Map.Entry;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.EditPartUtils;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateDefinitionUtils;
+import org.eclipse.papyrus.uml.diagram.timing.custom.utils.StateInvariantUtils;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullLifelineStateDefinitionCompartmentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.FullStateInvariantEditPartCN;
+import org.eclipse.papyrus.uml.diagram.timing.edit.parts.StateDefinitionLabelEditPart;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.StateInvariant;
+import org.junit.Test;
+
+public class TestTimingDiagramStateDefinition extends AbstractTimingDiagramTestCase {
+
+ @Override
+ public void setUp() throws Exception {
+ // create the project, model and diagram
+ super.setUp();
+ createDefaultInteraction();
+ createDefaultFullLifeline();
+ }
+
+ @Test
+ public void testCreateStateDefinition() {
+ final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
+ final EditPart stateInvariantEditPart = EditPartUtils.findFirstChildEditPartWithId(getDefaultFullLifelineEditPart(),
+ FullStateInvariantEditPartCN.VISUAL_ID);
+ assertNotNull("A StateInvariant must be created with the first StateDefinition", stateInvariantEditPart);
+ final StateInvariant stateInvariant = (StateInvariant) ((View) stateInvariantEditPart.getModel()).getElement();
+ assertNotNull("The StateInvariant must not be null", stateInvariant);
+ final String stateInvariantId = StateInvariantUtils.getStateInvariantId(stateInvariant);
+ assertNotNull("The StateInvariant id must not be null", stateInvariantId);
+ final String stateDefinitionViewID = StateDefinitionUtils.getStateDefinitionViewID((View) stateDefinition.getModel());
+ assertEquals("The ids of the StateDefinition and the StateInvariant must be equal", stateDefinitionViewID, stateInvariantId);
+
+ }
+
+ @Test
+ public void testCreateMultipleStateDefinitions() {
+ createStateDefinitionInDefaultFullLifeline();
+ expectNStateDefinitions(1);
+ createStateDefinitionInDefaultFullLifeline();
+ expectNStateDefinitions(2);
+ undoOnUIThread();
+ expectNStateDefinitions(1);
+ redoOnUIThread();
+ expectNStateDefinitions(2);
+ createStateDefinitionInDefaultFullLifeline();
+ expectNStateDefinitions(3);
+ undoOnUIThread();
+ expectNStateDefinitions(2);
+ redoOnUIThread();
+ expectNStateDefinitions(3);
+ }
+
+ private void expectNStateDefinitions(final int numberOfExpectedStateDefinitions) {
+ assertEquals("There must be " + numberOfExpectedStateDefinitions + " StateDefinitionEditPart", numberOfExpectedStateDefinitions, findStateDefinitions()
+ .size());
+ }
+
+ /**
+ * Creates a new StateDefinition by clicking using the StateDefinition palette tool (this is important to test
+ * because we customized this tool).
+ */
+ @Test
+ public void testCreateStateDefinitionWithPaletteTool() {
+ final FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment = getDefaultStateDefinitionCompartment();
+ // let GMF do its layout
+ flushEventLoop();
+ final int nChildrenBefore = stateDefinitionCompartment.getChildren().size();
+ final Rectangle bounds = stateDefinitionCompartment.getFigure().getBounds();
+ stateDefinitionCompartment.getFigure().getParent().translateToAbsolute(bounds);
+ // click center at the top of the compartment
+ final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + 1);
+ // use the StateDefinition creation tool to create a new StateDefinition
+ clickTool("createStateDefinitionCreationTool", point);
+ final Text text = findVisibleTextWidgetOnDiagram();
+ assertEquals("The state definition compartment should contain one more child", nChildrenBefore + 1, stateDefinitionCompartment.getChildren().size());
+ assertNotNull("A Text cell editor should appear after creating a StateDefinition", text);
+ final String newName = "state " + System.currentTimeMillis();
+ setText(text, newName);
+ checkStateDefinition(newName);
+ }
+
+ /**
+ * Check that there is a StateDefinition with the given name.
+ *
+ * @param expectedName
+ * the name of a StateDefinition that should exist.
+ */
+ protected void checkStateDefinition(final String expectedName) {
+ final View lifelineView = (View) getDefaultFullLifelineEditPart().getModel();
+ final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
+ assertNotNull("The lifeline should have an EAnnotation for the state definitions", stateDefinitionsEAnnotation);
+
+ // find the entry corresponding to the new StateDefinition
+ Entry<String, String> newEntry = null;
+ final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
+ for (final Entry<String, String> entry : details) {
+ if (expectedName.equals(entry.getValue())) {
+ newEntry = entry;
+ break;
+ }
+ }
+ assertNotNull("The Lifeline's EAnnotation should contain an entry for the StateDefinition", newEntry);
+ @SuppressWarnings("null")
+ final String id = newEntry.getKey();
+ final View stateDefinitionView = StateDefinitionUtils.getStateDefinitionViewWithId(id, lifelineView);
+ final String stateDefinitionName = StateDefinitionUtils.getStateDefinitionName(stateDefinitionView);
+ assertEquals("getStateDefinitionName should return the name of the StateDefinition", expectedName, stateDefinitionName);
+ }
+
+ /** Check that no StateDefinition exists with the given name. */
+ protected void checkNoStateDefinition(final String unexpectedName) {
+ final View lifelineView = (View) getDefaultFullLifelineEditPart().getModel();
+ final Lifeline lifeline = (Lifeline) lifelineView.getElement();
+ final EAnnotation stateDefinitionsEAnnotation = StateDefinitionUtils.getStateDefinitionsEAnnotation(lifeline);
+ if (stateDefinitionsEAnnotation == null) {
+ return;
+ }
+ // find the entry corresponding to the new StateDefinition
+ final EMap<String, String> details = stateDefinitionsEAnnotation.getDetails();
+ for (final Entry<String, String> entry : details) {
+ if (unexpectedName.equals(entry.getValue())) {
+ fail("A StateDefinition with the given name exists");
+ }
+ }
+ }
+
+ @Test
+ public void testDeleteStateDefinition() {
+ final EditPart stateDefinition1 = createStateDefinitionInDefaultFullLifeline();
+ final EditPart stateDefinition2 = createStateDefinitionInDefaultFullLifeline();
+ final EditPart stateDefinition3 = createStateDefinitionInDefaultFullLifeline();
+
+ final GroupRequest deleteRequest1 = new GroupRequest(RequestConstants.REQ_DELETE);
+ deleteRequest1.setEditParts(stateDefinition1);
+ final Command command1 = stateDefinition1.getCommand(deleteRequest1);
+ assertTrue("The first StateDefinition should not be deletable since a StateInvariant uses it", command1 instanceof UnexecutableCommand);
+
+ testDeleteStateDefinition(stateDefinition2, "second state definition for testDeleteStateDefinition");
+ testDeleteStateDefinition(stateDefinition3, "third state definition for testDeleteStateDefinition");
+ }
+
+ protected void testDeleteStateDefinition(final EditPart stateDefinition, final String name) {
+ // set a name before deleting so that we can then check whether it was really deleted/re-created
+ setNameWithDirectEditRequest(getStateDefinitionLabelEditPart(stateDefinition), name);
+ checkStateDefinition(name);
+
+ final FullLifelineStateDefinitionCompartmentEditPartCN stateDefinitionCompartment = getDefaultStateDefinitionCompartment();
+ final int sizeBefore = stateDefinitionCompartment.getChildren().size();
+
+ // this is actually a "hide" instead of a "delete", since StateDefinition has no UML semantic element
+ final GroupRequest deleteRequest = new GroupRequest(RequestConstants.REQ_DELETE);
+ deleteRequest.setEditParts(stateDefinition);
+ final Command command = stateDefinition.getCommand(deleteRequest);
+ checkCommand(command);
+ executeOnUIThread(command);
+ assertEquals("The StateDefinition compartment should now contain one less child", sizeBefore - 1, stateDefinitionCompartment.getChildren().size());
+ checkNoStateDefinition(name);
+ undoOnUIThread();
+ assertEquals("The child should be back after the undo", sizeBefore, stateDefinitionCompartment.getChildren().size());
+ checkStateDefinition(name);
+ redoOnUIThread();
+ assertEquals("The child should be removed after the redo", sizeBefore - 1, stateDefinitionCompartment.getChildren().size());
+ checkNoStateDefinition(name);
+ }
+
+ @Test
+ public void testEditStateDefinitionName() {
+ final EditPart stateDefinition = createStateDefinitionInDefaultFullLifeline();
+ final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = getStateDefinitionLabelEditPart(stateDefinition);
+ // set first name
+ final String name1 = "test name 1 " + System.currentTimeMillis();
+ setNameWithDirectEditRequest(stateDefinitionLabelEditPart, name1);
+ checkStateDefinition(name1);
+ // set second name
+ final String name2 = "test name 2 " + System.currentTimeMillis();
+ setNameWithDirectEditRequest(stateDefinitionLabelEditPart, name2);
+ checkStateDefinition(name2);
+ checkNoStateDefinition(name1);
+ // test undo
+ undo();
+ checkStateDefinition(name1);
+ checkNoStateDefinition(name2);
+ // test redo
+ redo();
+ checkStateDefinition(name2);
+ checkNoStateDefinition(name1);
+
+ // TODO: check fragment names are updated when changing the state definition name
+ }
+
+ private static StateDefinitionLabelEditPart getStateDefinitionLabelEditPart(final EditPart stateDefinitionEditPart) {
+ final StateDefinitionLabelEditPart stateDefinitionLabelEditPart = (StateDefinitionLabelEditPart) EditPartUtils.findFirstChildEditPartWithId(
+ stateDefinitionEditPart, StateDefinitionLabelEditPart.VISUAL_ID);
+ return stateDefinitionLabelEditPart;
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
new file mode 100644
index 00000000000..ff7ae7796ed
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.uml.diagram.timing.tests/src/org/eclipse/papyrus/uml/diagram/timing/tests/generic/AbstractPapyrusTestCase.java
@@ -0,0 +1,1094 @@
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.timing.tests.generic;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.operations.IOperationHistory;
+import org.eclipse.core.commands.operations.IOperationHistoryListener;
+import org.eclipse.core.commands.operations.OperationHistoryEvent;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
+import org.eclipse.papyrus.uml.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand;
+import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.After;
+import org.junit.Before;
+
+// DiResourceSet is deprecated but we need it for CreateUMLModelCommand
+@SuppressWarnings({ "deprecation" })
+public abstract class AbstractPapyrusTestCase {
+
+ protected PapyrusMultiDiagramEditor papyrusEditor;
+ protected DiResourceSet diResourceSet;
+ protected IProject project;
+ protected IFile file;
+ protected IWorkbenchPage page;
+ protected UmlGmfDiagramEditor diagramEditor = null;
+ protected DiagramEditPart diagramEditPart;
+ protected boolean operationFailed = false;
+
+ @Before
+ public void setUp() throws Exception {
+ // add a listener for failed operations
+ OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(new IOperationHistoryListener() {
+
+ public void historyNotification(final OperationHistoryEvent event) {
+ if (event.getEventType() == OperationHistoryEvent.OPERATION_NOT_OK) {
+ AbstractPapyrusTestCase.this.operationFailed = true;
+ }
+ }
+ });
+
+ // disable useless animations (slows down unit tests)
+ PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.ENABLE_ANIMATIONS, false);
+ // maximize the workbench window
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ maximize();
+ // closeAllViewsAndEditors();
+ }
+ });
+ // create a project, model, diagram, and open the diagram in the associated Papyrus editor
+ projectCreation();
+ }
+
+ /**
+ * Reset the "operation failed" state. Call this before executing each operation for which you want to test whether
+ * if failed with {@link AbstractPapyrusTestCase#assertLastOperationSuccessful()}.
+ */
+ protected void resetLastOperationFailedState() {
+ this.operationFailed = false;
+ }
+
+ /**
+ * Asserts that no Command executed on the {@link IOperationHistory} since the last call to
+ * {@link AbstractPapyrusTestCase#resetLastOperationFailedState resetLastOperationFailedState} returned
+ * {@link OperationHistoryEvent#OPERATION_NOT_OK}.
+ *
+ */
+ protected void assertLastOperationSuccessful() {
+ assertFalse(
+ "The operation failed. Look at the log, or put a breakpoint on ExecutionException or DefaultOperationHistory#notifyNotOK to find the cause.",
+ this.operationFailed);
+ }
+
+ protected View getRootView() {
+ return getDiagramEditPart().getDiagramView();
+ }
+
+ protected Element getRootSemanticModel() {
+ return (Element) getRootView().getElement();
+ }
+
+ protected UmlGmfDiagramEditor getDiagramEditor() {
+ return this.diagramEditor;
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ this.papyrusEditor.doSave(new NullProgressMonitor());
+ // diResourceSet.save( new NullProgressMonitor());
+ // diagramEditor.close(true);
+ this.papyrusEditor = null;
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ closeAllEditors();
+ }
+ });
+ this.project.delete(true, new NullProgressMonitor());
+ }
+
+ protected void closeAllEditors() {
+ this.page.closeAllEditors(false);
+ }
+
+ protected DiagramEditPart getDiagramEditPart() {
+ if (this.diagramEditPart == null) {
+ this.diagramEditor = (UmlGmfDiagramEditor) this.papyrusEditor.getActiveEditor();
+ final GraphicalViewer graphicalViewer = ((GraphicalViewer) this.diagramEditor.getAdapter(GraphicalViewer.class));
+ this.diagramEditPart = (DiagramEditPart) graphicalViewer.getContents().getRoot().getChildren().get(0);
+ }
+ return this.diagramEditPart;
+ }
+
+ protected abstract ICreationCommand getDiagramCommandCreation();
+
+ protected void projectCreation() throws Exception {
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IWorkspaceRoot root = workspace.getRoot();
+ final String timestamp = Long.toString(System.currentTimeMillis());
+ this.project = root.getProject("DiagramTestProject_" + timestamp);
+ this.file = this.project.getFile("DiagramTest_" + timestamp + ".di"); //$NON-NLS-2$
+ this.diResourceSet = new DiResourceSet();
+ // at this point, no resources have been created
+ if (!this.project.exists()) {
+ this.project.create(null);
+ }
+ if (!this.project.isOpen()) {
+ this.project.open(null);
+ }
+
+ if (this.file.exists()) {
+ this.file.delete(true, new NullProgressMonitor());
+ }
+
+ if (!this.file.exists()) {
+ this.file.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
+ this.diResourceSet.createsModels(this.file);
+ new CreateUMLModelCommand().createModel(this.diResourceSet);
+ // diResourceSet.createsModels(file);
+ final ICreationCommand command = getDiagramCommandCreation();
+ command.createDiagram(this.diResourceSet, null, "DiagramToTest");
+ this.diResourceSet.save(new NullProgressMonitor());
+
+ }
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ try {
+ openPapyrusEditor();
+ } catch (final Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ }
+
+ protected static void maximize() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setMaximized(true);
+ }
+
+ protected static void closeAllViewsAndEditors() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ for (final IWorkbenchWindow workbenchWindow : workbench.getWorkbenchWindows()) {
+ final IWorkbenchPage[] pages = workbenchWindow.getPages();
+ for (final IWorkbenchPage page : pages) {
+ final IViewReference[] viewReferences = page.getViewReferences();
+ for (final IViewReference viewReference : viewReferences) {
+ page.hideView(viewReference);
+ }
+ page.closeAllEditors(false);
+ }
+ }
+ }
+
+ protected void openPapyrusEditor() throws Exception {
+ this.page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ final IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(this.file.getName());
+ final IEditorPart editorPart = this.page.openEditor(new FileEditorInput(this.file), desc.getId());
+ assertTrue("The editor must be a " + PapyrusMultiDiagramEditor.class.getSimpleName(), editorPart instanceof PapyrusMultiDiagramEditor);
+ // maximize the editor
+ final IWorkbenchPartReference reference = this.page.getReference(editorPart);
+ editorPart.getSite().getPage().toggleZoom(reference);
+ this.papyrusEditor = ((PapyrusMultiDiagramEditor) editorPart);
+ }
+
+ /**
+ * Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
+ * type.
+ *
+ * <ul>
+ * <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
+ * <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
+ * </ul>
+ *
+ * @param elementType
+ * the type for which to create a view (and possibly a model element)
+ * @param parentEditPart
+ * the edit part to which the creation request must be sent
+ * @return the created View
+ */
+ protected View createView(final IElementType elementType, final EditPart parentEditPart) {
+ return createView(elementType, null, null, parentEditPart);
+ }
+
+ /**
+ * Create a view for the given type, plus the associated semantic element unless the given type is a notation-only
+ * type.
+ *
+ * <ul>
+ * <li>if type is an {@link INotationType}, then create a view using a {@link CreateViewRequest}
+ * <li>otherwise, create a view and the corresponding semantic element using a CreateViewAndElementRequest
+ * </ul>
+ *
+ * @param elementType
+ * the type for which to create a view (and possibly a model element)
+ * @param location
+ * the position of the new view (may be <code>null</code>)
+ * @param size
+ * the size of the new view (may be <code>null</code>)
+ * @param parentEditPart
+ * the edit part to which the creation request must be sent
+ * @return the created View
+ */
+ protected View createView(final IElementType elementType, final Point location, final Dimension size, final EditPart parentEditPart) {
+ final View[] result = new View[1];
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ final CreateViewRequest createRequest = CreateViewRequestFactory.getCreateShapeRequest(elementType, getDiagramEditPart()
+ .getDiagramPreferencesHint());
+ if (size != null) {
+ createRequest.setSize(size);
+ }
+ if (location != null) {
+ createRequest.setLocation(location);
+ }
+ final Command command = parentEditPart.getCommand(createRequest);
+ checkCommand(command);
+ execute(command);
+
+ result[0] = getCreatedViewFromCommand(command);
+ }
+ });
+ return result[0];
+ }
+
+ protected static View getCreatedViewFromCommand(final Command command) {
+ final List<CreateCommand> createCommands = new ArrayList<CreateCommand>();
+ findNestedCreateCommands(command, createCommands);
+ assertEquals("There should be one CreateCommand inside the command", 1, createCommands.size());
+ final Object returnValue = createCommands.get(0).getCommandResult().getReturnValue();
+ if (returnValue instanceof IAdaptable) {
+ final IAdaptable adaptableResult = (IAdaptable) returnValue;
+ final View view = (View) adaptableResult.getAdapter(View.class);
+ if (view != null) {
+ return view;
+ }
+ }
+ fail("CreateView command result not found");
+ return null;
+ }
+
+ private static void findNestedCreateCommands(final Command gefCommand, final List<CreateCommand> createCommands) {
+ if (gefCommand instanceof CompoundCommand) {
+ final CompoundCommand compoundCommand = (CompoundCommand) gefCommand;
+ @SuppressWarnings("unchecked")
+ final List<Command> commands = compoundCommand.getCommands();
+ for (final Command childCommand : commands) {
+ findNestedCreateCommands(childCommand, createCommands);
+ }
+ } else if (gefCommand instanceof ICommandProxy) {
+ final ICommandProxy commandProxy = (ICommandProxy) gefCommand;
+ final ICommand iCommand = commandProxy.getICommand();
+ findNestedCreateCommands(iCommand, createCommands);
+ }
+ }
+
+ private static void findNestedCreateCommands(final ICommand gmfCommand, final List<CreateCommand> createCommands) {
+ if (gmfCommand instanceof CompositeCommand) {
+ final CompositeCommand compositeCommand = (CompositeCommand) gmfCommand;
+ final Iterator<?> iterator = compositeCommand.iterator();
+ while (iterator.hasNext()) {
+ final Object element = iterator.next();
+ if (element instanceof ICommand) {
+ final ICommand subCommand = (ICommand) element;
+ findNestedCreateCommands(subCommand, createCommands);
+ } else {
+ fail("error");
+ }
+ }
+ } else if (gmfCommand instanceof CreateCommand) {
+ createCommands.add((CreateCommand) gmfCommand);
+ } else if (gmfCommand instanceof CommandProxy) {
+ final CommandProxy commandProxy = (CommandProxy) gmfCommand;
+ findNestedCreateCommands(commandProxy.getCommand(), createCommands);
+ }
+ }
+
+ /**
+ * This tests the deletion of the View for the given GraphicalEditPart (this checks that the View is removed, but
+ * the semantic model is untouched).
+ */
+ protected void testHide(final GraphicalEditPart editPart) {
+ final EditPart parent = editPart.getParent();
+ final int sizeBefore = parent.getChildren().size();
+ final EObject semanticElement = ((View) editPart.getModel()).getElement();
+ assertTrue("The semantic element should be in a Model", isInModel(semanticElement));
+
+ executeHideCommand(editPart);
+ assertEquals("The parent edit part should now contain one less child", sizeBefore - 1, parent.getChildren().size());
+ assertTrue("The semantic element should still be in the Model after deleting the View", isInModel(semanticElement));
+ undo();
+ assertEquals("The child should be back after the undo", sizeBefore, parent.getChildren().size());
+ assertTrue("The semantic element should still be in the Model after undoing the View deletion", isInModel(semanticElement));
+ redo();
+ assertEquals("The child should be removed after the redo", sizeBefore - 1, parent.getChildren().size());
+ assertTrue("The semantic element should still be in the Model after redoing the View deletion", isInModel(semanticElement));
+ }
+
+ /**
+ * Send the given EditPart a "delete" request (which only deletes the View), and execute the returned command.
+ *
+ * @param editPart
+ * the EditPart to hide
+ */
+ protected void executeHideCommand(final GraphicalEditPart editPart) {
+ final GroupRequest deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
+ deleteViewRequest.setEditParts(editPart);
+ final Command command = editPart.getCommand(deleteViewRequest);
+ checkCommand(command);
+ execute(command);
+ }
+
+ /** This tests the destruction of both the model and View for the given GraphicalEditPart. */
+ protected void testDelete(final GraphicalEditPart editPart) {
+ final EditPart parent = editPart.getParent();
+ final int sizeBefore = parent.getChildren().size();
+ final EObject semanticElement = ((View) editPart.getModel()).getElement();
+ assertTrue("The semantic element should be in a Model", isInModel(semanticElement));
+
+ executeDestroyCommand(editPart);
+ assertEquals("The parent edit part should now contain one less child", sizeBefore - 1, parent.getChildren().size());
+ assertFalse("The semantic element should not be in the Model any more after deleting it", isInModel(semanticElement));
+ undo();
+ assertEquals("The child should be back after the undo", sizeBefore, parent.getChildren().size());
+ assertTrue("The semantic element should be back in the Model after undoing the deletion", isInModel(semanticElement));
+ redo();
+ assertEquals("The child should be removed after the redo", sizeBefore - 1, parent.getChildren().size());
+ assertFalse("The semantic element should not be in the Model after redoing the deletion", isInModel(semanticElement));
+ }
+
+ /**
+ * Send the given EditPart a {@link DestroyElementRequest}, and execute the returned command.
+ *
+ * @param editPart
+ * the EditPart to destroy
+ */
+ protected void executeDestroyCommand(final GraphicalEditPart editPart) {
+ final Request destroyElementRequest = new EditCommandRequestWrapper(new DestroyElementRequest(false));
+ final Command command = editPart.getCommand(destroyElementRequest);
+ checkCommand(command);
+ execute(command);
+ }
+
+ /**
+ * @param targetEditPart
+ * the EditPart on top of which the drop will happen. This will determine the coordinates of the drop.
+ * @param parentEditPart
+ * the EditPart in which the element will really be added. Often the same EditPart as targetEditPart,
+ * unless dropping on top of the first EditPart puts the element in another edit part.
+ * @param droppedElement
+ * the element to drop
+ */
+ public void testDrop(final GraphicalEditPart targetEditPart, final GraphicalEditPart parentEditPart, final EObject droppedElement) {
+ final int sizeBefore = parentEditPart.getChildren().size();
+ final DropObjectsRequest dropObjectsRequest = new DropObjectsRequest();
+ final ArrayList<EObject> list = new ArrayList<EObject>();
+ list.add(droppedElement);
+ dropObjectsRequest.setObjects(list);
+ dropObjectsRequest.setLocation(new Point(1, 1));
+ final Command command = targetEditPart.getCommand(dropObjectsRequest);
+ checkCommand(command);
+ execute(command);
+ assertEquals("The parent edit part should now contain one more child", sizeBefore + 1, parentEditPart.getChildren().size());
+ assertTrue("The dropped element should now be in the Model", isInModel(droppedElement));
+ undo();
+ assertEquals("The editpart should be removed after undo", sizeBefore, parentEditPart.getChildren().size());
+ assertTrue("The semantic element should still be in the Model after undoing the drop", isInModel(droppedElement));
+ redo();
+ assertEquals("The parent edit part should contain one more child after redo", sizeBefore + 1, parentEditPart.getChildren().size());
+ assertTrue("The dropped element should be in the Model after redo", isInModel(droppedElement));
+ }
+
+ /**
+ * Return whether the given model element is contained by a UML {@link Model}. This is useful in order to determine
+ * if an element was deleted (removed from the Model).
+ */
+ protected static boolean isInModel(final EObject semanticElement) {
+ EObject parent = semanticElement.eContainer();
+ while (parent != null) {
+ if (parent instanceof Model) {
+ return true;
+ }
+ parent = parent.eContainer();
+ }
+ return false;
+ }
+
+ /** Check that the given command is executable. */
+ protected static void checkCommand(final Command command) {
+ assertNotNull("The command must not be null", command);
+ assertTrue("The command must be executable", command.canExecute());
+ }
+
+ /** The command stack to use to execute commands on the diagram. */
+ protected CommandStack getCommandStack() {
+ // not "diagramEditor.getDiagramEditDomain().getDiagramCommandStack()" because it messes up undo contexts
+ return this.diagramEditor.getEditingDomain().getCommandStack();
+ }
+
+ /** Execute the given command in the diagram editor. */
+ protected void execute(final Command command) {
+ resetLastOperationFailedState();
+ getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ assertLastOperationSuccessful();
+ }
+
+ /** Undo the last command done in the diagram editor. */
+ protected void undo() {
+ resetLastOperationFailedState();
+ final CommandStack commandStack = getCommandStack();
+ assertTrue("We should be able to undo", commandStack.canUndo());
+ commandStack.undo();
+ assertLastOperationSuccessful();
+ }
+
+ /** Redo the last command undone in the diagram editor. */
+ protected void redo() {
+ resetLastOperationFailedState();
+ final CommandStack commandStack = getCommandStack();
+ assertTrue("We should be able to redo", commandStack.canRedo());
+ commandStack.redo();
+ assertLastOperationSuccessful();
+ }
+
+ /** Call {@link AbstractPapyrusTestCase#execute(Command) execute} on the UI thread. */
+ protected void executeOnUIThread(final Command command) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ execute(command);
+ }
+ });
+ }
+
+ /** Call {@link AbstractPapyrusTestCase#undo() undo} on the UI thread. */
+ protected void undoOnUIThread() {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ undo();
+ }
+ });
+ }
+
+ /** Call {@link AbstractPapyrusTestCase#redo() redo} on the UI thread. */
+ protected void redoOnUIThread() {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ redo();
+ }
+ });
+ }
+
+ /**
+ * Delete the View associated with the given EditPart, so that it is effectively hidden from the diagram without
+ * removing the corresponding semantic element.
+ */
+ protected void hide(final GraphicalEditPart editPart) {
+ final Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
+ final Command command = editPart.getCommand(deleteViewRequest);
+ execute(command);
+ }
+
+ // protected void sendKey(final Control control, final int key) {
+ // if (!control.setFocus()) {
+ // throw new RuntimeException("Cannot give focus to the control");
+ // }
+ //
+ // final Display display = Display.getDefault();
+ // final Event keyDownEvent = new Event();
+ // keyDownEvent.type = SWT.KeyDown;
+ // keyDownEvent.keyCode = key;
+ // display.post(keyDownEvent);
+ // final Event keyUpEvent = new Event();
+ // keyUpEvent.type = SWT.KeyUp;
+ // keyUpEvent.keyCode = key;
+ // display.post(keyUpEvent);
+ // }
+
+ protected interface INameProvider<T extends EObject> {
+ String getName(T element);
+ }
+
+ /**
+ * Test setting the name on the given editPart, using a DirectEditRequest. Check that the name is set on the given
+ * named element. Also test undo and redo.
+ */
+ protected <T extends EObject> void testSetNameWithDirectEditRequest(final GraphicalEditPart editPart, final T element, final INameProvider<T> nameProvider) {
+ // set first name
+ final String name1 = "test name 1 " + System.currentTimeMillis();
+ setNameWithDirectEditRequest(editPart, name1);
+ assertEquals("The element should have the first name", name1, nameProvider.getName(element));
+ // set second name
+ final String name2 = "test name 2 " + System.currentTimeMillis();
+ setNameWithDirectEditRequest(editPart, name2);
+ assertEquals("The element should have the second name", name2, nameProvider.getName(element));
+ // test undo
+ undo();
+ assertEquals("The element name should be reset to the first name after undo", name1, nameProvider.getName(element));
+ // test redo
+ redo();
+ assertEquals("The element name should be reset to the second name after redo", name2, nameProvider.getName(element));
+ }
+
+ /**
+ * Test setting the name on the given editPart, using a DirectEditRequest. Check that the name is set on the given
+ * named element. Also test undo and redo.
+ */
+ protected void testSetNameWithDirectEditRequest(final GraphicalEditPart editPart, final NamedElement namedElement) {
+ testSetNameWithDirectEditRequest(editPart, namedElement, new INameProvider<NamedElement>() {
+ public String getName(final NamedElement element) {
+ return element.getName();
+ }
+ });
+ }
+
+ /**
+ * Set the name of the given GraphicalEditPart (which must be a name edit part) using a DirectEditRequest. This sets
+ * the name in the Text widget that appears as a result of the DirectEditRequest, and then closes the Text widget to
+ * accept the changes.
+ *
+ * @param editPart
+ * the edit part on which to perform the DirectEditRequest.
+ * @param newName
+ * the name to set
+ */
+ protected void setNameWithDirectEditRequest(final GraphicalEditPart editPart, final String newName) {
+ final IFigure nameFigure = editPart.getFigure();
+ final Rectangle bounds = nameFigure.getBounds();
+ final Point center = bounds.getCenter();
+ final DirectEditRequest directEditRequest = new DirectEditRequest();
+ directEditRequest.setLocation(center);
+ final Text textWidget = performDirectEditRequest(editPart, directEditRequest);
+ setText(textWidget, newName);
+ }
+
+ /** Changes the text of the given Text widget, and then removes the focus from this text in order to commit changes. */
+ protected static void setText(final Text textWidget, final String newName) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ textWidget.setText(newName);
+ // change the focus in order to accept the text
+ textWidget.getShell().setFocus();
+ }
+ });
+ }
+
+ /**
+ * Performs the given DirectEditRequest on the given EditPart, and returns the Text widget that appears to let the
+ * user edit the label.
+ */
+ protected Text performDirectEditRequest(final EditPart editPart, final DirectEditRequest directEditRequest) {
+ final Text[] result = new Text[1];
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ // note: both operations need to be performed in the same display runnable
+ editPart.performRequest(directEditRequest);
+ result[0] = findVisibleTextWidgetOnDiagram();
+ }
+ });
+ assertNotNull("The DirectEditRequest should open a Text field", result[0]);
+ return result[0];
+ }
+
+ /**
+ * Click the palette tool with the given id on the center of the given EditPart's Figure.
+ *
+ * @param toolId
+ * the id of the tool to click
+ * @param target
+ * what to click
+ */
+ protected void clickTool(final String toolId, final GraphicalEditPart target) {
+ final Point point = getCenterPoint(target);
+ clickTool(toolId, point);
+ }
+
+ /**
+ * Click the palette tool with the given id at the given location.
+ *
+ * @param toolId
+ * the id of the tool to click
+ * @param point
+ * where to click
+ */
+ protected void clickTool(final String toolId, final Point point) {
+ final Tool tool = createTool(toolId);
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ tool.activate();
+ internalClickTool(tool, point);
+ tool.deactivate();
+ }
+ });
+ }
+
+ protected void clickTwiceWithTool(final String toolId, final GraphicalEditPart firstTarget, final GraphicalEditPart secondTarget) {
+ final Point firstPoint = getCenterPoint(firstTarget);
+ final Point secondPoint = getCenterPoint(secondTarget);
+ clickTwiceWithTool(toolId, firstPoint, secondPoint);
+ }
+
+ protected void clickTwiceWithTool(final String toolId, final Point firstPoint, final Point secondPoint) {
+ final Tool tool = createTool(toolId);
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ tool.activate();
+ internalClickTool(tool, firstPoint);
+ internalClickTool(tool, secondPoint);
+ tool.deactivate();
+ }
+ });
+ }
+
+ private Tool createTool(final String toolId) {
+ final PaletteViewer paletteViewer = ((EditDomain) this.diagramEditor.getDiagramEditDomain()).getPaletteViewer();
+ final ToolEntry toolEntry = findToolEntry(toolId, paletteViewer.getPaletteRoot());
+ assertNotNull("The tool with id " + toolId + " was not found in the palette", toolEntry); //$NON-NLS-2$
+ final Tool tool = toolEntry.createTool();
+ assertNotNull("The tool with id " + toolId + " couldn't be created", tool); //$NON-NLS-2$
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ initializeTool(tool);
+ }
+ });
+ return tool;
+ }
+
+ protected void initializeTool(final Tool tool) {
+ tool.setViewer(this.diagramEditor.getDiagramGraphicalViewer());
+ tool.setEditDomain((EditDomain) this.diagramEditor.getDiagramEditDomain());
+ }
+
+ /**
+ * Find a tool with the given id in the given palette container.
+ *
+ * @param toolId
+ * the id of the tool to return
+ * @param paletteContainer
+ * the palette root
+ * @return the tool entry, from which a new instance of the tool can be created
+ */
+ protected ToolEntry findToolEntry(final String toolId, final PaletteContainer paletteContainer) {
+ final List<?> children = paletteContainer.getChildren();
+ for (final Object child : children) {
+ if (child instanceof PaletteContainer) {
+ final PaletteContainer childContainer = (PaletteContainer) child;
+ final ToolEntry subresult = findToolEntry(toolId, childContainer);
+ if (subresult != null) {
+ return subresult;
+ }
+ } else if (child instanceof ToolEntry) {
+ final ToolEntry toolEntry = (ToolEntry) child;
+ if (toolId.equals(toolEntry.getId())) {
+ return toolEntry;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Emulate a click of the given tool at the given point on the diagram (the tool should be {@link Tool#activate()
+ * activated}.
+ */
+ protected void internalClickTool(final Tool tool, final Point point) {
+ final Event event = new Event();
+ event.x = point.x;
+ event.y = point.y;
+ event.widget = this.diagramEditor.getDiagramGraphicalViewer().getControl();
+ event.button = 1;
+ // final MouseEvent mouseEvent = new MouseEvent(null, figure, );
+ final MouseEvent mouseEvent = new MouseEvent(event);
+ event.type = SWT.MouseMove;
+ tool.mouseMove(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
+ event.type = SWT.MouseDown;
+ tool.mouseDown(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
+ event.type = SWT.MouseUp;
+ tool.mouseUp(mouseEvent, this.diagramEditor.getDiagramEditPart().getViewer());
+ }
+
+ /**
+ * Send an SelectionRequest of type "open" to the given EditPart (this is what happens when the user double-clicks).
+ */
+ protected static void sendOpenSelectionRequest(final GraphicalEditPart graphicalEditPart, final Point point) {
+ final SelectionRequest openRequest = new SelectionRequest();
+ openRequest.setType(RequestConstants.REQ_OPEN);
+ openRequest.setLastButtonPressed(0);
+ openRequest.setLocation(point);
+ graphicalEditPart.performRequest(openRequest);
+ }
+
+ /** Finds a {@link Text} widget inside the diagram control ({@link FigureCanvas}). */
+ protected Text findVisibleTextWidgetOnDiagram() {
+ final Text[] result = new Text[1];
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ final Composite composite = (Composite) getDiagramEditor().getDiagramGraphicalViewer().getControl();
+ result[0] = findVisibleTextWidget(composite);
+ }
+ });
+ return result[0];
+ }
+
+ /** Finds a {@link Text} widget inside the given composite, recursively. */
+ protected Text findVisibleTextWidget(final Composite composite) {
+ final Control[] children = composite.getChildren();
+ for (final Control child : children) {
+ if (child instanceof Text) {
+ final Text text = (Text) child;
+ if (text.isVisible()) {
+ return text;
+ }
+ } else if (child instanceof Composite) {
+ final Composite childComposite = (Composite) child;
+ final Text subresult = findVisibleTextWidget(childComposite);
+ if (subresult != null) {
+ return subresult;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Find the EditPart corresponding to the given View, or <code>null</code> if it doesn't exist, or is not registered
+ * in the viewer's visual part map.
+ *
+ * @param view
+ * the view for which to find a corresponding EditPart
+ * @return the EditPart corresponding to the View
+ */
+ protected EditPart findEditPart(final View view) {
+ final Object result = this.diagramEditPart.getRoot().getViewer().getVisualPartMap().get(view);
+ assertTrue("The EditPart corresponding to the View was not found", result instanceof EditPart);
+ return (EditPart) result;
+ }
+
+ /** Processes all events waiting in the Display's event loop and then returns. */
+ protected static void flushEventLoop() {
+ final Display display = Display.getDefault();
+ display.syncExec(new Runnable() {
+
+ public void run() {
+ while (display.readAndDispatch()) {
+ // nothing
+ }
+ }
+ });
+ }
+
+ /**
+ * Move the given EditPart in its parent.
+ *
+ * @param editPartToMove
+ * the EditPart to move
+ * @param parentEditPart
+ * the parent
+ * @param moveDelta
+ * the offset
+ */
+ protected void moveEditPart(final GraphicalEditPart editPartToMove, final GraphicalEditPart parentEditPart, final Point moveDelta) {
+ moveEditParts(Collections.singletonList(editPartToMove), parentEditPart, moveDelta);
+ }
+
+ /**
+ * Resize the given EditPart in its parent.
+ *
+ * @param editPartToResize
+ * the EditPart to resize
+ * @param parentEditPart
+ * the parent
+ * @param resizeDelta
+ * the size offset
+ * @param direction
+ * the direction to resize (cf {@link PositionConstants})
+ */
+ protected void resizeEditPart(final GraphicalEditPart editPartToResize, final GraphicalEditPart parentEditPart, final Dimension resizeDelta,
+ final int direction) {
+ resizeEditParts(Collections.singletonList(editPartToResize), parentEditPart, resizeDelta, direction);
+ }
+
+ /**
+ * Move the given EditParts in their parent.
+ *
+ * @param editPartsToMove
+ * the EditParts to move
+ * @param parentEditPart
+ * the parent
+ * @param moveDelta
+ * the location offset
+ */
+ protected void moveEditParts(final List<? extends GraphicalEditPart> editPartsToMove, final GraphicalEditPart parentEditPart, final Point moveDelta) {
+ if (editPartsToMove.size() < 1 || parentEditPart == null || moveDelta == null) {
+ throw new IllegalArgumentException();
+ }
+ final ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest();
+ changeBoundsRequest.setType(RequestConstants.REQ_MOVE_CHILDREN);
+ // emulate a drag&drop with the mouse over the first EditPart
+ changeBoundsRequest.setLocation(computeLocationWithDelta(editPartsToMove.get(0), moveDelta));
+ changeBoundsRequest.setMoveDelta(moveDelta);
+ changeBoundsRequest.setEditParts(editPartsToMove);
+ final Command command = parentEditPart.getCommand(changeBoundsRequest);
+ checkCommand(command);
+ executeOnUIThread(command);
+ flushEventLoop();
+ }
+
+ /**
+ * Resize the given EditParts in their parent.
+ *
+ * @param editPartsToMove
+ * the EditParts to resize
+ * @param parentEditPart
+ * the parent
+ * @param resizeDelta
+ * the size offset
+ * @param direction
+ * the direction to resize (cf {@link PositionConstants})
+ */
+ protected void resizeEditParts(final List<? extends GraphicalEditPart> editPartsToResize, final GraphicalEditPart parentEditPart,
+ final Dimension resizeDelta, final int direction) {
+ if (editPartsToResize.size() < 1 || parentEditPart == null || resizeDelta == null) {
+ throw new IllegalArgumentException();
+ }
+ final ChangeBoundsRequest changeBoundsRequest = new ChangeBoundsRequest();
+ changeBoundsRequest.setType(RequestConstants.REQ_RESIZE_CHILDREN);
+ changeBoundsRequest.setLocation(computeLocationWithDelta(editPartsToResize.get(0), new Point(resizeDelta.width, resizeDelta.height)));
+ changeBoundsRequest.setMoveDelta(new Point());
+ changeBoundsRequest.setSizeDelta(resizeDelta);
+ changeBoundsRequest.setResizeDirection(direction);
+ changeBoundsRequest.setEditParts(editPartsToResize);
+ final Command command = parentEditPart.getCommand(changeBoundsRequest);
+ checkCommand(command);
+ executeOnUIThread(command);
+ flushEventLoop();
+ }
+
+ /**
+ * Compute a Location for the mouse pointer that would occur when dragging the center of the given EditPart by the
+ * given translation vector.
+ *
+ * @param graphicalEditPart
+ * the EditPart being dragged
+ * @param moveDelta
+ * the offset (the translation vector)
+ * @return the target Location
+ */
+ private static Point computeLocationWithDelta(final GraphicalEditPart graphicalEditPart, final Point moveDelta) {
+ return getAbsoluteBounds(graphicalEditPart).getCenter().translate(moveDelta);
+ }
+
+ protected static Rectangle getBounds(final GraphicalEditPart graphicalEditPart) {
+ return new Rectangle(graphicalEditPart.getFigure().getBounds());
+ }
+
+ /** Return the center of the given EditPart's Figure, in absolute coordinates. */
+ protected static Point getCenterPoint(final GraphicalEditPart editPart) {
+ final Rectangle bounds = new Rectangle(editPart.getFigure().getBounds());
+ editPart.getFigure().getParent().translateToAbsolute(bounds);
+ final Point point = new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
+ return point;
+ }
+
+ protected static Rectangle getAbsoluteBounds(final GraphicalEditPart graphicalEditPart) {
+ final Rectangle bounds = getBounds(graphicalEditPart);
+ graphicalEditPart.getFigure().getParent().translateToAbsolute(bounds);
+ return bounds;
+ }
+
+ /**
+ * Check that undo and redo work correctly after moving/resizing an EditPart (the EditPart must have been
+ * moved/resized before calling this method).
+ *
+ * @param editPart
+ * an EditPart that was just moved/resized
+ * @param boundsBefore
+ * the bounds of this EditPart before it was moved/resized
+ */
+ protected void testUndoRedoChangeBoundsEditPart(final GraphicalEditPart editPart, final Rectangle boundsBefore) {
+ final Rectangle boundsAfter = getBounds(editPart);
+
+ // test undo
+ undoOnUIThread();
+ flushEventLoop();
+ Rectangle bounds = getBounds(editPart);
+ assertEquals("The bounds change should be undone", boundsBefore, bounds);
+
+ // test redo
+ redoOnUIThread();
+ flushEventLoop();
+ bounds = getBounds(editPart);
+ assertEquals("The bounds change should be redone", boundsAfter, bounds);
+ }
+
+ /**
+ * Check the bounds of the given GraphicalEditPart's Figure
+ *
+ * @param graphicalEditPart
+ * The EditPart whose Figure's bounds to check
+ * @param expectedPosition
+ * the expected position (-1 for any of the coordinates means not to check this coordinate)
+ * @param expectedSize
+ * the expected size (-1 for any of the coordinates means not to check this coordinate)
+ * @param xErrorMargin
+ * an error margin for the horizontal position
+ * @param yErrorMargin
+ * an error margin for the vertical position
+ * @param widthErrorMargin
+ * an error margin for the width
+ * @param heightErrorMargin
+ * an error margin for the height
+ */
+ protected static void assertBounds(final GraphicalEditPart graphicalEditPart, final Point expectedPosition, final Dimension expectedSize,
+ final int xErrorMargin, final int yErrorMargin, final int widthErrorMargin, final int heightErrorMargin) {
+ assertBounds(graphicalEditPart, new Rectangle(expectedPosition, expectedSize), xErrorMargin, yErrorMargin, widthErrorMargin, heightErrorMargin);
+ }
+
+ /**
+ * Check the bounds of the given GraphicalEditPart's Figure
+ *
+ * @param graphicalEditPart
+ * The EditPart whose Figure's bounds to check
+ * @param expectedBounds
+ * the expected bounds (-1 for any of the coordinates means not to check this coordinate)
+ * @param xErrorMargin
+ * an error margin for the horizontal position
+ * @param yErrorMargin
+ * an error margin for the vertical position
+ * @param widthErrorMargin
+ * an error margin for the width
+ * @param heightErrorMargin
+ * an error margin for the height
+ */
+ protected static void assertBounds(final GraphicalEditPart graphicalEditPart, final Rectangle expectedBounds, final int xErrorMargin,
+ final int yErrorMargin, final int widthErrorMargin, final int heightErrorMargin) {
+ // let GMF do its layout so that the bounds are correct
+ flushEventLoop();
+ final Rectangle bounds = getBounds(graphicalEditPart);
+ if (expectedBounds.width != -1) {
+ assertTrue("The element should be about " + expectedBounds.width + " pixels wide",
+ Math.abs(bounds.width - expectedBounds.width) <= widthErrorMargin);
+ }
+ if (expectedBounds.height != -1) {
+ assertTrue("The element should be about " + expectedBounds.height + " pixels high",
+ Math.abs(bounds.height - expectedBounds.height) <= heightErrorMargin);
+ }
+ if (expectedBounds.x != -1) {
+ assertTrue("The element should have a horizontal position at about " + expectedBounds.x + " pixels",
+ Math.abs(bounds.x - expectedBounds.x) <= xErrorMargin);
+ }
+ if (expectedBounds.y != -1) {
+ assertTrue("The element should have a vertical position at about " + expectedBounds.y + " pixels",
+ Math.abs(bounds.y - expectedBounds.y) <= yErrorMargin);
+ }
+ }
+
+ /**
+ * Find the EditPart corresponding to the given View in the given parent EditPart's children.
+ *
+ * @param parentEditPart
+ * the EditPart in which the EditPart we are looking for should be found
+ * @param view
+ * the View corresponding to the searched EditPart
+ * @return the found EditPart
+ */
+ protected static EditPart findChildEditPartAssociatedToView(final EditPart parentEditPart, final View view) {
+ EditPart result = null;
+ @SuppressWarnings("unchecked")
+ final List<EditPart> children = parentEditPart.getChildren();
+ for (final EditPart editPart : children) {
+ if (view == editPart.getModel()) {
+ result = editPart;
+ }
+ }
+ assertNotNull("There should be an EditPart corresponding to the View", result);
+ return result;
+
+ }
+
+}

Back to the top