Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-07-23 03:18:27 -0400
committerChristian W. Damus2015-08-12 10:57:45 -0400
commit5b46f47b24f3afd8218cabf1834c850abbc51773 (patch)
treedffa5e4c3911596324489c7487ee6e094f6ab7b9 /plugins/developer/org.eclipse.papyrus.dev.tests.framework
parent2a3e6fb0e0cedaae9111a95e38591623cc990fc5 (diff)
downloadorg.eclipse.papyrus-5b46f47b24f3afd8218cabf1834c850abbc51773.tar.gz
org.eclipse.papyrus-5b46f47b24f3afd8218cabf1834c850abbc51773.tar.xz
org.eclipse.papyrus-5b46f47b24f3afd8218cabf1834c850abbc51773.zip
Bug 464647: [Tests] Generate JUnit tests for diagram view synch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=464647 Adaptation of initial prototype of a Papyrus Tests Generation framework to add diagram synchronization tests. Changes by Christian W. Damus <give.a.damus@gmail.com>: Rebase onto latest Mars maintenance branch. Fix .ignores: ensure that only contents of xtend-gen/ folders are ignored, not the folders themselves Convert Xtend codegen templates to UTF-8 encoding Update the QVTo transformation to support the statically generated UTP profile. This requires: - invoking the UMLResourcesUtil API for stand-alone set-up - updating the profile-registration workflow component to support the registration of a statically generated profile - updating the QVTo transformation to ensure that applicable stereotypes are resolved in the proper ResourceSet context to avoid losing all applied stereotypes in the generated test model. This, in turn, requires a Java black box to handle the EMF-specific concerns of resource-set context that QVTo is not aware of Fix build.properties files to include all sources and POMs to generate sources in xtend-gen/ folder. Fix compilation problems in the integration of the generated tests into the master suite bundle. Update the Tycho build to include the test generation framework bundle. Update the build and Oomph setup to include the UPR profile bundle dependency and the Papyrus Developer tools dependency. Fix numerous codegen problems: - base model does not reflect correct package name for palette tests - inject replaceable templates instead of making them all static - add generation of import statements in suites - fix references to test constants interface - fix references to diagram creation command Fix remaining compilation errors in Use Case tests: - look up the DiagramUpdater class to compute correct import - factor out creation of generated files into an utility extension - factor out generation of the copyright header comment - add some imports to templates that were missing them Refactor Xtend codegen templates to: - improve management of imports - improve names of AllXyzTestsGen suite classes - don't generate test classes that have no test cases - share common code to simplify the specific test case templates Fix more code generation problems: * missing package imports for required edit-part classes * invalid package imports (non-existent edit-part classes) * non-conformant names of diagram creation command and test constants interface. This introduces new attributes to test classes in the model, of String type, specifying the relevant type names. The defaults are computed by the QVTo transformation but may be overridden (hard-coded) by a diagram test's bundle's specific QVTo to provide custom names Add generated tests for Communication Diagram. Fixed workflow infrastructure to support all-tests generation. Use URI mappings to eliminate the need to copy and delete the framework's QVTo files. Add an infrastructure for generation of diagram synchronization tests. This includes * new abstract test classes in the oep.uml.diagram.tests bundle * updates to the framework UML model to capture the new base test classes * new QVTo transformation to generate synchronization tests in the UTP model * new Xtend template to generate synchronization tests from the UTP Fixed various small problems: * unwanted newlines in some test method bodies * fully-qualified references to UMLTypes class in synchronization tests * missing commas in QVTo scripts that cause edit-part names to be concatenated * (a biggie, actually) fix the all-tests generation to avoid repeating all previous transformations at each step Translate QVTo transformation steps to Xtend: Xtend exposes list values in UML models in their native EList terms, which affords stable and predictable ordering of transformation operations and, hence, test model structure and generated code. It also provides for more concise, debuggable, searchable, and performant transformations with better Java integration. Assign predictable, stable XMI identifiers to elements of generated UML models to avoid unnecessary diffs in source control when re-generating. Regenerate code from the Xtend version of the framework. Git-ignore the generated UTP source models because they reference and depend on UML instance models of the GMFGens that are already git-ignored, so there's no point in having these in git. Besides that they are now much larger because of the generated unique XMI IDs. Develop a DSL for compact and readable declarations of transformation rules for test contexts and assembly into packages. This uses new active annotations which, owing to a logistical limitation of Xtend, must be defined in a new separate plug-in project. Finally! Fixed the generation of the wrong diagram-updater instance field reference for Sequence Diagram, which as a legacy diagram still uses TYPED_INSTANCE. This employs a class-file scanning hack that is potentially expensive in I/O, so it uses a new @Cached active annotation that caches method computation results. Complete the specification of generation of view synchronization tests, adding the following scenarios: * synchronize child label nodes in label compartments of top shapes * synchronize child shape nodes in shape compartments of top shapes * synchronize connections between shapes * synchronize connections between shapes where the source owns the semantic link Define a new ClassificationSuite JUnit test runner that supports filtering entire suites by classification annotations. Apply this runner with the @GeneratedTest annotation to all generated test-suite classes. Refine the generation of link creation and synchronization tests to test links only between edit-parts that the GMFGen model reports as valid sources and targets for the links. This vastly reduces the number of invalid test cases generated for elements that cannot be linked (such as Include between an Actor and a Package). Integrate code generation into the build (both maven build and Eclipse workspace) and suppress generated sources from source control. This is implemented as a build profile in a new parent POM for the UML Diagram Tests bundles. Further elaboration and fixes: * rename 'edition' tests as DirectEdit in generated tests (not yet in the framework) * use a generic name for the test class for top node creation from palette * fix test cases for creation of links in containers to actually create the source and target elements in such container * fix the ClassificationConfig to drill into test suites to look for further filtering annotations instead of assuming that the entire suite is a 'standard' test when the 'standard' tests are excluded by the requested configuration * split test cases that execute multiple test scenarios into separate test case methods per test scenario. This ensures that a single test failure doesn't hide several other test results * move @GeneratedTest annotation from test case method to the test context class to reduce overhead of annotations in the VM * use the GMFGen model's information about child node containment to avoid generating all permutations of top-node/child-node, eliminating most of the the invalid child-node creation tests * fix broken references to the UML model for the Ecore metamodel in UML models for the gmfgen and genmodel metamodels by redirecting them to the UML2-provided Ecore metamodel. Delete the obsolete local ecore.uml * define a model of test exceptions for the purpose of constraining the generation of the UML-UTP model to exclude unwanted permutations of edit parts, optionally for specific kinds of tests * enhance the UML-UTP test model generation to filter the tests that it would generate through the optionally provided test exceptions models * add a test exclusions model to the Use Case test bundle to exclude tests for package-import relationships on classifiers (which UML supports but the diagram does not) * generate a CSS stylesheet (attached via an annotation on the test context class) to enable synchronization of the diagrams for tests * fix generation of invalid child-node permutations in the synchronization tests by using the compartment container information in the GMFGen model * fix various bugs in the abstract test framework operations found by running the generated tests Further refinement and fixes: * add some more flexibility to test exceptions model and utilize it for exclusion of some more Class Diagram tests that don't make sense or cannot be generated like the rest * simplify the generation of synchronization tests, removing the specialized M2T templates * fix the deletion tests that failed because the edit-part to be deleted was not selected * fix the tests dealing with child label nodes in nodes that are themselves child nodes by ensuring proper creation of a top-level node to contain the nested node that has the label children * fix abstract appearance test cases, resolving a large proportion of test failures * further simplification of the M2T templates based on structure of the UTP model * don't just not generate excluded tests, but apply the @FailingTest, @NotImplemented, and @Ignore annotations as appropriate to the reason for the test exclusion * now that the UTP model is not managed in source control, it can use generated XMI IDs to save some space (the computed unique IDs were long, based on qualified names) * add another kind of test exception that blanket excludes an edit-part from all tests * add support for completely omitting test cases from the generated code (instead of just annotating them), e.g. for cases where the generated code would not even compile * create a DSL embedded in the transformation workflow for definition of test exceptions, as a convenient and integrated alternative to the test-exceptions model * add default calculation of edit-parts-to-test lists for all kinds of tests, to stream-line the workflow model. Employ this with the new test-exceptions DSL in the Use Case Diagram tests generation workflow as an example of how it all works * further streamlining of the test exceptions DSL with an active annotation generating constants for the reason kinds and multiplicative nesting of edit-part blocks in forbidden permutation rules * adopt the test exceptions DSL in the Class Diagram tests * support injection of custom GMFGen-to-UTP transformation rules * customize the link creation tests in the Class Diagram to fix association link failures caused by odd default name that associations get in the test environment * automatically compute imports for all edit-part classes actually required by the tests, based on the references to edit-parts in the generated activities, to avoid unused import warnings for edit-part classes that would only have been used by tests that were excluded * fix some problems in behavior diagram tests that failed on attempting to create the top container frame (behavior) that was already implicitly created by creation of the diagram * update abstract synchronization tests to take advantage of diagram editor sharing (cherry-picked from streams/1.1-maintenance Id627299a0b28614877cba0e372d980c6bf3ec675) Signed-off-by: jcadavid <juan.cadavid@cea.fr> Signed-off-by: Christian W. Damus <give.a.damus@gmail.com> Change-Id: I59cc3d621889f0caeff78acd6c0eb07c7479268f
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.dev.tests.framework')
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath7
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project34
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs68
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF17
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties14
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html28
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties20
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml71
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml14
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java38
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java135
-rw-r--r--plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java251
13 files changed, 988 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath
new file mode 100644
index 00000000000..098194ca4b7
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project
new file mode 100644
index 00000000000..8b08e018ffe
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.dev.tests.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.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.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f08be2b06c4
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
+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/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..954281dbc31
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,68 @@
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=false
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_Papyrus
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_Papyrus
+formatter_settings_version=12
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * Constructor.\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*****************************************************************************\n * Copyright (c) ${year} CEA LIST and others.\n * \n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors\:\n * CEA LIST - Initial API and implementation\n * \n *****************************************************************************/\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\n * ${see_to_overridden}\n *\n * ${tags}\n */</template><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${see_to_target}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..f3436aa8b9f
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.core.runtime,
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.core.resources;bundle-version="3.10.0",
+ org.eclipse.jdt.launching;bundle-version="3.8.0",
+ org.eclipse.jdt.core;bundle-version="3.11.0",
+ org.eclipse.debug.core;bundle-version="3.10.0"
+Export-Package: org.eclipse.papyrus.dev.tests.framework.internal;x-internal:=true
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.1.0.qualifier
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.dev.tests.framework.internal.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.dev.tests.framework;singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..6d0dcd53e0c
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,14 @@
+#
+# 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
+#
+
+Bundle-Name = Papyrus Diagram Testing Framework Developer Tools
+Bundle-Vendor = Eclipse Modeling Project
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html
new file mode 100644
index 00000000000..d35d5aed64c
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&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>
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties
new file mode 100644
index 00000000000..a4a1a9e46a3
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/build.properties
@@ -0,0 +1,20 @@
+#
+# 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
+#
+
+source.. = src/
+output.. = bin/
+bin.includes = .,\
+ META-INF/,\
+ OSGI-INF/,\
+ about.html,\
+ plugin.xml
+src.includes = about.html
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml
new file mode 100644
index 00000000000..74867e408ea
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/plugin.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ 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
+
+-->
+<plugin>
+ <extension
+ id="org.eclipse.papyrus.dev.tests.framework.nature"
+ point="org.eclipse.core.resources.natures"
+ name="Papyrus Diagram Tests Project">
+ <builder
+ id="org.eclipse.papyrus.dev.tests.framework.builder">
+ </builder>
+ <requires-nature
+ id="org.eclipse.jdt.core.javanature">
+ </requires-nature>
+ <requires-nature
+ id="org.eclipse.xtext.ui.shared.xtextNature">
+ </requires-nature>
+ <runtime>
+ <run
+ class="org.eclipse.papyrus.dev.tests.framework.internal.PapyrusDiagramTestProjectNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ id="org.eclipse.papyrus.dev.tests.framework.builder"
+ point="org.eclipse.core.resources.builders"
+ name="Papyrus Diagram Tests Generator">
+ <builder
+ callOnEmptyDelta="false"
+ hasNature="true"
+ isConfigurable="false"
+ supportsConfigurations="false">
+ <run
+ class="org.eclipse.papyrus.dev.tests.framework.internal.PapyrusDiagramTestsGenerationBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.eclipse.papyrus.dev.tests.framework.hasNature">
+ <and>
+ <count
+ value="+">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.papyrus.dev.tests.framework.nature">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </definition>
+ </extension>
+</plugin>
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml
new file mode 100644
index 00000000000..21aaa861c8f
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.dev.releng</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../releng/dev</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.dev.tests.framework</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java
new file mode 100644
index 00000000000..8238c6b5c2d
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/Activator.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.dev.tests.framework.internal;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.dev.tests.framework"; //$NON-NLS-1$
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java
new file mode 100644
index 00000000000..8da320c5f7d
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestProjectNature.java
@@ -0,0 +1,135 @@
+/*****************************************************************************
+ * 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.dev.tests.framework.internal;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+/**
+ * The Papyrus diagram tests project nature.
+ */
+public class PapyrusDiagramTestProjectNature implements IProjectNature {
+ public static final String NATURE_ID = Activator.PLUGIN_ID + ".nature"; //$NON-NLS-1$
+
+ private IProject project;
+
+ public PapyrusDiagramTestProjectNature() {
+ super();
+ }
+
+ public PapyrusDiagramTestProjectNature(IProject project) {
+ super();
+
+ this.project = project;
+ }
+
+ @Override
+ public final IProject getProject() {
+ return project;
+ }
+
+ @Override
+ public final void setProject(IProject project) {
+ this.project = project;
+ }
+
+ public boolean hasNature() {
+ try {
+ IProjectDescription desc = getProject().getDescription();
+ return Arrays.asList(desc.getNatureIds()).contains(NATURE_ID);
+ } catch (CoreException e) {
+ // Well, obviously it doesn't have the nature, then
+ return false;
+ }
+ }
+
+ @Override
+ public void configure() throws CoreException {
+ IProjectDescription desc = getProject().getDescription();
+ List<String> natures = Lists.newArrayList(desc.getNatureIds());
+
+ boolean changed = false;
+
+ if (!natures.contains(NATURE_ID)) {
+ natures.add(NATURE_ID);
+ desc.setNatureIds(Iterables.toArray(natures, String.class));
+ changed = true;
+ }
+
+ boolean foundBuilder = false;
+ List<ICommand> builders = Lists.newArrayList(desc.getBuildSpec());
+ for (ICommand next : builders) {
+ if (PapyrusDiagramTestsGenerationBuilder.BUILDER_ID.equals(next.getBuilderName())) {
+ foundBuilder = true;
+ }
+ }
+ if (!foundBuilder) {
+ ICommand builder = desc.newCommand();
+ builder.setBuilderName(PapyrusDiagramTestsGenerationBuilder.BUILDER_ID);
+ builder.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
+ builder.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
+ builders.add(builder); // Needs to be after Java builder to compile the generator workflow!
+ desc.setBuildSpec(Iterables.toArray(builders, ICommand.class));
+ changed = true;
+ }
+
+ if (changed) {
+ project.setDescription(desc, null);
+ }
+ }
+
+ @Override
+ public void deconfigure() throws CoreException {
+ IProjectDescription desc = getProject().getDescription();
+ List<String> natures = Lists.newArrayList(desc.getNatureIds());
+
+ boolean changed = false;
+
+ if (natures.remove(NATURE_ID)) {
+ desc.setNatureIds(Iterables.toArray(natures, String.class));
+ project.setDescription(desc, null);
+ changed = true;
+ }
+
+ boolean foundBuilder = false;
+ List<ICommand> builders = Lists.newArrayList(desc.getBuildSpec());
+ for (Iterator<ICommand> iter = builders.iterator(); iter.hasNext();) {
+ ICommand next = iter.next();
+ if (PapyrusDiagramTestsGenerationBuilder.BUILDER_ID.equals(next.getBuilderName())) {
+ iter.remove();
+ foundBuilder = true;
+ }
+ }
+ if (foundBuilder) {
+ desc.setBuildSpec(Iterables.toArray(builders, ICommand.class));
+ changed = true;
+ }
+
+ if (changed) {
+ project.setDescription(desc, null);
+ }
+ }
+
+}
diff --git a/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java
new file mode 100644
index 00000000000..4aee43e22e0
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.dev.tests.framework/src/org/eclipse/papyrus/dev/tests/framework/internal/PapyrusDiagramTestsGenerationBuilder.java
@@ -0,0 +1,251 @@
+/*****************************************************************************
+ * 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.dev.tests.framework.internal;
+
+import java.util.Map;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.Launch;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+
+import com.google.common.base.Strings;
+
+/**
+ * A project builder that generates the diagram tests, if and only if the tests framework
+ * project is currently open.
+ */
+public class PapyrusDiagramTestsGenerationBuilder extends IncrementalProjectBuilder {
+ public static final String BUILDER_ID = "org.eclipse.papyrus.dev.tests.framework.builder"; //$NON-NLS-1$
+
+ private static final String FRAMEWORK_PROJECT = "org.eclipse.papyrus.tests.framework"; //$NON-NLS-1$
+
+ public PapyrusDiagramTestsGenerationBuilder() {
+ super();
+ }
+
+ @Override
+ protected void clean(IProgressMonitor monitor) throws CoreException {
+ IJavaProject javaProject = JavaCore.create(getProject());
+
+ if (javaProject != null) {
+ IFolder testGen = findTestGen(javaProject);
+ SubMonitor subMonitor = SubMonitor.convert(monitor, "Deleting generated tests", 51);
+ deleteSources(testGen, subMonitor.newChild(50));
+ testGen.refreshLocal(IResource.DEPTH_INFINITE, subMonitor.newChild(1));
+ }
+ }
+
+ @Override
+ protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
+ IJavaProject javaProject = JavaCore.create(getProject());
+
+ if (javaProject != null) {
+ IVMInstall vm = JavaRuntime.getVMInstall(javaProject);
+ if (vm == null) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "No JVM configured for project " + getProject().getName()));
+ }
+ IVMRunner runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
+ if (runner == null) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot get JVM runner for project " + getProject().getName()));
+ }
+ String[] classpath = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);
+ if (classpath == null) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot determine classpath for project " + getProject().getName()));
+ }
+
+ SubMonitor subMonitor;
+ IFolder testGen = findTestGen(javaProject);
+ switch (kind) {
+ case FULL_BUILD:
+ // This build requires the tests framework project
+ IProject framework = getProject().getWorkspace().getRoot().getProject(FRAMEWORK_PROJECT);
+ if ((framework == null) || !framework.isAccessible()) {
+ break;
+ }
+
+ subMonitor = SubMonitor.convert(monitor, "Generating tests", IProgressMonitor.UNKNOWN);
+ VMRunnerConfiguration config = new VMRunnerConfiguration(getWorkflowClassName(javaProject), classpath);
+ config.setWorkingDirectory(getProject().getLocation().toOSString());
+ ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
+ runner.run(config, launch, null);
+ IProcess[] processes = launch.getProcesses();
+ if (processes.length > 0) {
+ final Semaphore termination = new Semaphore(0);
+ final IProcess generator = processes[0];
+
+ IDebugEventSetListener debugListener = new IDebugEventSetListener() {
+
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (DebugEvent next : events) {
+ if (next.getSource() == generator) {
+ if (next.getKind() == DebugEvent.TERMINATE) {
+ // Done
+ termination.release();
+ }
+ }
+ }
+
+ }
+ };
+
+ DebugPlugin.getDefault().addDebugEventListener(debugListener);
+ if (generator.isTerminated()) {
+ termination.release(); // In case we missed the event
+ }
+
+ try {
+ termination.tryAcquire(5L, TimeUnit.MINUTES);
+
+ // Kick an incremental build to compile the new sources
+ new Job("Build generated sources in project " + getProject().getName()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus result = Status.OK_STATUS;
+
+ try {
+ getProject().build(AUTO_BUILD, monitor);
+ } catch (CoreException e) {
+ result = e.getStatus();
+ }
+
+ return result;
+ }
+ }.schedule();
+ } catch (Exception e) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Test code generation timed out in project " + getProject().getName()));
+ } finally {
+ DebugPlugin.getDefault().removeDebugEventListener(debugListener);
+ testGen.refreshLocal(IResource.DEPTH_INFINITE, subMonitor);
+ }
+ }
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ protected String getWorkflowClassName(IJavaProject javaProject) throws CoreException {
+ String result = null;
+
+ out: for (IPackageFragment packageFragment : javaProject.getPackageFragments()) {
+ for (ICompilationUnit cu : packageFragment.getCompilationUnits()) {
+ if (Strings.nullToEmpty(cu.getElementName()).endsWith("Workflow.java")) {
+ IType type = cu.findPrimaryType();
+ if (type != null) {
+ for (IMethod method : type.getMethods()) {
+ if (Flags.isStatic(method.getFlags())) {
+ for (ILocalVariable param : method.getParameters()) {
+ if ("GenerateTestsWorkflow".equals(Signature.getSignatureSimpleName(param.getTypeSignature()))) {
+ result = type.getFullyQualifiedName();
+ break out;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (result == null) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Unable to determine codegen workflow for project " + getProject().getName()));
+ }
+
+ return result;
+ }
+
+ protected IFolder findTestGen(IJavaProject javaProject) throws CoreException {
+ IFolder result = null;
+
+ for (IPackageFragmentRoot next : javaProject.getPackageFragmentRoots()) {
+ if (!next.isReadOnly() && !next.isExternal() && !next.isArchive()) {
+ IResource resource = next.getCorrespondingResource();
+ if ((resource != null) && (resource.getType() == IResource.FOLDER)
+ && ("test-gen".equals(resource.getName()))) {
+
+ result = (IFolder) resource;
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ protected void deleteSources(IFolder srcFolder, IProgressMonitor monitor) throws CoreException {
+ IResource[] members = srcFolder.members();
+ SubMonitor sub = SubMonitor.convert(monitor, members.length);
+
+ for (IResource next : members) {
+ switch (next.getType()) {
+ case IResource.FILE:
+ if (isJavaFile(next)) {
+ next.delete(true, sub.newChild(1));
+ } else {
+ sub.worked(1);
+ }
+ break;
+ case IResource.FOLDER:
+ SubMonitor nested = sub.newChild(51);
+ IFolder folder = (IFolder) next;
+ deleteSources(folder, nested.newChild(50));
+ if (folder.members().length == 0) {
+ folder.delete(true, nested.newChild(1));
+ }
+
+ nested.done();
+ break;
+ }
+ }
+
+ sub.done();
+ }
+
+ protected boolean isJavaFile(IResource file) {
+ return "java".equals(file.getProjectRelativePath().getFileExtension());
+ }
+}

Back to the top