diff options
author | Christian W. Damus | 2016-12-03 16:10:18 +0000 |
---|---|---|
committer | Christian W. Damus | 2016-12-03 16:22:22 +0000 |
commit | d166f6032ea983c2f4b639dd6e728d26c7afd712 (patch) | |
tree | d41d572de6b9a1a7286e7ab782a09f51a4937e65 /tests/junit/plugins | |
parent | 4cc473a354549001b380ac6fb963d16f05ffa953 (diff) | |
download | org.eclipse.papyrus-d166f6032ea983c2f4b639dd6e728d26c7afd712.tar.gz org.eclipse.papyrus-d166f6032ea983c2f4b639dd6e728d26c7afd712.tar.xz org.eclipse.papyrus-d166f6032ea983c2f4b639dd6e728d26c7afd712.zip |
Bug 508629: [Label Provider Service] Label providers do not notify
Fix gaps in the propagation of label updates from EMF item provider
adapters through label-providers that delegate to them and the
label-provider service that delegates to those, in turn.
Add JUnit tests covering various affected label providers, including
a new tests plug-in for the Properties UI in the Infra layer.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=508629
(🍒-picked from streams/2.0-maintenance)
Change-Id: I2e0301db72064fe6899c4d92252d93d9051943f0
Diffstat (limited to 'tests/junit/plugins')
23 files changed, 808 insertions, 24 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF index b496b1b5902..06836d338ba 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF @@ -83,6 +83,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.papyrus.eclipse.project.editors.tests;bundle-version="2.0.0", org.eclipse.papyrus.infra.emf.gmf.tests;bundle-version="1.2.1", org.eclipse.papyrus.infra.internationalization.tests;bundle-version="1.0.0", + org.eclipse.papyrus.infra.properties.ui.tests;bundle-version="1.2.1", org.eclipse.papyrus.uml.internationalization.tests;bundle-version="1.0.0", org.eclipse.papyrus.uml.internationalization.controlmode.tests;bundle-version="1.0.0" Bundle-Vendor: %providerName diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java index b400b65d2ca..46039d91691 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java +++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java @@ -9,7 +9,7 @@ * Contributors: * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation * Christian W. Damus (CEA) - bugs 402525, 323802, 431953, 433310, 434993 - * Christian W. Damus - bugs 399859, 451230, 433206, 463156, 474610, 469188, 485220, 488791, 496598 + * Christian W. Damus - bugs 399859, 451230, 433206, 463156, 474610, 469188, 485220, 488791, 496598, 508629 * *****************************************************************************/ package org.eclipse.papyrus.tests; @@ -67,6 +67,7 @@ public class AllTests { suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.viewpoints.configuration.tests.AllTests.class)); suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.editor.welcome.tests.AllTests.class)); suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.welcome.tests.AllTests.class)); + suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.properties.ui.tests.AllTests.class)); /* customization */ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.eclipse.project.editors.tests.AllTests.class)); diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.classpath b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.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/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.project b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.project new file mode 100644 index 00000000000..979e772adf7 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.properties.ui.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/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..b3aa6d60f94 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 +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_lambda_body=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=260 +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_after_type_annotation=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_lambda_arrow=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_lambda_arrow=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=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +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=260 +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=5 +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=false +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/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +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=true +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=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +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_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +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_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ee95e4dd762 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Require-Bundle: org.junit;bundle-version="4.10.0", + org.eclipse.papyrus.junit.framework;bundle-version="1.2.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.papyrus.junit.utils;bundle-version="2.0.0", + org.eclipse.papyrus.infra.properties.ui;bundle-version="1.2.1", + org.eclipse.uml2.uml;bundle-version="5.2.0" +Export-Package: org.eclipse.papyrus.infra.properties.ui.tests +Bundle-Vendor: Eclipse Modeling Project +Bundle-Version: 1.2.1.qualifier +Bundle-Name: Papyrus Properties UI Tests +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.infra.properties.ui.tests;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/about.html b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/about.html new file mode 100644 index 00000000000..d35d5aed64c --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/build.properties b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/build.properties new file mode 100644 index 00000000000..8942d6678cf --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/build.properties @@ -0,0 +1,18 @@ +# Copyright (c) 2016 Christian W. Damus and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Christian W. Damus - Initial API and implementation +# + +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + resources/ +src.includes = about.html diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/org.eclipse.papyrus.infra.properties.ui.tests.launch b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/org.eclipse.papyrus.infra.properties.ui.tests.launch new file mode 100644 index 00000000000..ada0c715fbd --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/org.eclipse.papyrus.infra.properties.ui.tests.launch @@ -0,0 +1,41 @@ +<?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.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/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"/> +<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> +<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.properties.ui.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.infra.properties.ui.tests"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.sdk.ide"/> +<booleanAttribute key="run_in_ui_thread" value="true"/> +<booleanAttribute key="show_selected_only" value="false"/> +<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/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml new file mode 100644 index 00000000000..dde5b0fccb2 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/pom.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.tests.releng</artifactId> + <version>1.2.0-SNAPSHOT</version> + <relativePath>../../../../../../releng/main-tests</relativePath> + </parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra.properties.ui.tests</artifactId> + <version>1.2.1-SNAPSHOT</version> + <packaging>eclipse-test-plugin</packaging> +</project> diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/resources/model.uml b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/resources/model.uml new file mode 100644 index 00000000000..7695bdc5db3 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/resources/model.uml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<uml:Package xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_03A1sLjVEeaIetUbB8DIJg" name="root"> + <packageImport xmi:id="_F72PsLjWEeaIetUbB8DIJg"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Class" xmi:id="_3rOpwLjVEeaIetUbB8DIJg" name="Class1"> + <ownedAttribute xmi:id="_6GtNsLjVEeaIetUbB8DIJg" name="property1"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Class" xmi:id="_40Bd0LjVEeaIetUbB8DIJg" name="Class2"/> +</uml:Package> diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/providers/tests/PropertiesHeaderLabelProviderTest.java b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/providers/tests/PropertiesHeaderLabelProviderTest.java new file mode 100644 index 00000000000..93678bfcbd3 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/providers/tests/PropertiesHeaderLabelProviderTest.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.properties.ui.providers.tests; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assume.assumeThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.jface.viewers.IBaseLabelProvider; +import org.eclipse.papyrus.infra.properties.ui.providers.PropertiesHeaderLabelProvider; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.junit.utils.rules.ResourceSetFixture; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Property; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +/** + * Test cases for the {@link PropertiesHeaderLabelProvider} class. + */ +@PluginResource("resources/model.uml") +public class PropertiesHeaderLabelProviderTest { + + @Rule + public final HouseKeeper housekeeper = new HouseKeeper(); + + @Rule + public final ResourceSetFixture rset = new ResourceSetFixture(); + + private PropertiesHeaderLabelProvider fixture; + + private Property property; + private Class class_; + + public PropertiesHeaderLabelProviderTest() { + super(); + } + + + /** + * Tests that the properties header label provider forwards label provider + * change events. + */ + @Test + public void labelProviderChange() { + // Have to get the label in order for the PropertyItemProvider to become + // attached and send notifications + assumeThat(fixture.getText(property), containsString("property1")); + + List<Object> updates = new ArrayList<>(); + + fixture.addListener(event -> { + if (event.getSource() == fixture) { + updates.addAll(Arrays.asList(event.getElements())); + } + }); + + property.setType(class_); + + assertThat("No notification received", updates, hasItem(property)); + } + + // + // Test framework + // + + @Before + public void createFixture() { + fixture = new PropertiesHeaderLabelProvider(); + housekeeper.cleanUpLater(fixture, IBaseLabelProvider::dispose); + + Class class1 = (Class) rset.getModel().getOwnedType("Class1"); + property = class1.getOwnedAttributes().get(0); + class_ = (Class) rset.getModel().getOwnedType("Class2"); + } + +} diff --git a/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/tests/AllTests.java b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/tests/AllTests.java new file mode 100644 index 00000000000..a7e1ab23c56 --- /dev/null +++ b/tests/junit/plugins/infra/properties/org.eclipse.papyrus.infra.properties.ui.tests/src/org/eclipse/papyrus/infra/properties/ui/tests/AllTests.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + */ +package org.eclipse.papyrus.infra.properties.ui.tests; + +import org.eclipse.papyrus.infra.properties.ui.providers.tests.PropertiesHeaderLabelProviderTest; +import org.eclipse.papyrus.junit.framework.classification.ClassificationSuite; +import org.junit.runner.RunWith; +import org.junit.runners.Suite.SuiteClasses; + + +/** + * The master test suite for the plug-in. + */ +@RunWith(ClassificationSuite.class) +@SuiteClasses({ + PropertiesHeaderLabelProviderTest.class, +}) +public class AllTests { + + public AllTests() { + super(); + } + +} diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.classpath b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.classpath index 2d1a4302f04..eca7bdba8f0 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.classpath +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.classpath @@ -1,7 +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>
+<?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/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.settings/org.eclipse.jdt.core.prefs index c585cc455ae..b3aa6d60f94 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.settings/org.eclipse.jdt.core.prefs +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.source=1.8 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 diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/META-INF/MANIFEST.MF index eb05408b73d..e94999ba45e 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.1",
org.eclipse.papyrus.infra.core;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.2.0",
@@ -17,9 +17,9 @@ Require-Bundle: org.eclipse.ui, Export-Package: org.eclipse.papyrus.infra.services.labelprovider.tests
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.2.1.qualifier
Bundle-Name: LabelProvider Service Tests
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.infra.services.labelprovider.tests.Activator
Bundle-SymbolicName: org.eclipse.papyrus.infra.services.labelprovider.tests;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml index d3b1319c1cf..a4474cf8d7e 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/pom.xml @@ -10,6 +10,6 @@ </parent> <groupId>org.eclipse.papyrus</groupId> <artifactId>org.eclipse.papyrus.infra.services.labelprovider.tests</artifactId> - <version>1.2.0-SNAPSHOT</version> + <version>1.2.1-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> </project> diff --git a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/src/org/eclipse/papyrus/infra/services/labelprovider/tests/LabelProviderServiceTest.java b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/src/org/eclipse/papyrus/infra/services/labelprovider/tests/LabelProviderServiceTest.java index ec431fa3f86..272c19e97a0 100644 --- a/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/src/org/eclipse/papyrus/infra/services/labelprovider/tests/LabelProviderServiceTest.java +++ b/tests/junit/plugins/infra/services/org.eclipse.papyrus.infra.services.labelprovider.tests/src/org/eclipse/papyrus/infra/services/labelprovider/tests/LabelProviderServiceTest.java @@ -1,5 +1,5 @@ /*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,9 +8,17 @@ *
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 508629
*****************************************************************************/
package org.eclipse.papyrus.infra.services.labelprovider.tests;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
@@ -65,11 +73,11 @@ public class LabelProviderServiceTest extends AbstractPapyrusTest { LabelProviderService service = registry.getService(LabelProviderService.class);
ILabelProvider generalProvider = service.getLabelProvider();
- //getLabelProvider() and getLabelProvider(DEFAULT_LABEL_PROVIDER) should always return the same label provider
+ // getLabelProvider() and getLabelProvider(DEFAULT_LABEL_PROVIDER) should always return the same label provider
Assert.assertNotNull(generalProvider);
Assert.assertEquals(generalProvider, service.getLabelProvider(LabelProviderService.DEFAULT_LABEL_PROVIDER));
- //We don't know what the default labelProvider will return, but it shouldn't return the providers from EMF_CONTEXT nor UML_CONTEXT
+ // We don't know what the default labelProvider will return, but it shouldn't return the providers from EMF_CONTEXT nor UML_CONTEXT
Assert.assertNotSame("The default label provider should not return Test EMF values", EXPECTED_EMF_VALUE, generalProvider.getText(null));
Comment comment = createTestComment();
@@ -85,7 +93,7 @@ public class LabelProviderServiceTest extends AbstractPapyrusTest { @Test
public void testEMFLabelProvider() throws ServiceException {
- //This test may fail if a new contribution with a higher priority is defined in Papyrus. Test contributions are defined with priorities 5 and 10
+ // This test may fail if a new contribution with a higher priority is defined in Papyrus. Test contributions are defined with priorities 5 and 10
LabelProviderService service = registry.getService(LabelProviderService.class);
ILabelProvider emfProvider = service.getLabelProvider(TEST_EMF_CONTEXT);
@@ -99,7 +107,7 @@ public class LabelProviderServiceTest extends AbstractPapyrusTest { @Test
public void testUMLLabelProvider() throws ServiceException {
- //This test may fail if a new contribution with a higher priority is defined in Papyrus. Test contributions are defined with priorities 5 and 10
+ // This test may fail if a new contribution with a higher priority is defined in Papyrus. Test contributions are defined with priorities 5 and 10
LabelProviderService service = registry.getService(LabelProviderService.class);
ILabelProvider umlProvider = service.getLabelProvider(TEST_UML_CONTEXT);
@@ -110,11 +118,34 @@ public class LabelProviderServiceTest extends AbstractPapyrusTest { }
@Test
+ public void testUMLLabelProviderChangeEvents() throws ServiceException {
+ LabelProviderService service = registry.getService(LabelProviderService.class);
+ // We are not testing the provider registration/priority mechanism, but
+ // the UMLLabelProvider, itself
+ ILabelProvider umlProvider = service.getLabelProvider();
+
+ Comment comment = createTestComment();
+ umlProvider.getText(comment);
+
+ List<Object> updates = new ArrayList<>();
+
+ umlProvider.addListener(event -> {
+ if (event.getSource() == umlProvider) {
+ updates.addAll(Arrays.asList(event.getElements()));
+ }
+ });
+
+ comment.setBody("Hello, world.");
+
+ assertThat("No notification received", updates, hasItem(comment));
+ }
+
+ @Test
public void testInvalidContext() throws ServiceException {
LabelProviderService service = registry.getService(LabelProviderService.class);
ILabelProvider invalidContextProvider = service.getLabelProvider(TEST_INVALID_CONTEXT);
- //The label provider instance is not guaranteed to be equal. We should test and compare a set of values
+ // The label provider instance is not guaranteed to be equal. We should test and compare a set of values
Assert.assertEquals(invalidContextProvider, service.getLabelProvider());
}
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF index af8a757c063..410e774990d 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF @@ -22,7 +22,7 @@ Export-Package: org.eclipse.papyrus.uml.tools.tests, org.eclipse.papyrus.uml.tools.tests.tests
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.3.0.qualifier
+Bundle-Version: 3.0.0.qualifier
Bundle-Name: UML Tools Tests
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.uml.tools.tests.Activator
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml index 1294be2f6f6..a1387fc2464 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/pom.xml @@ -10,6 +10,6 @@ </parent> <groupId>org.eclipse.papyrus</groupId> <artifactId>org.eclipse.papyrus.uml.tools.tests</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>3.0.0-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> </project> diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java index faac57319cd..a2817bc8eee 100644 --- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java @@ -9,7 +9,7 @@ * Contributors: * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation * Christian W. Damus (CEA) - bug 440108 - * Christian W. Damus - bugs 458197, 468030, 485220, 502461 + * Christian W. Damus - bugs 458197, 468030, 485220, 502461, 508629 * *****************************************************************************/ package org.eclipse.papyrus.uml.tools.tests.tests; @@ -34,6 +34,7 @@ import org.junit.runners.Suite.SuiteClasses; UMLLanguageProvidersTest.class, IconsStereotypesTest.class, CustomizableDelegatingItemLabelProviderTest.class, + DelegatingItemLabelProviderTest.class, UMLCopyTest.class, }) public class AllTests { diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DelegatingItemLabelProviderTest.java b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DelegatingItemLabelProviderTest.java new file mode 100644 index 00000000000..8ef8138205a --- /dev/null +++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/DelegatingItemLabelProviderTest.java @@ -0,0 +1,99 @@ +/***************************************************************************** + * Copyright (c) 2016 Christian W. Damus and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.uml.tools.tests.tests; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assume.assumeThat; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.junit.utils.rules.HouseKeeper; +import org.eclipse.papyrus.junit.utils.rules.PluginResource; +import org.eclipse.papyrus.junit.utils.rules.ResourceSetFixture; +import org.eclipse.papyrus.uml.tools.providers.DelegatingItemLabelProvider; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Property; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +/** + * Test cases for the {@link DelegatingItemLabelProvider} class. + */ +@PluginResource("resources/uml/testModel.uml") +public class DelegatingItemLabelProviderTest { + + @Rule + public final HouseKeeper housekeeper = new HouseKeeper(); + + @Rule + public final ResourceSetFixture rset = new ResourceSetFixture(); + + private DelegatingItemLabelProvider fixture; + + private Property property; + private Class class_; + + public DelegatingItemLabelProviderTest() { + super(); + } + + /** + * Tests that the delegating item label provider forwards notifications + * of label changes. + */ + @Test + public void notifyChange() { + // Have to get the label in order for the PropertyItemProvider to become + // attached and send notifications + assumeThat(fixture.getText(property), containsString("Property1")); + + List<Object> updates = new ArrayList<>(); + + fixture.addListener(msg -> { + if (msg instanceof ViewerNotification) { + ViewerNotification vnot = (ViewerNotification) msg; + if (vnot.isLabelUpdate()) { + updates.add(vnot.getElement()); + } + } + }); + + property.setType(class_); + + assertThat("No notification received", updates, hasItem(property)); + } + + // + // Test framework + // + + @Before + public void createFixture() { + AdapterFactory factory = ((AdapterFactoryEditingDomain) rset.getEditingDomain()).getAdapterFactory(); + fixture = new DelegatingItemLabelProvider(factory, DelegatingItemLabelProvider.SHOW_LABEL); + housekeeper.cleanUpLater(fixture, IDisposable::dispose); + + Class class1 = (Class) rset.getModel().getOwnedType("Class1"); + property = class1.getOwnedAttributes().get(0); + class_ = (Class) rset.getModel().getOwnedType("Class2"); + } +} |