Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework')
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath7
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project52
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs98
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF18
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html28
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties6
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml15
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java325
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java102
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java346
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java102
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java45
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java295
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java39
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java39
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java41
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java38
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java38
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java39
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java73
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java33
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java147
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java41
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java304
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java28
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java96
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java71
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java31
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java50
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java64
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java46
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java34
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java419
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java29
38 files changed, 0 insertions, 3502 deletions
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath
deleted file mode 100644
index eca7bdba8f0..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?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/junit/org.eclipse.papyrus.junit.framework/.project b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project
deleted file mode 100644
index 633f2786909..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.project
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.junit.framework</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>
- <buildCommand>
- <name>org.eclipse.oomph.version.VersionBuilder</name>
- <arguments>
- <dictionary>
- <key>check.maven.pom</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>ignore.lower.bound.dependency.ranges</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>release.path</key>
- <value>/org.eclipse.papyrus.releng.dev.release/release.xml</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.oomph.version.VersionNature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 896a9a53a53..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8 \ No newline at end of file
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 5a0ad22d2a7..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b3aa6d60f94..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,291 +0,0 @@
-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/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 954281dbc31..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,68 +0,0 @@
-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/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs
deleted file mode 100644
index 23fb95e120f..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/.settings/org.eclipse.pde.api.tools.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-INVALID_ANNOTATION=Ignore
-INVALID_JAVADOC_TAG=Ignore
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
-MISSING_EE_DESCRIPTIONS=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=Enabled
-eclipse.preferences.version=1
-incompatible_api_component_version=Error
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Error
-malformed_since_tag=Error
-missing_since_tag=Warning
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF
deleted file mode 100644
index b57b622c6d5..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.junit.framework.classification,
- org.eclipse.papyrus.junit.framework.classification.rules,
- org.eclipse.papyrus.junit.framework.classification.tests,
- org.eclipse.papyrus.junit.framework.runner
-Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.ui;bundle-version="[3.107.0,4.0.0)"
-Bundle-Vendor: Eclipse Modeling Project
-Bundle-Version: 1.2.0.qualifier
-Bundle-Name: Conditional Junit Annotations
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.junit.framework;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: com.google.common.base;version="21.0.0",
- com.google.common.cache;version="21.0.0",
- com.google.common.collect;version="21.0.0"
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html
deleted file mode 100644
index dd3c089a94c..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!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>November 14, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). 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, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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> \ No newline at end of file
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties
deleted file mode 100644
index 9cbab3c135e..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html
-src.includes = about.html
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml
deleted file mode 100644
index 12bfc35fcc3..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?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.dev.releng</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- <relativePath>../../../../../releng/dev</relativePath>
- </parent>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus.junit.framework</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-</project>
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java
deleted file mode 100644
index ebf8ee588d3..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationConfig.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014, 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus - bug 451230
- * Christian W. Damus - bug 464647
- * Christian W. Damus - bug 480812
- * Christian W. Damus - bug 485156
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.ExpensiveTest;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.FailingTest;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.GeneratedTest;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InteractiveTest;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InvalidTest;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.NotImplemented;
-import static org.eclipse.papyrus.junit.framework.classification.TestCategory.Standard;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.papyrus.infra.tools.util.ListHelper;
-import org.junit.Ignore;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Suite;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-
-/**
- * <p>
- * This class is used to configure the Classification Annotations which should be excluded from a test job. A classification configuration is an immutable set of {@linkplain TestCategory test categories} that are included in the test configuration.
- * </p>
- * <p>
- * Usage:
- * </p>
- *
- * <pre>
- * ClassificationConfig.setExcludedTestCategories(TestCategory.InvalidTest, TestCategory.NotImplemented);
- *
- * // or
- *
- * ClassificationConfig.setIncludedTestCategories(TestCategory.Standard, TestCategory.NotImplemented);
- *
- * // or
- *
- * ClassificationConfig.setExcludedTestCategories(ClassificationConfig.FAILING_TESTS_CONFIG);
- *
- * // or
- *
- * ClassificationConfig.setIncludedTestCategories(ClassificationConfig.FULL_CI_TESTS_CONFIG);
- *
- * // or
- *
- * ClassificationConfig.setTestsConfiguration(ClassificationConfig.CI_TESTS_CONFIG);
- * </pre>
- *
- * @author Camille Letavernier
- *
- * @see {@link TestCategory}
- * @see {@link ClassificationRunner}
- *
- */
-public enum ClassificationConfig implements Set<TestCategory> {
-
- /**
- * Default tests configuration for Continuous Integration (Hudson): Excludes the tests which are
- * identified as failing, as well as the interactive tests
- *
- * This configuration may require a couple of hours to run
- */
- CI_TESTS_CONFIG(NotImplemented, InvalidTest, FailingTest, InteractiveTest, GeneratedTest),
-
- /**
- * This tests configuration runs all tests which are already identified as failing.
- * If one test from this configuration passes, this might mean that the annotation should be removed
- *
- * InteractiveTests are excluded as well, as this configuration is supposed to be executed on Hudson
- */
- FAILING_TESTS_CONFIG(Standard, InteractiveTest, GeneratedTest, ExpensiveTest),
-
- /**
- * This tests configuration is expected to run in ~15 minutes. This is useful for quick testing,
- * and validation through Gerrit
- */
- LIGTHWEIGHT_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, GeneratedTest),
-
- /**
- * This test configuration runs all generated diagram tests only.
- *
- * @since 1.2
- */
- GENERATED_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, Standard),
-
- /**
- * This tests configuration is meant to execute all tests in an automated environment
- * It includes all tests which are known to be failing, but excludes tests which
- * require a user interaction
- */
- FULL_CI_TESTS_CONFIG(InteractiveTest),
-
- /**
- * Executes all tests
- */
- FULL_TESTS_CONFIG();
-
- public static final Set<TestCategory> excludedTestCategories = new HashSet<TestCategory>();
-
- private final Set<TestCategory> categories;
-
- static {
- // Default on Hudson: exclude everything which is already identified as an issue (i.e. is not a (new) regression)
- setTestsConfiguration(CI_TESTS_CONFIG);
-
- // Check whether identified regressions are still failing
- // setIncludedTestCategories(FailingTest);
-
- for (String arg : Platform.getApplicationArgs()) {
- if (arg.contains("-testConfig=")) {
- String configName = arg.substring("-testConfig=".length());
- Set<TestCategory> testsConfig = ClassificationConfig.valueOf(configName);
- if (testsConfig != null) {
- setTestsConfiguration(testsConfig);
- }
- break;
- }
- }
- }
-
- private ClassificationConfig(TestCategory... exclusions) {
- Set<TestCategory> categories = Sets.newHashSet(TestCategory.values());
- categories.removeAll(Arrays.asList(exclusions));
- this.categories = ImmutableSet.copyOf(categories);
- }
-
- // Same as setExcludedTestsCategories, but renamed for clarity (To be used with predefined configurations)
- public static void setTestsConfiguration(Set<TestCategory> predefinedConfiguration) {
- setIncludedTestCategories(predefinedConfiguration);
- }
-
- /**
- * Define the test categories which should be excluded from the TestSuite
- *
- * @param categoriesToInclude
- */
- public static void setExcludedTestCategories(TestCategory... categories) {
- setExcludedTestCategories(Arrays.asList(categories));
- }
-
- /**
- * Define the test categories which should be included in the TestSuite
- *
- * @param categoriesToInclude
- */
- public static void setIncludedTestCategories(TestCategory... categories) {
- setIncludedTestCategories(Arrays.asList(categories));
- }
-
- /**
- * Define the test categories which should be excluded from the TestSuite
- *
- * @param categoriesToInclude
- */
- public static void setExcludedTestCategories(Collection<TestCategory> categoriesToExclude) {
- excludedTestCategories.clear();
- excludedTestCategories.addAll(categoriesToExclude);
- }
-
- /**
- * Define the test categories which should be included in the TestSuite
- *
- * @param categoriesToInclude
- */
- public static void setIncludedTestCategories(Collection<TestCategory> categoriesToInclude) {
- excludedTestCategories.clear();
- List<TestCategory> categoriesToExclude = ListHelper.asList(TestCategory.values());
- categoriesToExclude.removeAll(categoriesToInclude);
- excludedTestCategories.addAll(categoriesToExclude);
- }
-
- /**
- * Tests whether a method containing the given set of Annotations should be executed
- *
- * @param annotations
- * The annotations applied to the Method
- * @return
- * True if the test method should be executed, false if it should be ignored
- */
- public static boolean shouldRun(Annotation[] annotations) {
- for (Annotation annotation : annotations) {
- Class<? extends Annotation> annotationClass = annotation.annotationType();
-
- // Support the usual @Ignore annotation, too, of course
- if ((annotationClass == Ignore.class) || isExcluded(annotationClass)) {
- return false;
- }
- }
-
- if (excludedTestCategories.contains(TestCategory.Standard)) {
- // If it's just a test suite, then let the execution of its children be filtered
- for (Annotation annotation : annotations) {
- if (RunWith.class.isInstance(annotation)) {
- RunWith runWith = (RunWith) annotation;
- Class<?> runner = runWith.value();
- if (Suite.class.isAssignableFrom(runner) && !Parameterized.class.isAssignableFrom(runner)) {
- return true;
- }
- }
- }
-
- for (TestCategory testCategory : TestCategory.values()) {
- if (testCategory == TestCategory.Standard) {
- continue;
- }
-
- for (Annotation annotation : annotations) {
- if (testCategory.match(annotation.annotationType())) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Tests whether the given Annotation should be excluded
- *
- * @param annotationClass
- * @return
- */
- public static boolean isExcluded(Class<? extends Annotation> annotationClass) {
- for (TestCategory testCategory : excludedTestCategories) {
- if (testCategory.match(annotationClass)) {
- return true;
- }
- }
-
- return false;
- }
-
- @Override
- public int size() {
- return categories.size();
- }
-
- @Override
- public boolean isEmpty() {
- return categories.isEmpty();
- }
-
- @Override
- public boolean contains(Object o) {
- return categories.contains(o);
- }
-
- @Override
- public boolean containsAll(Collection<?> c) {
- return categories.containsAll(c);
- }
-
- @Override
- public Iterator<TestCategory> iterator() {
- return categories.iterator();
- }
-
- @Override
- public Object[] toArray() {
- return categories.toArray();
- }
-
- @Override
- public <T> T[] toArray(T[] a) {
- return categories.toArray(a);
- }
-
- @Override
- public boolean add(TestCategory e) {
- throw new UnsupportedOperationException("add"); //$NON-NLS-1$
- }
-
- @Override
- public boolean remove(Object o) {
- throw new UnsupportedOperationException("remove"); //$NON-NLS-1$
- }
-
- @Override
- public boolean addAll(Collection<? extends TestCategory> c) {
- throw new UnsupportedOperationException("addAll"); //$NON-NLS-1$
- }
-
- @Override
- public boolean retainAll(Collection<?> c) {
- throw new UnsupportedOperationException("retainAll"); //$NON-NLS-1$
- }
-
- @Override
- public boolean removeAll(Collection<?> c) {
- throw new UnsupportedOperationException("removeAll"); //$NON-NLS-1$
- }
-
- @Override
- public void clear() {
- throw new UnsupportedOperationException("clear"); //$NON-NLS-1$
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java
deleted file mode 100644
index 89ee5d7dcef..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunner.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014, 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - add support for conditional tests
- * Christian W. Damus (CEA) - bug 432813
- * Christian W. Damus (CEA) - bug 434993
- * Christian W. Damus (CEA) - bug 436047
- * Christian W. Damus - bug 485156
- *
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.util.List;
-
-import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.Statement;
-
-/**
- * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests.
- *
- * It ignores the test methods according to their annotations, and the policy defined
- * in {@link ClassificationConfig}
- *
- *
- * @see {@link ClassificationConfig}
- * @see {@link TestCategory}
- * @see Conditional
- *
- * @author Camille Letavernier
- *
- */
-public class ClassificationRunner extends BlockJUnit4ClassRunner {
-
- private final ClassificationRunnerImpl impl;
-
- public ClassificationRunner(Class<?> klass) throws InitializationError {
- super(klass);
-
- this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() {
-
- @Override
- public void runChild(FrameworkMethod method, RunNotifier notifier) {
- ClassificationRunner.super.runChild(method, notifier);
- }
-
- @Override
- public Description describeChild(FrameworkMethod method) {
- return ClassificationRunner.super.describeChild(method);
- }
-
- @Override
- public Object createTest() throws Exception {
- return ClassificationRunner.super.createTest();
- }
-
- @Override
- public List<TestRule> getTestRules(Object target) {
- return ClassificationRunner.super.getTestRules(target);
- }
-
- @Override
- public Statement classBlock(RunNotifier notifier) {
- return ClassificationRunner.super.classBlock(notifier);
- }
-
- });
- }
-
- @Override
- protected void runChild(FrameworkMethod method, RunNotifier notifier) {
- impl.runChild(method, notifier);
- }
-
- @Override
- protected Object createTest() throws Exception {
- return impl.createTest();
- }
-
- @Override
- protected List<TestRule> getTestRules(Object target) {
- return impl.getTestRules(target);
- }
-
- @Override
- protected Statement classBlock(RunNotifier notifier) {
- return impl.classBlock(notifier);
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java
deleted file mode 100644
index f83dd28819e..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerImpl.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014, 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - add support for conditional tests
- * Christian W. Damus (CEA) - bug 432813
- * Christian W. Damus (CEA) - bug 434993
- * Christian W. Damus (CEA) - bug 436047
- * Christian W. Damus - bug 485156
- *
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.operations.DefaultOperationHistory;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.papyrus.infra.tools.util.ListHelper;
-import org.eclipse.papyrus.junit.framework.classification.rules.ConditionRule;
-import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
-import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.Statement;
-
-import com.google.common.base.Predicates;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
-/**
- * Internal implementation of the common classification-sensitive behaviour
- * of the {@link ClassificationRunner} and {@link ClassificationRunnerWithParameters}
- * test runners.
- *
- * @author Camille Letavernier
- */
-class ClassificationRunnerImpl {
-
- private final static long EVENT_LOOP_TIMEOUT = 2L * 60L * 1000L; // 2 minutes in millis
-
- private final static long ONE_MB = 1024L * 1024L; // a megabyte, in bytes
-
- private static final Supplier<TestRule> uiFlusherRuleSupplier = createUIFlusherRuleSupplier();
-
- private final ThreadLocal<Object> preparedTest = new ThreadLocal<Object>();
-
- private final Delegate delegate;
-
- ClassificationRunnerImpl(Delegate delegate) throws InitializationError {
- super();
-
- this.delegate = delegate;
- }
-
- final void runChild(FrameworkMethod method, RunNotifier notifier) {
- List<Annotation> allAnnotations = ListHelper.asList(method.getAnnotations());
- allAnnotations.addAll(Arrays.asList(method.getMethod().getDeclaringClass().getAnnotations()));
- if (ClassificationConfig.shouldRun(allAnnotations.toArray(new Annotation[allAnnotations.size()])) && conditionSatisfied(method)) {
- delegate.runChild(method, notifier);
- } else {
- Description description = delegate.describeChild(method);
- notifier.fireTestIgnored(description);
- }
- }
-
- final Object createTest() throws Exception {
- // Look for a prepared test instance
- Object result = preparedTest.get();
- if (result != null) {
- // We won't need this test instance again
- clearPreparedTest();
- } else {
- result = delegate.createTest();
- }
-
- return result;
- }
-
- final Object prepareTest() throws Exception {
- // Prepare the test instance and stash it to return on the next invocation
- Object result = delegate.createTest();
- preparedTest.set(result);
- return result;
- }
-
- final void clearPreparedTest() {
- preparedTest.remove();
- }
-
- private boolean conditionSatisfied(FrameworkMethod method) {
- boolean result = true;
-
- // Does this test declare some precondition?
- Conditional conditional = method.getAnnotation(Conditional.class);
- if (conditional != null) {
- try {
- // We need the test instance to invoke the condition on it, so prepare it now
- Object test = prepareTest();
- result = ConditionRule.testCondition(method.getMethod().getDeclaringClass(), conditional, test);
- } catch (Throwable t) {
- // If we couldn't create the test, then we should just ignore it
- result = false;
- } finally {
- if (!result) {
- // We won't be running the test, so forget the prepared instance (if any)
- clearPreparedTest();
- }
- }
- }
-
- return result;
- }
-
- List<TestRule> getTestRules(Object target) {
- // MemoryLeakRules must be the outer-most rules, because leak assertions must only happen after all possible tear-down actions have run
- return reorderForMemoryLeakRules(delegate.getTestRules(target));
- }
-
- private List<TestRule> reorderForMemoryLeakRules(List<TestRule> rules) {
- // Quick scan for memory rules
- if (!rules.isEmpty()) {
- int memoryRuleCount = Iterables.size(Iterables.filter(rules, Predicates.instanceOf(MemoryLeakRule.class)));
- if (memoryRuleCount > 0) {
- // Bubble the memory rules to the end
- int limit = rules.size() - memoryRuleCount;
-
- for (int i = 0; i < limit; i++) {
- if (rules.get(i) instanceof MemoryLeakRule) {
- // Move the rule to the end and take a step back to get the next element
- rules.add(rules.remove(i--));
- }
- }
- }
- }
-
- return rules;
- }
-
- Statement classBlock(RunNotifier notifier) {
- Statement result = delegate.classBlock(notifier);
-
- // Wrap the class suite in a rule that flushes the UI thread to release memory referenced by UI runnables
- TestRule uiFlusher = uiFlusherRuleSupplier.get();
- if (uiFlusher != null) {
- // This rule doesn't need any actual test description
- result = uiFlusher.apply(result, Description.EMPTY);
- }
-
- return result;
- }
-
- private static Supplier<TestRule> createUIFlusherRuleSupplier() {
- Supplier<TestRule> result = Suppliers.ofInstance(null);
-
- try {
- if (PlatformUI.isWorkbenchRunning()) {
- result = Suppliers.memoize(new Supplier<TestRule>() {
-
- @Override
- public TestRule get() {
- if (Display.getCurrent() != null) {
- return new TestWatcher() {
-
- @Override
- protected void finished(Description description) {
- final Display display = Display.getCurrent();
- if (display == null) {
- // Can't do UI manipulations and history listener hacking except on the UI thread
- return;
- }
-
- flushUIEventQueue(display);
-
- purgeZombieHistoryListeners();
-
- clearDecorationScheduler();
- }
- };
- }
-
- return null;
- }
- });
- }
- } catch (LinkageError e) {
- // Not running in Eclipse UI context. Fine
- }
-
- return result;
- }
-
- private static void flushUIEventQueue(Display display) {
- long base = System.currentTimeMillis();
- long timeout = EVENT_LOOP_TIMEOUT;
-
- // Flush the UI thread's pending events
- while (!display.isDisposed()) {
- try {
- if (!display.readAndDispatch()) {
- break;
- }
- } catch (Exception e) {
- // Ignore it
- }
-
- long now = System.currentTimeMillis();
- if ((now - base) > timeout) {
- // This seems to be taking a really long time. What's up?
- base = now;
- timeout = timeout * 3L / 2L; // Exponential back-off to avoid over-reporting
- int freeMB = (int) (Runtime.getRuntime().freeMemory() / ONE_MB);
- System.err.printf("========%nUI event queue clean-up seems to be running long.%nCurrent free memory: %d MB%n========%n%n", freeMB);
- }
- }
- }
-
- private static void purgeZombieHistoryListeners() {
- // If there are no editors open any longer, then all of the action handlers currently
- // listening to the operation history are leaked, so remove them. This ensures that we
- // do not end up wasting time in notifying thousands of dead/broken/useless listeners
- // every time a test case executes an operation on the history (which happens *a lot*)
- IWorkbench bench = PlatformUI.getWorkbench();
- IWorkbenchWindow window = (bench == null) ? null : bench.getActiveWorkbenchWindow();
- if ((window == null) && (bench != null) && (bench.getWorkbenchWindowCount() > 0)) {
- window = bench.getWorkbenchWindows()[0];
- }
- if (window != null && window.getActivePage().getEditorReferences().length == 0) {
- final ListenerList historyListeners = OperationHistoryHelper.getOperationHistoryListeners();
- final Object[] listeners = historyListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- if (OperationHistoryHelper.shouldRemoveHistoryListener(listeners[i])) {
- historyListeners.remove(listeners[i]);
- }
- }
- }
- }
-
- private static void clearDecorationScheduler() {
- IWorkbench bench = PlatformUI.getWorkbench();
- if (bench != null) {
- IBaseLabelProvider bogusProvider = new BaseLabelProvider();
-
- try {
- // The DecoratorManager is a label-provider listener and
- // it clears the scheduler on label-provider change events
- ((ILabelProviderListener) bench.getDecoratorManager()).labelProviderChanged(new LabelProviderChangedEvent(bogusProvider));
- } finally {
- bogusProvider.dispose();
- }
- }
- }
-
- //
- // Nested types
- //
-
- static class OperationHistoryHelper {
-
- static final Field listenersField;
-
- static final Set<Class<?>> historyListenerClasses;
-
- static {
- try {
- listenersField = DefaultOperationHistory.class.getDeclaredField("listeners");
- listenersField.setAccessible(true);
-
- historyListenerClasses = Sets.<Class<?>> newHashSet( //
- Platform.getBundle("org.eclipse.gmf.runtime.diagram.ui.actions").loadClass("org.eclipse.gmf.runtime.diagram.ui.actions.internal.PropertyChangeContributionItem"), //
- Platform.getBundle("org.eclipse.ui.workbench").loadClass("org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener"));
- } catch (Exception e) {
- throw new ExceptionInInitializerError(e);
- }
- }
-
- static ListenerList getOperationHistoryListeners() {
- try {
- return (ListenerList) listenersField.get(PlatformUI.getWorkbench().getOperationSupport().getOperationHistory());
- } catch (Exception e) {
- org.junit.Assert.fail(e.getLocalizedMessage());
- return null; // Unreachable
- }
- }
-
- static boolean shouldRemoveHistoryListener(Object listener) {
- boolean result = historyListenerClasses.contains(listener.getClass().getName());
-
- if (!result) {
- // Maybe it's a subclass
- for (Class<?> next : historyListenerClasses) {
- if (next.isInstance(listener)) {
- // Remember this
- historyListenerClasses.add(listener.getClass());
- result = true;
- break;
- }
- }
- }
-
- return result;
- }
- }
-
- /**
- * Protocol for a delegate that provides the default test framework behaviour
- * for the classification runner. These methods are as specified by the
- * corresponding APIs of the {@link BlockJUnit4ClassRunner} class.
- */
- interface Delegate {
- void runChild(FrameworkMethod method, RunNotifier notifier);
-
- Description describeChild(FrameworkMethod method);
-
- Object createTest() throws Exception;
-
- List<TestRule> getTestRules(Object target);
-
- Statement classBlock(RunNotifier notifier);
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java
deleted file mode 100644
index ca3079f3052..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParameters.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * 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.junit.framework.classification;
-
-import java.util.List;
-
-import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-import org.junit.runners.Parameterized.UseParametersRunnerFactory;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.Statement;
-import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters;
-import org.junit.runners.parameterized.TestWithParameters;
-
-/**
- * A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests,
- * for use with test {@link Parameters}.
- *
- * It ignores the test methods according to their annotations, and the policy defined
- * in {@link ClassificationConfig}.
- *
- * @see Parameterized
- * @see UseParametersRunnerFactory
- * @see ClassificationRunnerWithParametersFactory
- * @see ClassificationConfig
- * @see TestCategory
- * @see Conditional
- *
- */
-public class ClassificationRunnerWithParameters extends BlockJUnit4ClassRunnerWithParameters {
-
- private final ClassificationRunnerImpl impl;
-
- public ClassificationRunnerWithParameters(TestWithParameters test) throws InitializationError {
- super(test);
-
- this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() {
-
- @Override
- public void runChild(FrameworkMethod method, RunNotifier notifier) {
- ClassificationRunnerWithParameters.super.runChild(method, notifier);
- }
-
- @Override
- public Description describeChild(FrameworkMethod method) {
- return ClassificationRunnerWithParameters.super.describeChild(method);
- }
-
- @Override
- public Object createTest() throws Exception {
- return ClassificationRunnerWithParameters.super.createTest();
- }
-
- @Override
- public List<TestRule> getTestRules(Object target) {
- return ClassificationRunnerWithParameters.super.getTestRules(target);
- }
-
- @Override
- public Statement classBlock(RunNotifier notifier) {
- return ClassificationRunnerWithParameters.super.classBlock(notifier);
- }
-
- });
- }
-
- @Override
- protected void runChild(FrameworkMethod method, RunNotifier notifier) {
- impl.runChild(method, notifier);
- }
-
- @Override
- public Object createTest() throws Exception {
- return impl.createTest();
- }
-
- @Override
- protected List<TestRule> getTestRules(Object target) {
- return impl.getTestRules(target);
- }
-
- @Override
- protected Statement classBlock(RunNotifier notifier) {
- return impl.classBlock(notifier);
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java
deleted file mode 100644
index bfb7a29468b..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationRunnerWithParametersFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************************
- * 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.junit.framework.classification;
-
-import org.junit.runner.RunWith;
-import org.junit.runner.Runner;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.UseParametersRunnerFactory;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.parameterized.ParametersRunnerFactory;
-import org.junit.runners.parameterized.TestWithParameters;
-
-/**
- * Factory for classification-sensitive parameterized test suites.
- * Specify this factory in the {@literal @}{@link UseParametersRunnerFactory}
- * annotation on your <tt>{@literal @}{@link RunWith}({@link Parameterized}.class)</tt>
- * test class to support the classfication and condition annotations of the Papyrus
- * test framework.
- *
- * @see Parameterized
- * @see UseParametersRunnerFactory
- * @since 1.2
- */
-public class ClassificationRunnerWithParametersFactory implements ParametersRunnerFactory {
-
- public ClassificationRunnerWithParametersFactory() {
- super();
- }
-
- @Override
- public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
- return new ClassificationRunnerWithParameters(test);
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java
deleted file mode 100644
index a7bf1c0d3b3..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ClassificationSuite.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christian W. Damus - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.util.ArrayDeque;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.Iterator;
-import java.util.List;
-
-import org.junit.runner.Description;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.Suite;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.RunnerBuilder;
-import org.junit.runners.model.Statement;
-
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.AbstractIterator;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.ObjectArrays;
-
-/**
- * A specialized Test {@linkplain Suite Suite} runner that recognizes the Papyrus-specific
- * {@link ClassificationConfig classification} annotations on the suite as a whole. It also
- * supports a dynamic specification of test suites to include via the {@literal @}{@link DynamicClasses}
- * annotation, especially useful for generated tests that may or may not have been generated at
- * the time of test execution (or at least of compilation of the test suite class).
- */
-public class ClassificationSuite extends Suite {
-
- /**
- * Mapping of whether any tests at all in a suite tree are statically enabled, according to
- * their annotations.
- */
- private static final LoadingCache<Description, Boolean> enabledSuites = CacheBuilder.newBuilder().build(
- CacheLoader.from(ClassificationSuite::isEnabled));
-
- private Description description;
-
- public ClassificationSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
- this(builder, klass, getAnnotatedClasses(klass));
- }
-
- public ClassificationSuite(Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
- super(klass, withDynamicSuites(klass, suiteClasses));
- }
-
- public ClassificationSuite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
- super(builder, klass, withDynamicSuites(klass, suiteClasses));
- }
-
- private static Class<?>[] getAnnotatedClasses(Class<?> class_) throws InitializationError {
- SuiteClasses annotation = class_.getAnnotation(SuiteClasses.class);
- if (annotation == null) {
- throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", class_.getName()));
- }
- return annotation.value();
- }
-
- private static Class<?>[] withDynamicSuites(Class<?> suiteClass, Class<?>[] staticSuites) {
- Class<?>[] result = staticSuites;
-
- Class<?>[] dynamicSuites = getDynamicSuites(suiteClass);
- if (dynamicSuites.length > 0) {
- result = ObjectArrays.concat(staticSuites, dynamicSuites, Class.class);
- }
-
- return result;
- }
-
- private static Class<?>[] getDynamicSuites(Class<?> suiteClass) {
- List<Class<?>> result;
-
- DynamicClasses dynclasses = suiteClass.getAnnotation(DynamicClasses.class);
- if (dynclasses == null) {
- result = Collections.emptyList();
- } else {
- result = Lists.newArrayListWithCapacity(dynclasses.value().length);
- for (String classname : dynclasses.value()) {
- try {
- result.add(suiteClass.getClassLoader().loadClass(classname));
- } catch (Exception e) {
- // OK. It's not there, so we just ignore it
- }
- }
- }
-
- return Iterables.toArray(result, Class.class);
- }
-
- @Override
- protected List<Runner> getChildren() {
- // If I don't match the current configuration, none of my tests will run, so don't even provide them
- // because they just inflate the size of the progress meter
- if (ClassificationConfig.shouldRun(getRunnerAnnotations())) {
- return super.getChildren();
- } else {
- return Collections.emptyList();
- }
- }
-
- @Override
- public void run(RunNotifier notifier) {
- // If I don't match the current configuration, none of my tests should be run
- if (ClassificationConfig.shouldRun(getRunnerAnnotations())) {
- super.run(notifier);
- } else {
- Description description = getDescription();
- notifier.fireTestIgnored(description);
- }
- }
-
- @Override
- protected Statement classBlock(final RunNotifier notifier) {
- // We never throw in these lazy calculations
- return enabledSuites.getUnchecked(getDescription())
- // Include the @BeforeClass, @AfterClass, and @ClassRule steps
- ? super.classBlock(notifier)
- // Just the bare bones to record everything that is skipped
- : skipAll(notifier);
- }
-
- @Override
- public Description getDescription() {
- if (description == null) {
- description = super.getDescription();
- }
- return description;
- }
-
- /**
- * Creates a statement that simply skips all of the tests in my suite, recursively.
- *
- * @param notifier
- * tracks the execution (or, rather, skipping) of the tests
- *
- * @return the all-skipping statement
- */
- protected Statement skipAll(RunNotifier notifier) {
- return new Statement() {
- @Override
- public void evaluate() {
- skipAll(getDescription(), notifier);
- }
- };
- }
-
- /**
- * Skips all of the tests in the given {@code suite}, recursively.
- *
- * @param suite
- * a test suite to skip
- * @param notifier
- * tracks the execution (or, rather, skipping) of the tests
- */
- protected void skipAll(Description suite, RunNotifier notifier) {
- for (Description next : suite.getChildren()) {
- if (next.isSuite()) {
- skipAll(next, notifier);
- } else {
- notifier.fireTestIgnored(next);
- }
- }
-
- notifier.fireTestIgnored(suite);
- }
-
- /**
- * Queries whether a given {@code suite} will run any tests at all.
- *
- * @param suite
- * a test suite
- * @return whether it has any leaf tests that will not be ignored for some reason
- */
- static boolean isEnabled(Description suite) {
- boolean result = false;
-
- for (Description leaf : getLeafTests(suite)) {
- Iterable<Annotation> annotations = Iterables.concat(
- leaf.getAnnotations(),
- Arrays.asList(leaf.getTestClass().getAnnotations()));
-
- if (ClassificationConfig.shouldRun(Iterables.toArray(annotations, Annotation.class))) {
- result = true;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * Obtains an iteration of all of the leaf-level tests in a {@code suite}, in depth-first order.
- *
- * @param suite
- * a test suite to iterate
- *
- * @return all of its leaf-level tests
- */
- static Iterable<Description> getLeafTests(Description suite) {
- return new Iterable<Description>() {
-
- @Override
- public Iterator<Description> iterator() {
- return new AbstractIterator<Description>() {
- Deque<Iterator<Description>> stack = new ArrayDeque<>();
- Iterator<Description> current = suite.getChildren().iterator();
-
- // Advance the tractor
- Iterator<Description> feed() {
- while (!current.hasNext()) {
- current = stack.pollLast();
-
- if (current == null) {
- current = Collections.emptyIterator();
- break;
- }
- }
-
- return current;
- }
-
- void push(Description suite) {
- stack.addLast(current);
- current = suite.getChildren().iterator();
- }
-
- @Override
- protected Description computeNext() {
- Description result = null;
-
- while ((result == null) && feed().hasNext()) {
- Description next = feed().next();
-
- if (next.isTest() && (next.getTestClass() != null)) {
- result = next;
- } else if (next.isSuite()) {
- // Push this suite onto the stack
- push(next);
- } else {
- // Otherwise it's a weird test without a class?!?
- System.err.println("Leaf test without a class: " + next);
- }
- }
-
- if (result == null) {
- result = endOfData();
- }
-
- return result;
- }
- };
- }
- };
- }
-
- //
- // Nested types
- //
-
- /**
- * An annotation like the {@literal @}{@link SuiteClasses} that specifies, by name, test suite classes
- * to find and include dynamically. Any that are not available are simply ignored.
- */
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
- public @interface DynamicClasses {
- /**
- * Names of test suite classes to optionally include in the test suite.
- */
- String[] value();
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java
deleted file mode 100644
index 2abeedb12ed..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/ExpensiveTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-/**
- * Indicates that a test is expensive, and should be excluded from a Lightweight test job (e.g. Gerrit)
- *
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ExpensiveTest {
-
- /**
- * A description
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java
deleted file mode 100644
index d528a7048d8..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/FailingTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-/**
- * Indicates that a test currently fails. It can be used to sort new (unidentified) regressions
- * from known (reported) issues.
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface FailingTest {
-
- /**
- * A specific message explaining why this test is failing
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java
deleted file mode 100644
index 7f1737a053f..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/GeneratedTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-/**
- * Indicates that this test has been generated with the Papyrus Test Generation Framework
- * (see https://wiki.eclipse.org/Papyrus_Developer_Guide/Automatic_Test_Generation_for_Diagram_Editors)
- *
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- * @since 1.2
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface GeneratedTest {
-
- /**
- * A description
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java
deleted file mode 100644
index 5f941503360..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InteractiveTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that a test is interactive, e.g. it opens a user dialog. Such tests cannot be run
- * automatically and should be disabled on Hudson
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface InteractiveTest {
-
- /**
- * A specific message explaining why this test is failing
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java
deleted file mode 100644
index b11dc8588d1..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/InvalidTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that a test may fail because it is not properly implemented
- * (e.g. not compatible with Hudson, because it opens some blocking dialogs)
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface InvalidTest {
-
- /**
- * A specific message explaining why this test may be invalid
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java
deleted file mode 100644
index f4a98258268..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/NotImplemented.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that a test may fail because the tested feature
- * is not yet implemented (Test-driven development)
- *
- * This annotation must be used with the {@link ClassificationRule}
- *
- * @author Camille Letavernier
- *
- */
-@Target({ ElementType.METHOD, ElementType.TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface NotImplemented {
-
- /**
- * A specific message explaining what needs to be implemented
- * for this test to run
- *
- * @return
- */
- String value() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java
deleted file mode 100644
index aee739aa5ec..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/TestCategory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification;
-
-import java.lang.annotation.Annotation;
-
-/**
- * Enumerates all available TestCategories
- *
- * @author Camille Letavernier
- *
- */
-public enum TestCategory {
-
- /**
- * Test methods annotated with {@link NotImplemented}
- */
- NotImplemented(NotImplemented.class),
-
- /**
- * Test methods annotated with {@link InvalidTest}
- */
- InvalidTest(InvalidTest.class),
-
- /**
- * Test methods annotated with {@link FailingTest}
- */
- FailingTest(FailingTest.class),
-
- /**
- * Test methods annotated with {@link InteractiveTest}
- */
- InteractiveTest(InteractiveTest.class),
-
- /**
- * Test methods annotated with {@link GeneratedTest}
- */
- GeneratedTest(GeneratedTest.class),
-
- /**
- * Test methods annotated with {@link ExpensiveTest}
- */
- ExpensiveTest(ExpensiveTest.class),
-
- /**
- * Test methods without any classification-related annotation
- */
- Standard();
-
- private Class<? extends Annotation> annotationClass;
-
- private TestCategory() {
- //Empty constructor for Standard
- }
-
- private TestCategory(Class<? extends Annotation> annotationClass) {
- this.annotationClass = annotationClass;
- }
-
- public boolean match(Class<? extends Annotation> annotationClass) {
- return annotationClass == this.annotationClass;
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java
deleted file mode 100644
index 27ac6215098..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Condition.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2014 CEA 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 (CEA) - Initial API and implementation
- *
- */
-package org.eclipse.papyrus.junit.framework.classification.rules;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-/**
- * An annotation on a boolean-valued field or method that implements a condition to test for {@linkplain Conditional conditional execution} of test
- * cases. The {@link #key() key} is optional; the implicit key is the field or method name.
- *
- * @see Conditional
- * @see ConditionRule
- */
-@Target({ ElementType.METHOD, ElementType.FIELD })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Condition {
-
- String key() default "";
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java
deleted file mode 100644
index d7db493547f..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/ConditionRule.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2014 CEA 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 (CEA) - Initial API and implementation
- *
- */
-package org.eclipse.papyrus.junit.framework.classification.rules;
-
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-
-import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner;
-import org.junit.Assume;
-import org.junit.Rule;
-import org.junit.rules.MethodRule;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.Statement;
-
-
-/**
- * <p>
- * A JUnit {@linkplain Rule rule} that skips tests annotated as {@linkplain Conditional @Conditional} when their {@linkplain Condition conditions} are
- * not satisfied. This model is compatible with the JUnit execution and reporting in the Papyrus Hudson build, which does not understand
- * {@linkplain Assume#assumeThat(Object, org.hamcrest.Matcher) assumption failures} and reports them as test failures.
- * </p>
- * <p>
- * <b>Note</b> that this is not ideal, as tests will be reported in the JDT's JUnit view as passes, when in fact they should be reported as skipped.
- * It is better to use the {@link ClassificationRunner} if possible (such as when not using some other test runner).
- * </p>
- *
- * @see Conditional
- * @see Condition
- * @see Rule
- * @see ClassificationRunner
- */
-public class ConditionRule implements MethodRule {
-
- public ConditionRule() {
- super();
- }
-
- public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
- return new Statement() {
-
- @Override
- public void evaluate() throws Throwable {
- if(testCondition(method.getMethod().getDeclaringClass(), method.getAnnotation(Conditional.class), target)) {
- base.evaluate();
- }
- }
- };
- }
-
- public static boolean testCondition(Class<?> testClass, Conditional conditional, Object test) {
- boolean result = true;
-
- if(conditional != null) {
- Method conditionMethod = findConditionMethod(testClass, conditional);
- if(conditionMethod != null) {
- result = evaluateCondition(conditionMethod, test);
- } else {
- Field conditionField = findConditionField(testClass, conditional);
- if(conditionField != null) {
- result = evaluateCondition(conditionField, test);
- } else {
- fail("Condition not found: " + conditional.key());
- }
- }
- }
-
- return result;
- }
-
- static Method findConditionMethod(Class<?> testClass, Conditional conditional) {
- Method result = null;
-
- for(Method next : testClass.getDeclaredMethods()) {
- Condition condition = next.getAnnotation(Condition.class);
- if((condition != null) && match(conditional.key(), condition, next)) {
- result = next;
- break;
- }
- }
-
- return result;
- }
-
- static Field findConditionField(Class<?> testClass, Conditional conditional) {
- Field result = null;
-
- for(Field next : testClass.getDeclaredFields()) {
- Condition condition = next.getAnnotation(Condition.class);
- if((condition != null) && match(conditional.key(), condition, next)) {
- result = next;
- break;
- }
- }
-
- return result;
- }
-
- static boolean evaluateCondition(Method conditionMethod, Object test) {
- boolean result = true;
-
- try {
- result = (Boolean)conditionMethod.invoke(test);
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- fail("Condition method evaluation failed: " + e.getTargetException().getLocalizedMessage());
- } catch (Exception e) {
- fail(String.format("Condition method must be public, accept no arguments, and return a boolean result: %s::%s()", conditionMethod.getDeclaringClass().getSimpleName(), conditionMethod.getName()));
- }
-
- return result;
- }
-
- static boolean evaluateCondition(Field conditionField, Object test) {
- boolean result = true;
-
- try {
- result = (Boolean)conditionField.get(test);
- } catch (Exception e) {
- fail(String.format("Condition field must be public and boolean-valued: %s::%s", conditionField.getDeclaringClass().getSimpleName(), conditionField.getName()));
- }
-
- return result;
- }
-
- static boolean match(String conditionKey, Condition condition, Member conditionMember) {
- String match = condition.key();
- if((match == null) || match.equals("")) {
- match = conditionMember.getName();
- }
-
- return match.equals(conditionKey);
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java
deleted file mode 100644
index a8c4dc0153d..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/Conditional.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2014 CEA 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 (CEA) - Initial API and implementation
- *
- */
-package org.eclipse.papyrus.junit.framework.classification.rules;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.junit.Test;
-
-
-/**
- * An annotation for {@linkplain Test test methods} that are to be executed conditionally. The {@link #key() key} indicates a field or method
- * annotated with {@link Condition @Condition}. If the condition evaluates {@code false}, the test case is skipped.
- *
- * @see Condition
- * @see ConditionRule
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Conditional {
-
- /**
- * Identifies a condition field or method annotated with {@link Condition @Condition}, which either specifies an explicit
- * {@linkplain Condition#key() key} or implicit by field/method name.
- *
- * @return the key of the condition to evaluate
- */
- String key();
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java
deleted file mode 100644
index 6fbd9611fad..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 CEA, 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 (CEA) - Initial API and implementation
- * Christian W. Damus - bug 451013
- * Christian W. Damus - bug 483721
- *
- */
-package org.eclipse.papyrus.junit.framework.classification.rules;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.SoftReference;
-import java.lang.ref.WeakReference;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.Request;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-
-/**
- * A simple JUnit rule for tracking memory leaks. Simply {@linkplain #add(Object) add objects} during your test execution, make assertions if desired,
- * and on successful completion of the body of the test, this rule verifies that none of the tracked objects have leaked.
- * Tests that are sensitive to references being retained temporarily via {@link SoftReference}s should be annotated as {@link SoftReferenceSensitive
- * &#x40;SoftReferenceSensitive} so that the rule may employ extra measures to ensure that soft references are cleared.
- *
- * @see SoftReferenceSensitive
- */
-public class MemoryLeakRule extends TestWatcher {
- private static final boolean DEBUG = Boolean.getBoolean("MemoryLeakRule.debug");
-
- private static final int DEQUEUE_REF_ITERATIONS = 3;
-
- private static final int DEQUEUE_REF_TIMEOUT = 1000; // Millis
-
- private static final int GC_ITERATIONS = 10;
-
- private static final int CLEAR_SOFT_REFS_ITERATIONS = 3;
-
- private static final Map<Class<?>, Boolean> WARMED_UP_SUITES = new WeakHashMap<Class<?>, Boolean>();
-
- private static boolean warmingUp;
-
- private ReferenceQueue<Object> queue;
-
- private List<WeakReference<Object>> tracker;
-
- private String testName;
-
- private Class<?> testClass;
-
- private boolean isSoftReferenceSensitive;
-
- public MemoryLeakRule() {
- super();
- }
-
- public void add(Object leak) {
- assertThat("Cannot track null references for memory leaks.", leak, notNullValue());
-
- if (queue == null) {
- queue = new ReferenceQueue<Object>();
- tracker = Lists.newArrayList();
- }
-
- tracker.add(new WeakReference<Object>(leak, queue));
- }
-
- public String getTestName() {
- return testName;
- }
-
- @Override
- protected void starting(Description description) {
- testName = description.getMethodName();
- testClass = description.getTestClass();
-
- isSoftReferenceSensitive = description.getAnnotation(SoftReferenceSensitive.class) != null;
-
- if (isSoftReferenceSensitive && !isWarmedUp() && !warmingUp) {
- // Warm up the soft-reference sensitive tests by running this one up-front, first,
- // because the first such test to execute always results in a spurious failure
- // (at least, such is the case on the Mac build of JRE 1.6)
- warmingUp = true;
- try {
- warmUp();
- } finally {
- warmingUp = false;
- }
- }
- }
-
- @Override
- protected void succeeded(Description description) {
- // If the test's assertions (if any) all succeeded, then check for leaks on the way out
- if (tracker == null) {
- // No leaks to assert
- return;
- }
-
- // Assert that our tracked objects are now all unreachable
- while (!tracker.isEmpty()) {
- Reference<?> ref = dequeueTracker();
-
- for (int i = 0; ((ref == null) && isSoftReferenceSensitive) && (i < CLEAR_SOFT_REFS_ITERATIONS); i++) {
- // Maybe there are soft references retaining our objects? Desperation move.
- // On some platforms, our simulated OOME doesn't actually purge all soft
- // references (contrary to Java spec!), so we have to repeat
- forceClearSoftReferenceCaches();
-
- // Try once more
- ref = dequeueTracker();
- }
-
- if (!tracker.remove(ref) && !tracker.isEmpty()) {
- // The remaining tracked elements are leaked
- final String leaks = Joiner.on('\n').join(Iterables.transform(tracker, label()));
- if (warmingUp) {
- debug("Warm-up detected leaks: %s%n", leaks.replace('\n', ' '));
- }
- fail("One or more objects leaked:\n" + leaks);
- break; // Unreachable
- }
- }
- }
-
- @Override
- protected void finished(Description description) {
- // Clean up
- tracker = null;
- queue = null;
- }
-
- Reference<?> dequeueTracker() {
- Reference<?> result = null;
-
- try {
- for (int i = 0; (result == null) && (i < DEQUEUE_REF_ITERATIONS); i++) {
- // Try to force GC
- collectGarbage();
-
- result = queue.remove(DEQUEUE_REF_TIMEOUT);
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- fail("JUnit was interrupted");
- }
-
- return result;
- }
-
- Function<WeakReference<?>, String> label() {
- return new Function<WeakReference<?>, String>() {
-
- @Override
- public String apply(WeakReference<?> input) {
- return label(input.get());
- }
- };
- }
-
- String label(Object input) {
- String result = null;
-
- if (!(input instanceof EObject)) {
- result = String.valueOf(input);
- } else {
- EObject object = (EObject) input;
- EClass eclass = object.eClass();
- String label = null;
-
- EStructuralFeature nameFeature = eclass.getEStructuralFeature("name"); //$NON-NLS-1$
- if (nameFeature != null) {
- label = String.valueOf(object.eGet(nameFeature));
- } else {
- // Look for anything label-like
- for (EAttribute next : eclass.getEAllAttributes()) {
- if (!next.isMany() && next.getEAttributeType().getInstanceClass() == String.class) {
- label = (String) object.eGet(next);
- if ((label != null) && !label.isEmpty()) {
- break;
- }
- }
- }
- }
-
- result = String.format("<%s> %s", eclass.getName(), label);
- }
-
- return result;
- }
-
- void collectGarbage() {
- // Try a few times to decrease the amount of used heap space
- final Runtime rt = Runtime.getRuntime();
-
- Long usedMem = rt.totalMemory() - rt.freeMemory();
- Long prevUsedMem = usedMem;
-
- for (int i = 0; (prevUsedMem <= usedMem) && (i < GC_ITERATIONS); i++) {
- rt.gc();
- Thread.yield();
-
- prevUsedMem = usedMem;
- usedMem = rt.totalMemory() - rt.freeMemory();
- }
- }
-
- void forceClearSoftReferenceCaches() {
- // There are components in the Eclipse workbench that maintain soft references to objects for
- // performance caches. For example, the the Common Navigator Framework used by Model Explorer
- // caches mappings of elements in the tree to the content extensions that provided them using
- // EvalutationReferences [sic] that are SoftReferences
-
- // This is a really gross HACK and runs the risk that some other thread(s) also may see OOMEs!
- try {
- List<Object[]> hog = Lists.newLinkedList();
- for (;;) {
- hog.add(new Object[getLargeMemorySize()]);
- }
- } catch (OutOfMemoryError e) {
- // Good! The JVM guarantees that all soft references are cleared before throwing OOME,
- // so we can be assured that they are now cleared
- } finally {
- if (warmingUp) {
- // We have successfully warmed up the soft-references hack
- WARMED_UP_SUITES.put(testClass, true);
- }
- }
- }
-
- private static int getLargeMemorySize() {
- // These 64 megs are multiplied by the size of a pointer!
- return 64 * 1024 * 1024;
- }
-
- private boolean isWarmedUp() {
- return Boolean.TRUE.equals(WARMED_UP_SUITES.get(testClass));
- }
-
- private void warmUp() {
- // The first test that relies on the soft-reference clearing hack will
- // always fail, so run such a test once up-front. Call this a metahack
-
- try {
- debug("Warming up test suite: %s (%s)%n", testClass.getName(), testName);
- new JUnitCore().run(Request.method(testClass, testName));
- } catch (Exception e) {
- // Fine, so the warm-up didn't work
- e.printStackTrace();
- }
- }
-
- private static void debug(String format, Object... args) {
- if (DEBUG) {
- System.err.printf("[MEM] " + format, args);
- }
- }
-
- //
- // Nested types
- //
-
- /**
- * Annotates a test that is sensitive to references being cached by {@link SoftReference}s.
- * Such tests will take additional drastic measures to try to force the JVM to clear soft
- * reference caches in order to release all possible references to objects tracked for leaks.
- * Because the first such test is expected always to result in a spurious failure (at least,
- * such is the case on the Mac OS X build of J2SE 1.6), the rule "warms up" the test suite
- * by running one such test in isolation before running any others.
- */
- @Target(ElementType.METHOD)
- @Retention(RetentionPolicy.RUNTIME)
- public static @interface SoftReferenceSensitive {
- // Empty annotation
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java
deleted file mode 100644
index f77b5076241..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/tests/AbstractPapyrusTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2014 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.classification.tests;
-
-import org.eclipse.papyrus.junit.framework.classification.ClassificationRunner;
-import org.junit.runner.RunWith;
-
-/**
- * An abstract class which should be extended by all Papyrus tests
- *
- * It provides generic support for papyrus-specific annotations (e.g. ClassificationRunner)
- *
- * @author Camille Letavernier
- *
- */
-@RunWith(ClassificationRunner.class)
-public abstract class AbstractPapyrusTest {
- //Abstract test class for using the Classification Runner
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java
deleted file mode 100644
index f7b32e833a5..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/AllTestsRunner.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * 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 - bug 399859
- * Christian W. Damus - bug 451230
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.junit.framework.runner;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.runners.Suite;
-import org.junit.runners.model.FrameworkField;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.TestClass;
-
-/**
- * Finds and runs tests.
- */
-public class AllTestsRunner extends Suite {
-
- /**
- * Constructor.
- *
- * @param clazz
- * the suite class � AllTests2
- * @throws InitializationError
- * if there's a problem
- * @throws org.junit.runners.model.InitializationError
- */
- public AllTestsRunner(final Class<?> clazz) throws InitializationError {
- super(clazz, getSuites(clazz));
- }
-
- /**
- * Returns the list of test classes
- *
- * @return the list of test classes
- */
- static Class<?>[] getSuites(final Class<?> clazz) {
- // retrieve all test suites.
- final Collection<Class<?>> suites = new ArrayList<Class<?>>();
-
- TestClass testClass = new TestClass(clazz);
- List<ITestSuiteClass> suiteClassSpecs = new ArrayList<ITestSuiteClass>();
- List<FrameworkField> suiteSpots = testClass.getAnnotatedFields(SuiteSpot.class);
- for (FrameworkField spot : suiteSpots) {
- if (spot.isStatic()) {
- try {
- Object value = spot.get(null);
- Iterable<?> listValue;
- if (value instanceof Object[]) {
- listValue = Arrays.asList((Object[]) value);
- } else if (value instanceof Iterable<?>) {
- listValue = (Iterable<?>) value;
- } else {
- listValue = Collections.emptyList();
- }
- for (Object next : listValue) {
- if (next instanceof ITestSuiteClass) {
- suiteClassSpecs.add((ITestSuiteClass) next);
- }
- }
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
- if (suiteClassSpecs.isEmpty()) {
- System.err.println("No suite classes specified in class " + clazz.getName());
- } else {
- for (final ITestSuiteClass testSuiteClass : suiteClassSpecs) {
- final Class<?> class_ = testSuiteClass.getMainTestSuiteClass();
- if (class_ != null) {
- suites.add(class_);
- } else {
- System.err.println(testSuiteClass + " does not give a correct test suite class");
- }
- }
- }
- return suites.toArray(new Class<?>[] {});
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java
deleted file mode 100644
index 8f1e3ed6e93..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/FragmentTestSuiteClass.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Christian W. Damus - bugs 451230, 488791
- *
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.runner;
-
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Test Suite class entry for a test fragment.
- *
- * @deprecated As of 2.0, All test suites should be plug-in bundles, not fragment bundles.
- */
-@Deprecated
-public class FragmentTestSuiteClass implements ITestSuiteClass {
-
- /** unique identifier of the bundle host */
- private final String hostBundleId;
-
- /** qualified name of the test suite class */
- private final String classQualifiedName;
-
- /**
- * Constructor.
- *
- * @param hostBundleId
- * unique identifier of the bundle host
- * @param classQualifiedName
- * qualified name of the test suite class
- */
- public FragmentTestSuiteClass(String hostBundleId, String classQualifiedName) {
- this.hostBundleId = hostBundleId;
- this.classQualifiedName = classQualifiedName;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Class<?> getMainTestSuiteClass() {
- Bundle bundle = Platform.getBundle(hostBundleId);
- if (bundle == null) {
- System.err.println("Impossible to find bundle: " + hostBundleId);
- } else {
- try {
- Class<?> class_ = bundle.loadClass(classQualifiedName);
- return class_;
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return String.format("FragmentTestSuite %s/%s", hostBundleId, classQualifiedName);
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java
deleted file mode 100644
index d3411958e2b..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Headless.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************
- * 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.junit.framework.runner;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Marker annotation for test suites that can (and should be) run in "headless mode"
- * (without the Eclipse Workbench).
- *
- * @since 1.2
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE, ElementType.PACKAGE })
-public @interface Headless {
- // Empty
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java
deleted file mode 100644
index 17043f3bbd5..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ITestSuiteClass.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Christian W. Damus - bugs 451230, 485220
- *
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.runner;
-
-
-/**
- * Interface for all suite classes.
- */
-public interface ITestSuiteClass {
-
- /**
- * Returns the main test suite class for this entry
- *
- * @return the main test suite class for this entry
- */
- public Class<?> getMainTestSuiteClass();
-
- /**
- * Queries whether the test suite runs in "headless mode" (without the Eclipse Workbench).
- *
- * @return whether I am an headless test suite
- * @since 1.2
- */
- default boolean isHeadless() {
- Class<?> main = getMainTestSuiteClass();
- return (main != null) && main.isAnnotationPresent(Headless.class);
- }
-
- /**
- * Queries whether the test suite runs in "UI mode" (in an Eclipse Workbench).
- *
- * @return whether I am an UI test suite
- * @since 1.2
- */
- default boolean isUI() {
- Class<?> main = getMainTestSuiteClass();
- return (main != null) && !main.isAnnotationPresent(Headless.class);
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java
deleted file mode 100644
index 26a6bdf9f80..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/IgnoreRunner.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christian W. Damus - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.junit.framework.runner;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.util.AbstractTreeIterator;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.junit.runner.Description;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.RunNotifier;
-
-/**
- * A JUnit runner that just ignores all of the leaves of its {@link #getDescription() description} tree.
- */
-public class IgnoreRunner extends Runner {
- private final Description description;
-
- /**
- * Initializes me with the test suite that I ignore.
- */
- public IgnoreRunner(Description testSuite) {
- super();
-
- this.description = testSuite;
- }
-
- @Override
- public Description getDescription() {
- return description;
- }
-
- @Override
- public void run(RunNotifier notifier) {
- for (Iterator<Description> iter = iterator(); iter.hasNext();) {
- Description next = iter.next();
- if (next.isTest()) {
- notifier.fireTestIgnored(next);
- }
- }
- }
-
- TreeIterator<Description> iterator() {
- return new AbstractTreeIterator<Description>(getDescription()) {
- private static final long serialVersionUID = 1L;
-
- @Override
- protected Iterator<? extends Description> getChildren(Object object) {
- return ((Description) object).getChildren().iterator();
- }
- };
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java
deleted file mode 100644
index c7f16a20f7d..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/PluginTestSuiteClass.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Christian W. Damus - bug 451230
- *****************************************************************************/
-package org.eclipse.papyrus.junit.framework.runner;
-
-
-/**
- * Entry for a test suite in a test plugin
- */
-public class PluginTestSuiteClass implements ITestSuiteClass {
-
- /** main test suite class */
- private final Class<?> testClass;
-
- /**
- * Constructor.
- *
- * @param testClass
- * the main test suite class
- */
- public PluginTestSuiteClass(Class<?> testClass) {
- this.testClass = testClass;
- }
-
- /**
- * {@inheritDoc}
- */
- public Class<?> getMainTestSuiteClass() {
- return testClass;
- }
-
- @Override
- public String toString() {
- return String.format("PluginTestSuite %s", testClass);
- }
-
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java
deleted file mode 100644
index 6a21299ad24..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/Scenario.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christian W. Damus - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.junit.framework.runner;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation on a public instance method that defines a test scenario having multiple distinct
- * and potentially independent verification points.
- *
- * @see ScenarioRunner
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Scenario {
- /**
- * Specifies the labels of the verification points in the scenario, in order.
- */
- String[] value();
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java
deleted file mode 100644
index 5f3142832bf..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/ScenarioRunner.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015, 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.junit.framework.runner;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayDeque;
-import java.util.Arrays;
-import java.util.Deque;
-import java.util.List;
-
-import org.eclipse.papyrus.junit.framework.classification.ClassificationConfig;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.Description;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.Failure;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runner.notification.StoppedByUserException;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.ParentRunner;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.RunnerBuilder;
-import org.junit.runners.model.Statement;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
-
-/**
- * <p>
- * A scenario-based test runner. A method annotated with {@link Scenario @Scenario} lays out a scenario and at various places where something is to be verified, calls this class's static {@link #verificationPoint()} method as an {@code if} condition to guard a
- * block of assertion statements. The {@link Scenario @Scenario} annotation provides the labels of the verification points, in the order in which they appear. Each verification point is surfaced as a separate test, which may pass or fail independently of the
- * others.
- * </p>
- * <p>
- * Classic {@link Test @Test} methods are supported by this runner, also. They are run in the usual way, not as scenarios with multiple verification points.
- * </p>
- *
- * @see Scenario
- * @see #verificationPoint()
- */
-public class ScenarioRunner extends ParentRunner<Runner> {
-
- private static final Deque<VerificationPointsRunner> runnerStack = new ArrayDeque<VerificationPointsRunner>();
-
- public ScenarioRunner(Class<?> testClass) throws InitializationError {
- super(testClass);
- }
-
- @Override
- protected List<Runner> getChildren() {
- Iterable<FrameworkMethod> methods = Iterables.concat(
- getTestClass().getAnnotatedMethods(Test.class),
- getTestClass().getAnnotatedMethods(Scenario.class));
- return ImmutableList.copyOf(Iterables.transform(methods, new Function<FrameworkMethod, Runner>() {
- @Override
- public Runner apply(FrameworkMethod input) {
- return new VerificationPointsRunnerBuilder(input).build();
- }
- }));
- }
-
- @Override
- protected Description describeChild(Runner child) {
- return child.getDescription();
- }
-
- @Override
- protected void runChild(Runner child, RunNotifier notifier) {
- if (!(child instanceof VerificationPointsRunner)) {
- // Probably the error-reporting runner
- child.run(notifier);
- } else {
- VerificationPointsRunner points = (VerificationPointsRunner) child;
-
- pushRunner(points);
- points.start();
-
- try {
- points.run(notifier);
- } finally {
- points.finish();
- popRunner();
- }
- }
- }
-
- /**
- * Declares the next verification point in the scenario. Use as the condition of an {@code if} block
- * enclosing the verification point's assertion statements. There must be one verification-point
- * block per verification-point label declared in the {@link Scenario @Scenario} annotation. e.g.,
- *
- * <pre>
- * import static org.eclipse.papyrus.junit.framework.runners.ScenarioRunner.verificationPoint;
- *
- * // ...
- *
- * &#64;Scenario({ "first", "second" })
- * public void myLongAndIntricateScenario() {
- * // Setup stuff ...
- *
- * if (verificationPoint()) {
- * // Assertions here
- * }
- *
- * // More stuff ...
- *
- * if (verificationPoint()) {
- * // More assertions here
- * }
- * }
- * </pre>
- */
- public static boolean verificationPoint() {
- return currentRunner().verificationPoint();
- }
-
- private static VerificationPointsRunner currentRunner() {
- return runnerStack.getLast();
- }
-
- private static VerificationPointsRunner popRunner() {
- return runnerStack.removeLast();
- }
-
- private static void pushRunner(VerificationPointsRunner runner) {
- runnerStack.addLast(runner);
- }
-
- /**
- * Queries whether a test's annotations indicate that it is to be ignored in the
- * current run. That may is if any of the annotations is the {@code @Ignore} annotation
- * or if none of the {@link ClassificationConfig} annotations match the current run.
- *
- * @param testAnnotations
- * a test's annotations (including those inherited from its class)
- *
- * @return whether the test should be skipped
- */
- static boolean isIgnored(Annotation[] testAnnotations) {
- boolean result = !ClassificationConfig.shouldRun(testAnnotations);
-
- if (!result) {
- // Look for the @Ignore annotation
- result = Iterators.filter(Arrays.asList(testAnnotations).iterator(), Ignore.class).hasNext();
- }
-
- return result;
- }
-
- //
- // Nested types
- //
-
- private class VerificationPointsRunnerBuilder extends RunnerBuilder {
- private final FrameworkMethod scenarioMethod;
-
- VerificationPointsRunnerBuilder(FrameworkMethod scenarioMethod) {
- super();
-
- this.scenarioMethod = scenarioMethod;
-
- }
-
- @Override
- public Runner runnerForClass(Class<?> testClass) throws Throwable {
- Runner result;
-
- if (scenarioMethod.getAnnotation(Scenario.class) != null) {
- result = new VerificationPointsRunner(scenarioMethod);
- } else {
- // It's just an @Test method
- result = new JUnitAccess(testClass).classicTest(scenarioMethod);
- }
-
- List<Annotation> allAnnotations = Lists.newArrayList(scenarioMethod.getAnnotations());
- allAnnotations.addAll(Arrays.asList(scenarioMethod.getMethod().getDeclaringClass().getAnnotations()));
- if (isIgnored(Iterables.toArray(allAnnotations, Annotation.class))) {
- result = new IgnoreRunner(result.getDescription());
- }
-
- return result;
- }
-
- public Runner build() {
- return safeRunnerForClass(scenarioMethod.getMethod().getDeclaringClass());
- }
- }
-
- private class VerificationPointsRunner extends ParentRunner<String> {
- private final FrameworkMethod scenarioMethod;
- private final Scenario scenario;
- private final JUnitAccess junit;
-
- private List<String> verpts = Lists.newArrayList();
- private int nextVerificationPoint;
- private Failure lastFailure;
-
- VerificationPointsRunner(FrameworkMethod scenarioMethod) throws InitializationError {
- super(scenarioMethod.getMethod().getDeclaringClass());
-
- this.scenarioMethod = scenarioMethod;
- this.scenario = scenarioMethod.getAnnotation(Scenario.class);
- this.junit = new JUnitAccess(scenarioMethod.getMethod().getDeclaringClass());
- }
-
- @Override
- public Description getDescription() {
- Description result = Description.createSuiteDescription(scenarioMethod.getName(), scenarioMethod.getAnnotations());
- for (Description child : super.getDescription().getChildren()) {
- result.addChild(child);
- }
- return result;
- }
-
- @Override
- protected List<String> getChildren() {
- return Arrays.asList(scenario.value());
- }
-
- @Override
- protected Description describeChild(String child) {
- return Description.createTestDescription(getTestClass().getJavaClass(), scenarioMethod.getName() + ":" + child);
- }
-
- @Override
- protected void runChild(String child, RunNotifier notifier) {
- Description description = describeChild(child);
-
- if (verpts.contains(child)) {
- if (verpts.get(0).equals(child)) {
- // This is the first verification point. It needs to run the scenario method.
- // If all verification points pass, this will be the only execution of that
- // method. Otherwise, if some verification point fails, the next one (if
- // any) will run the scenario again, skipping all verifications before it.
- if (!runScenario(child, description, notifier)) {
- // This run failed, so run again from the beginning of the scenario
- nextVerificationPoint = 0;
- }
- } else {
- // This test failed in a previous execution
- Throwable last = (lastFailure == null)
- ? new AssertionError("Previous execution failed")
- : lastFailure.getException();
- notifier.fireTestStarted(description);
- notifier.fireTestFailure(new Failure(description, last));
- lastFailure = null;
- notifier.fireTestFinished(description);
- }
- } else if (failedLastTime(child)) {
- // This test failed in a previous execution
- notifier.fireTestStarted(description);
- notifier.fireTestFailure(new Failure(description, lastFailure.getException()));
- lastFailure = null;
- notifier.fireTestFinished(description);
- } else {
- // This verification point passed in a previous execution of the scenario
- notifier.fireTestStarted(description);
- notifier.fireTestFinished(description);
- }
- }
-
- void start() {
- verpts.addAll(getChildren());
- nextVerificationPoint = 0;
- }
-
- boolean verificationPoint() {
- final String[] points = scenario.value();
-
- boolean result = ((nextVerificationPoint < points.length)
- && verpts.contains(points[nextVerificationPoint]));
-
- nextVerificationPoint++;
-
- int limit = Math.min(nextVerificationPoint, points.length);
-
- // We have passed all verifications up to this point
- for (int i = 0; i < limit; i++) {
- verpts.remove(points[i]);
- }
-
- return result;
- }
-
- String currentVerificationPoint() {
- final String[] points = scenario.value();
- int index = Math.max(0, Math.min(nextVerificationPoint - 1, points.length - 1));
-
- return points[index];
- }
-
- boolean failedLastTime(String child) {
- boolean result = lastFailure != null;
-
- if (result) {
- final String[] points = scenario.value();
- // If there are no verification points remaining, then is this the last one
- // and it failed in the previous run?
- if (verpts.isEmpty()) {
- result = points[points.length - 1].equals(child);
- } else {
- int successor = Math.max(Arrays.asList(points).indexOf(child) + 1, points.length - 1);
- result = verpts.contains(points[successor]);
- }
- }
-
- return result;
- }
-
- void finish() {
- verpts.clear();
- nextVerificationPoint = scenario.value().length;
- lastFailure = null;
- }
-
- private boolean runScenario(final String child, Description description, final RunNotifier notifier) {
- final boolean[] result = { true };
-
- RunNotifier notifierWrapper = new RunNotifier() {
- @Override
- public void fireTestFailure(Failure failure) {
- result[0] = false;
-
- if (child.equals(currentVerificationPoint())) {
- // This verification point failed
- notifier.fireTestFailure(failure);
- } else {
- // A subsequent verification point failed. This one passed
- lastFailure = failure;
- }
- }
-
- @Override
- public void fireTestAssumptionFailed(Failure failure) {
- result[0] = false;
-
- if (child.equals(currentVerificationPoint())) {
- // This verification point failed
- notifier.fireTestAssumptionFailed(failure);
- } else {
- // A subsequent verification point failed. This one passed
- lastFailure = failure;
- }
- }
-
- @Override
- public void fireTestIgnored(Description description) {
- notifier.fireTestIgnored(description);
- }
-
- @Override
- public void fireTestStarted(Description description) throws StoppedByUserException {
- notifier.fireTestStarted(description);
- }
-
- @Override
- public void fireTestFinished(Description description) {
- notifier.fireTestFinished(description);
- }
- };
-
- runLeaf(junit.methodBlock(scenarioMethod), description, notifierWrapper);
-
- return result[0];
- }
- }
-
- static class JUnitAccess extends BlockJUnit4ClassRunner {
- public JUnitAccess(Class<?> testClass) throws InitializationError {
- super(testClass);
- }
-
- @Override
- protected Statement methodBlock(FrameworkMethod method) {
- return super.methodBlock(method);
- }
-
- // Our test methods are annotated with @Scenario or @Test
- @Override
- protected List<FrameworkMethod> computeTestMethods() {
- List<FrameworkMethod> result = Lists.newArrayList(getTestClass().getAnnotatedMethods(Scenario.class));
- result.addAll(getTestClass().getAnnotatedMethods(Test.class));
- return result;
- }
-
- Runner classicTest(final FrameworkMethod testMethod) {
- return new Runner() {
-
- @Override
- public void run(RunNotifier notifier) {
- runLeaf(methodBlock(testMethod), getDescription(), notifier);
- }
-
- @Override
- public Description getDescription() {
- return Description.createTestDescription(
- getTestClass().getJavaClass(),
- testMethod.getName(),
- testMethod.getAnnotations());
- }
- };
- }
- }
-}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java
deleted file mode 100644
index a745af89a16..00000000000
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/runner/SuiteSpot.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Christian W. Damus - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.junit.framework.runner;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation on a static field of an all-tests suite class using the {@link AllTestsRunner} that
- * provides a collection or array of {@link ITestSuiteClass}es to run.
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface SuiteSpot {
- // Empty annotation
-}

Back to the top