diff options
author | Christian W. Damus | 2020-12-15 14:49:50 +0000 |
---|---|---|
committer | Christian W. Damus | 2020-12-15 15:51:33 +0000 |
commit | 05cd33fc7684849d41f558752045dabf562b5019 (patch) | |
tree | 4a3b8252057d023a3746aaafb7dee56e421d5eca | |
parent | a26abcf1504116a3d770dddf1a53e40fa402e0c2 (diff) | |
download | org.eclipse.papyrus-05cd33fc7684849d41f558752045dabf562b5019.tar.gz org.eclipse.papyrus-05cd33fc7684849d41f558752045dabf562b5019.tar.xz org.eclipse.papyrus-05cd33fc7684849d41f558752045dabf562b5019.zip |
Bug 569357: [Toolsmiths] ElementTypes: Model and Plug-in Validation
Further updates from code review:
- don't report dangling objects as cross-document references
- handle references to registered packages by namespace URI
Change-Id: Ie4777bcb5baca4d7d72c7eb581a01243a1bde57b
Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
18 files changed, 857 insertions, 14 deletions
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/checkers/ModelDependenciesChecker.java b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/checkers/ModelDependenciesChecker.java index 7a3b4ac45e4..dc5e20fb888 100644 --- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/checkers/ModelDependenciesChecker.java +++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/checkers/ModelDependenciesChecker.java @@ -45,6 +45,7 @@ import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; @@ -59,6 +60,7 @@ import org.eclipse.pde.internal.core.text.bundle.BundleModel; import org.eclipse.pde.internal.core.text.bundle.ManifestHeader; import org.osgi.framework.Bundle; import org.osgi.framework.Constants; +import org.osgi.framework.FrameworkUtil; /** * A checker that verifies specification of the dependencies for bundles that provide the resources @@ -357,7 +359,7 @@ public class ModelDependenciesChecker extends AbstractPluginChecker { } else if (!resourceURI.isPlatform()) { // Try to resolve the pathmap final URI correspondingURI = resource.getResourceSet().getURIConverter().normalize(resourceURI); - if (resourceURI.equals(correspondingURI)) { + if (resourceURI.equals(correspondingURI) && !isResolved(resourceURI, resource)) { // If this case, the pathmap cannot be resolved, so create a marker diagnostics.add(createDiagnostic(project, modelFile, Diagnostic.ERROR, 1, "The URI '" + resourceURI.toString() + "' cannot be resolved.")); //$NON-NLS-1$ //$NON-NLS-2$ @@ -375,6 +377,21 @@ public class ModelDependenciesChecker extends AbstractPluginChecker { } /** + * Is a cross-document reference resolved in the {@code context} of the resource being validated? + * + * @param href + * a cross-document reference + * @param context + * the resource from which it was reached + * @return whether it is resolved in the {@code context} resource set + */ + private boolean isResolved(URI href, Resource context) { + // We already tried to load it in scanning the cross-reference graph + Resource resolved = context.getResourceSet().getResource(href, false); + return resolved != null && resolved.isLoaded(); + } + + /** * Compute the closure of external resource URIs referenced and reachable from a {@code resource}. * * @param resource @@ -404,7 +421,9 @@ public class ModelDependenciesChecker extends AbstractPluginChecker { } for (URI uri : nextToScan) { - if (result.add(uri)) { + // The URI can be empty for dangling objects, such as the eFactoryInstance of a dynamic + // EPackage that is the definition of a dynamic profile + if (!uri.isEmpty() && result.add(uri)) { try { work.offer(resource.getResourceSet().getResource(uri, true)); } catch (Exception e) { @@ -463,10 +482,19 @@ public class ModelDependenciesChecker extends AbstractPluginChecker { pluginName = bundle.getSymbolicName(); } } else { - // Best guess. Take the correct segment (without authority) - final int takenSegment = uri.hasAuthority() ? 0 : 1; - if (uri.segmentCount() > takenSegment) { - pluginName = uri.segment(takenSegment); + // Is it a registered package? + EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(uri.toString()); + if (ePackage != null) { + Bundle bundle = FrameworkUtil.getBundle(ePackage.getClass()); + if (bundle != null) { + pluginName = bundle.getSymbolicName(); + } + } else { + // Best guess. Take the correct segment (without authority) + final int takenSegment = uri.hasAuthority() ? 0 : 1; + if (uri.segmentCount() > takenSegment) { + pluginName = uri.segment(takenSegment); + } } } diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java index 439b8af74b4..d8a113e2ca7 100644 --- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java @@ -18,8 +18,10 @@ package org.eclipse.papyrus.junit.matchers; import java.util.regex.Pattern; import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.Diagnostic; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; +import org.hamcrest.FeatureMatcher; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeDiagnosingMatcher; import org.hamcrest.TypeSafeMatcher; @@ -244,6 +246,15 @@ public class MoreMatchers { }; } + public static Matcher<Diagnostic> diagnosticWithMessage(final Matcher<? super String> matcher) { + return new FeatureMatcher<Diagnostic, String>(matcher, "diagnostic message", "message") { + @Override + protected String featureValueOf(Diagnostic actual) { + return actual.getMessage(); + } + }; + } + /** * Create a matcher for iterables to verify that some number of items match some criterion. * @@ -256,7 +267,7 @@ public class MoreMatchers { * @param elementMatcher * the matcher for elements * @return a matcher for iterables that verifies a number of element matches - * + * * @since 3.0 */ public static <T, N extends Number> Matcher<Iterable<T>> hasCount(Matcher<N> countMatcher, Matcher<? super T> elementMatcher) { @@ -299,7 +310,7 @@ public class MoreMatchers { * @param elementMatcher * the matcher for elements * @return a matcher for iterables that verifies a maximum number of element matches - * + * * @since 3.0 */ public static <T> Matcher<Iterable<T>> hasAtMost(int max, Matcher<? super T> elementMatcher) { @@ -316,7 +327,7 @@ public class MoreMatchers { * @param elementMatcher * the matcher for elements * @return a matcher for iterables that verifies a minimum number of element matches - * + * * @since 3.0 */ public static <T> Matcher<Iterable<T>> hasAtLeast(int min, Matcher<? super T> elementMatcher) { diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java index f7ca10b0b71..bb0e938155e 100644 --- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others. + * Copyright (c) 2014, 2020 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 2.0 @@ -10,12 +10,13 @@ * * Contributors: * Christian W. Damus (CEA) - Initial API and implementation - * Christian W. Damus - bug 451230 - * Christian W. Damus - bug 468030 + * Christian W. Damus - bugs 451230, 468030, 569357 * */ package org.eclipse.papyrus.junit.utils.rules; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; @@ -78,6 +79,20 @@ public class ProjectFixture implements TestRule { } /** + * Get the file in the test project at the given project-relative {@code path}. + * + * @param path + * a project-relative path + * @return the file, if it exists (else fail the test) + */ + public IFile getFile(String path) { + IResource resource = getProject().findMember(path); + assertThat("No such file in project: " + path, resource, instanceOf(IFile.class)); //$NON-NLS-1$ + assertThat("File not accessible: " + path, resource.isAccessible(), is(true)); //$NON-NLS-1$ + return (IFile) resource; + } + + /** * Creates a new file at the specified project-relative path with the contents of a bundle resource. * * @param relativeFilePath diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF index 82e94f4f5ff..2a7ef7bcfce 100644 --- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF @@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.gmf.runtime.emf.type.core;bundle-version="[1.9.0,2.0 org.eclipse.papyrus.toolsmiths.plugin.builder;bundle-version="[1.0.0,2.0.0)", org.eclipse.papyrus.toolsmiths.validation.common;bundle-version="[2.0.0,3.0.0)", org.eclipse.jface;bundle-version="[3.22.0,4.0.0)", - org.eclipse.ui;bundle-version="[3.118.100,4.0.0)" + org.eclipse.ui;bundle-version="[3.118.100,4.0.0)", + org.eclipse.papyrus.infra.core;bundle-version="[4.0.0,5.0.0)" Export-Package: org.eclipse.papyrus.toolsmiths.validation.common.tests.rules Automatic-Module-Name: org.eclipse.papyrus.toolsmiths.validation.common.tests Bundle-Vendor: %providerName diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties index cdd2db7f1f5..4cb3ab7b83e 100644 --- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties @@ -3,5 +3,6 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ about.html,\ - plugin.properties + plugin.properties,\ + resources/ src.includes = about.html diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.classpath b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.classpath new file mode 100644 index 00000000000..e801ebfb468 --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.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-11"/> + <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/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.project b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.project new file mode 100644 index 00000000000..be669a4f053 --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.toolsmiths.validation.common.example</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.papyrus.plugin.builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.papyrus.plugin.nature</nature> + </natures> +</projectDescription> diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..037f04a07c2 --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,319 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +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_bitwise_operator=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_logical_operator=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_multiplicative_operator=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_string_concatenation=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_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=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_relational_operator=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_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=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_bitwise_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_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=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_relational_operator=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_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=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_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/META-INF/MANIFEST.MF b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..3bf14ab78ab --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.validation.common.example;singleton:=true +Bundle-Version: 2.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)", + org.eclipse.emf.ecore;bundle-version="[2.23.0,3.0.0)", + org.eclipse.uml2.uml;bundle-version="[5.5.0,6.0.0)", + org.eclipse.uml2.uml.resources;bundle-version="[5.5.0,6.0.0)", + org.eclipse.uml2.types;bundle-version="[2.5.0,3.0.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Automatic-Module-Name: org.eclipse.papyrus.toolsmiths.validation.common.example +Bundle-ActivationPolicy: lazy diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/build.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/build.properties new file mode 100644 index 00000000000..c6a3d75ed7f --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/build.properties @@ -0,0 +1,19 @@ +# Copyright (c) 2020 Christian W. Damus, CEA LIST, and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Christian W. Damus - Initial API and implementation + +bin.includes = .,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src +output.. = bin/ diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.properties new file mode 100644 index 00000000000..6af4fee93fa --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.properties @@ -0,0 +1,14 @@ +# Copyright (c) 2020 Christian W. Damus, CEA LIST, and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Christian W. Damus - Initial API and implementation + +pluginName = Common Plug-in Validation Example Bundle for Tests +providerName = Eclipse Modeling Project diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.xml new file mode 100644 index 00000000000..fcd68ce753a --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- + Copyright (c) 2019 CEA LIST. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License 2.0 + which accompanies this distribution, and is available at + https://www.eclipse.org/legal/epl-2.0/ + + SPDX-License-Identifier: EPL-2.0 + + Contributors: + Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation +--> + +<plugin> + <extension + point="org.eclipse.emf.ecore.dynamic_package"> + <resource + location="pathmap://TOOLSMITHS_VALIDATION_COMMON_TEST/BookStore.profile.uml/#_oI_JMD7mEeuL4ce7dqV7ZQ" + uri="http://www.eclipse.org/Papyrus/2020/test/toolsmiths/validation/common/BookStore"> + </resource> + </extension> + <extension + point="org.eclipse.uml2.uml.dynamic_package"> + <profile + location="pathmap://TOOLSMITHS_VALIDATION_COMMON_TEST/BookStore.profile.uml/#_Km1S4D7mEeuL4ce7dqV7ZQ" + uri="http://www.eclipse.org/Papyrus/2020/test/toolsmiths/validation/common/BookStore"> + </profile> + </extension> + <extension + point="org.eclipse.emf.ecore.uri_mapping"> + <mapping + source="pathmap://TOOLSMITHS_VALIDATION_COMMON_TEST/" + target="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/"> + </mapping> + </extension> + +</plugin> diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.di b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.di new file mode 100644 index 00000000000..247ed5e3570 --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.di @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<architecture:ArchitectureDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" contextId="org.eclipse.papyrus.uml.architecture.Profile"/> diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.notation b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.notation new file mode 100644 index 00000000000..db36a1fb242 --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.notation @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.3/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_Ko-n8D7mEeuL4ce7dqV7ZQ" type="PapyrusUMLProfileDiagram" name="Stereotypes" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_O6T6QD7mEeuL4ce7dqV7ZQ" type="Class_MetaclassShape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_O6lnED7mEeuL4ce7dqV7ZQ" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6lnET7mEeuL4ce7dqV7ZQ" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6lnEj7mEeuL4ce7dqV7ZQ" key="StereotypeList" value="StandardProfile::Metaclass"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6lnEz7mEeuL4ce7dqV7ZQ" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6lnFD7mEeuL4ce7dqV7ZQ" key="PropStereoDisplay" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6lnFT7mEeuL4ce7dqV7ZQ" key="StereotypePropertyLocation" value="Compartment"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_O6jx4D7mEeuL4ce7dqV7ZQ" type="Class_MetaclassNameLabel"/> + <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O6jx4T7mEeuL4ce7dqV7ZQ" x="460" y="100"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_O6mOID7mEeuL4ce7dqV7ZQ" type="Class_MetaclassShape"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_O6mOJD7mEeuL4ce7dqV7ZQ" source="Stereotype_Annotation"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6mOJT7mEeuL4ce7dqV7ZQ" key="StereotypeWithQualifiedNameList" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6mOJj7mEeuL4ce7dqV7ZQ" key="StereotypeList" value="StandardProfile::Metaclass"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6mOJz7mEeuL4ce7dqV7ZQ" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6mOKD7mEeuL4ce7dqV7ZQ" key="PropStereoDisplay" value=""/> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O6mOKT7mEeuL4ce7dqV7ZQ" key="StereotypePropertyLocation" value="Compartment"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_O6mOIj7mEeuL4ce7dqV7ZQ" type="Class_MetaclassNameLabel"/> + <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O6mOIz7mEeuL4ce7dqV7ZQ" x="460" y="220"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_O8z0oD7mEeuL4ce7dqV7ZQ" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_O8z0oT7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_O80bsD7mEeuL4ce7dqV7ZQ" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O8z0oj7mEeuL4ce7dqV7ZQ" x="480" y="100"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_O9Jy4z7mEeuL4ce7dqV7ZQ" type="StereotypeComment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_O9Jy5D7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_O9KZ8D7mEeuL4ce7dqV7ZQ" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </styles> + <element xsi:nil="true"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_O9Jy5T7mEeuL4ce7dqV7ZQ" x="480" y="180"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_Qt9CID7mEeuL4ce7dqV7ZQ" type="Stereotype_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_Qt9pMD7mEeuL4ce7dqV7ZQ" type="Stereotype_NameLabel"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_Qt_eYD7mEeuL4ce7dqV7ZQ" type="Stereotype_AttributeCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_Qt_eYT7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_Qt_eYj7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_QuAFcD7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_QuAFcT7mEeuL4ce7dqV7ZQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_QuAFcj7mEeuL4ce7dqV7ZQ" type="Stereotype_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_QuAFcz7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_QuAFdD7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_QuAFdT7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_QuAFdj7mEeuL4ce7dqV7ZQ"/> + </children> + <element xmi:type="uml:Stereotype" href="BookStore.profile.uml#_Qt27gD7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Qt9CIT7mEeuL4ce7dqV7ZQ" x="120" y="80"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_ShOWkD7mEeuL4ce7dqV7ZQ" type="Stereotype_Shape"> + <children xmi:type="notation:DecorationNode" xmi:id="_ShOWkj7mEeuL4ce7dqV7ZQ" type="Stereotype_NameLabel"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_ShOWkz7mEeuL4ce7dqV7ZQ" type="Stereotype_AttributeCompartment"> + <children xmi:type="notation:Shape" xmi:id="_X2pjID7mEeuL4ce7dqV7ZQ" type="Property_ClassAttributeLabel"> + <element xmi:type="uml:Property" href="BookStore.profile.uml#_X2i1cD7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Location" xmi:id="_X2pjIT7mEeuL4ce7dqV7ZQ"/> + </children> + <styles xmi:type="notation:TitleStyle" xmi:id="_ShOWlD7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_ShOWlT7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_ShOWlj7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ShOWlz7mEeuL4ce7dqV7ZQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_ShOWmD7mEeuL4ce7dqV7ZQ" type="Stereotype_OperationCompartment"> + <styles xmi:type="notation:TitleStyle" xmi:id="_ShOWmT7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:SortingStyle" xmi:id="_ShOWmj7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_ShOWmz7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ShOWnD7mEeuL4ce7dqV7ZQ"/> + </children> + <element xmi:type="uml:Stereotype" href="BookStore.profile.uml#_ShKsMD7mEeuL4ce7dqV7ZQ"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ShOWkT7mEeuL4ce7dqV7ZQ" x="120" y="220"/> + </children> + <styles xmi:type="notation:StringValueStyle" xmi:id="_Ko-n8T7mEeuL4ce7dqV7ZQ" name="diagram_compatibility_version" stringValue="1.4.0"/> + <styles xmi:type="notation:DiagramStyle" xmi:id="_Ko-n8j7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_Ko-n8z7mEeuL4ce7dqV7ZQ" diagramKindId="org.eclipse.papyrus.uml.diagram.profile"> + <owner xmi:type="uml:Profile" href="BookStore.profile.uml#_Km1S4D7mEeuL4ce7dqV7ZQ"/> + </styles> + <element xmi:type="uml:Profile" href="BookStore.profile.uml#_Km1S4D7mEeuL4ce7dqV7ZQ"/> + <edges xmi:type="notation:Connector" xmi:id="_O8238D7mEeuL4ce7dqV7ZQ" type="StereotypeCommentLink" source="_O6T6QD7mEeuL4ce7dqV7ZQ" target="_O8z0oD7mEeuL4ce7dqV7ZQ"> + <styles xmi:type="notation:FontStyle" xmi:id="_O83fAD7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_O83fBD7mEeuL4ce7dqV7ZQ" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_O83fAT7mEeuL4ce7dqV7ZQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O83fAj7mEeuL4ce7dqV7ZQ"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O83fAz7mEeuL4ce7dqV7ZQ"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_O9KZ8T7mEeuL4ce7dqV7ZQ" type="StereotypeCommentLink" source="_O6mOID7mEeuL4ce7dqV7ZQ" target="_O9Jy4z7mEeuL4ce7dqV7ZQ"> + <styles xmi:type="notation:FontStyle" xmi:id="_O9KZ8j7mEeuL4ce7dqV7ZQ"/> + <styles xmi:type="notation:EObjectValueStyle" xmi:id="_O9KZ9j7mEeuL4ce7dqV7ZQ" name="BASE_ELEMENT"> + <eObjectValue xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </styles> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_O9KZ8z7mEeuL4ce7dqV7ZQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O9KZ9D7mEeuL4ce7dqV7ZQ"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_O9KZ9T7mEeuL4ce7dqV7ZQ"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_TewV0D7mEeuL4ce7dqV7ZQ" type="Extension_Edge" source="_Qt9CID7mEeuL4ce7dqV7ZQ" target="_O6T6QD7mEeuL4ce7dqV7ZQ"> + <styles xmi:type="notation:FontStyle" xmi:id="_TewV0T7mEeuL4ce7dqV7ZQ"/> + <element xmi:type="uml:Extension" href="BookStore.profile.uml#_TejhgD7mEeuL4ce7dqV7ZQ"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_TewV0j7mEeuL4ce7dqV7ZQ" points="[220, 140, -643984, -643984]$[480, 150, -643984, -643984]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TfR6QD7mEeuL4ce7dqV7ZQ" id="(1.0,0.4)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TfR6QT7mEeuL4ce7dqV7ZQ" id="(0.0,0.4)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_VDv9sD7mEeuL4ce7dqV7ZQ" type="Extension_Edge" source="_ShOWkD7mEeuL4ce7dqV7ZQ" target="_O6mOID7mEeuL4ce7dqV7ZQ"> + <styles xmi:type="notation:FontStyle" xmi:id="_VDv9sT7mEeuL4ce7dqV7ZQ"/> + <element xmi:type="uml:Extension" href="BookStore.profile.uml#_VDna0D7mEeuL4ce7dqV7ZQ"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_VDv9sj7mEeuL4ce7dqV7ZQ" points="[200, 260, -643984, -643984]$[480, 180, -643984, -643984]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VD8K8D7mEeuL4ce7dqV7ZQ" id="(1.0,0.2)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_VD8K8T7mEeuL4ce7dqV7ZQ" id="(0.0,0.4)"/> + </edges> +</notation:Diagram> diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.uml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.uml new file mode 100644 index 00000000000..c523554689d --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.uml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_Km1S4D7mEeuL4ce7dqV7ZQ" name="BookStore" URI="http://www.eclipse.org/Papyrus/2020/test/toolsmiths/validation/common/BookStore" metaclassReference="_O6NMkD7mEeuL4ce7dqV7ZQ _O6NzoD7mEeuL4ce7dqV7ZQ"> + <eAnnotations xmi:id="_oI-iID7mEeuL4ce7dqV7ZQ" source="http://www.eclipse.org/uml2/2.0.0/UML"> + <eAnnotations xmi:id="_wHX8ED7mEeuL4ce7dqV7ZQ" source="PapyrusVersion"> + <details xmi:id="_wHX8ET7mEeuL4ce7dqV7ZQ" key="Version" value="0.0.0"/> + <details xmi:id="_wHX8Ej7mEeuL4ce7dqV7ZQ" key="Comment" value="<undefined>"/> + <details xmi:id="_wHX8Ez7mEeuL4ce7dqV7ZQ" key="Copyright" value=""/> + <details xmi:id="_wHX8FD7mEeuL4ce7dqV7ZQ" key="Date" value=""/> + <details xmi:id="_wHX8FT7mEeuL4ce7dqV7ZQ" key="Author" value="<undefined>"/> + </eAnnotations> + <contents xmi:type="ecore:EPackage" xmi:id="_oI_JMD7mEeuL4ce7dqV7ZQ" name="BookStore" nsURI="http://www.eclipse.org/Papyrus/2020/test/toolsmiths/validation/common/BookStore" nsPrefix="BookStore"> + <eAnnotations xmi:id="_oJAXUD7mEeuL4ce7dqV7ZQ" source="PapyrusVersion"> + <details xmi:id="_oJAXUT7mEeuL4ce7dqV7ZQ" key="Version" value="0.0.1"/> + <details xmi:id="_oJAXUj7mEeuL4ce7dqV7ZQ" key="Comment" value=""/> + <details xmi:id="_oJAXUz7mEeuL4ce7dqV7ZQ" key="Copyright" value="Copyright (c) 202 Christian W. Damus, CEA LIST, and others.

All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
 Christian W. Damus - Initial API and implementation
"/> + <details xmi:id="_oJAXVD7mEeuL4ce7dqV7ZQ" key="Date" value="2020-12-15"/> + <details xmi:id="_oJAXVT7mEeuL4ce7dqV7ZQ" key="Author" value="Christian W. Damus"/> + </eAnnotations> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_oI_JMT7mEeuL4ce7dqV7ZQ" name="BookStore"> + <eAnnotations xmi:id="_oI_JMj7mEeuL4ce7dqV7ZQ" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_Qt27gD7mEeuL4ce7dqV7ZQ"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_oI_JMz7mEeuL4ce7dqV7ZQ" name="base_Package" ordered="false"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xmi:type="ecore:EClass" xmi:id="_oI_JNT7mEeuL4ce7dqV7ZQ" name="Book"> + <eAnnotations xmi:id="_oI_JNj7mEeuL4ce7dqV7ZQ" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_ShKsMD7mEeuL4ce7dqV7ZQ"/> + <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_oI_JNz7mEeuL4ce7dqV7ZQ" name="base_Class" ordered="false"> + <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/> + </eStructuralFeatures> + <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_oI_JOT7mEeuL4ce7dqV7ZQ" name="isbn" ordered="false" lowerBound="1"> + <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/> + </eStructuralFeatures> + </eClassifiers> + </contents> + </eAnnotations> + <elementImport xmi:id="_O6NMkD7mEeuL4ce7dqV7ZQ" alias="Package"> + <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/> + </elementImport> + <elementImport xmi:id="_O6NzoD7mEeuL4ce7dqV7ZQ" alias="Class"> + <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + </elementImport> + <packageImport xmi:id="_Kuh2UD7mEeuL4ce7dqV7ZQ"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/> + </packageImport> + <packageImport xmi:id="_KujrgD7mEeuL4ce7dqV7ZQ"> + <importedPackage xmi:type="uml:Model" href="pathmap://UML_METAMODELS/UML.metamodel.uml#_0"/> + </packageImport> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_Qt27gD7mEeuL4ce7dqV7ZQ" name="BookStore"> + <ownedAttribute xmi:id="_Tel9wD7mEeuL4ce7dqV7ZQ" name="base_Package" association="_TejhgD7mEeuL4ce7dqV7ZQ"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Tel9wT7mEeuL4ce7dqV7ZQ"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Stereotype" xmi:id="_ShKsMD7mEeuL4ce7dqV7ZQ" name="Book"> + <ownedAttribute xmi:id="_VDoB4D7mEeuL4ce7dqV7ZQ" name="base_Class" association="_VDna0D7mEeuL4ce7dqV7ZQ"> + <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/> + <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_VDoB4T7mEeuL4ce7dqV7ZQ"/> + </ownedAttribute> + <ownedAttribute xmi:id="_X2i1cD7mEeuL4ce7dqV7ZQ" name="isbn"> + <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/> + </ownedAttribute> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_TejhgD7mEeuL4ce7dqV7ZQ" name="E_BookStore_Package7" memberEnd="_TelWsD7mEeuL4ce7dqV7ZQ _Tel9wD7mEeuL4ce7dqV7ZQ"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_TelWsD7mEeuL4ce7dqV7ZQ" name="extension_BookStore" type="_Qt27gD7mEeuL4ce7dqV7ZQ" aggregation="composite" association="_TejhgD7mEeuL4ce7dqV7ZQ"/> + </packagedElement> + <packagedElement xmi:type="uml:Extension" xmi:id="_VDna0D7mEeuL4ce7dqV7ZQ" name="E_Book_Class8" memberEnd="_VDna0T7mEeuL4ce7dqV7ZQ _VDoB4D7mEeuL4ce7dqV7ZQ"> + <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_VDna0T7mEeuL4ce7dqV7ZQ" name="extension_Book" type="_ShKsMD7mEeuL4ce7dqV7ZQ" aggregation="composite" association="_VDna0D7mEeuL4ce7dqV7ZQ"/> + </packagedElement> +</uml:Profile> diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/AllTests.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/AllTests.java new file mode 100644 index 00000000000..4b1ddf1dc9b --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/AllTests.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2020 Christian W. Damus, CEA LIST, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.toolsmiths.validation.common.tests; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +/** + * Test suite for all Toolsmiths Common Validation tests. + */ +@RunWith(Suite.class) +@SuiteClasses({ + ModelDependenciesCheckerTest.class, +}) +public class AllTests { + // Suite is specified in annotations +} diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/ModelDependenciesCheckerTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/ModelDependenciesCheckerTest.java new file mode 100644 index 00000000000..4f4283ddacc --- /dev/null +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/ModelDependenciesCheckerTest.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2020 Christian W. Damus, CEA LIST, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Christian W. Damus - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.toolsmiths.validation.common.tests; + +import static org.eclipse.papyrus.junit.matchers.MoreMatchers.regexMatches; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.papyrus.junit.matchers.MoreMatchers; +import org.eclipse.papyrus.toolsmiths.validation.common.checkers.ModelDependenciesChecker; +import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.Build; +import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.TestProject; +import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.TestProjectFixture; +import org.junit.Rule; +import org.junit.Test; + +/** + * Specific test cases for the {@link ModelDependenciesChecker} class. + */ +@TestProject("org.eclipse.papyrus.toolsmiths.validation.common.example") +@Build(false) +public class ModelDependenciesCheckerTest { + + private static final String BOOKSTORE_PROFILE = "resources/BookStore.profile.uml"; //$NON-NLS-1$ + + @Rule + public final TestProjectFixture project = new TestProjectFixture(); + + /** + * Verify that a dynamic profile definition does not induce spurious problem reports + * of the empty URI (from the EPackage::eFactoryInstance reference) and EPackages + * referenced by namespace URI instead of location URI. + */ + @Test + public void noSpuriousDependencyProblemsFromDynamicProfileDefinition() { + Resource profile = project.loadModelResource(BOOKSTORE_PROFILE); + ModelDependenciesChecker checker = new ModelDependenciesChecker(project.getProject(), project.getFile(BOOKSTORE_PROFILE), profile); + + BasicDiagnostic diagnostics = new BasicDiagnostic(); + checker.check(diagnostics, null); + + assertThat(diagnostics.getChildren(), not(hasItem(MoreMatchers.diagnosticWithMessage(containsString("must be declared as required plug-in"))))); //$NON-NLS-1$ + assertThat(diagnostics.getChildren(), not(hasItem(MoreMatchers.diagnosticWithMessage(containsString("Cross-document reference by file URI"))))); //$NON-NLS-1$ + assertThat(diagnostics.getChildren(), not(hasItem(MoreMatchers.diagnosticWithMessage(regexMatches("The URI .* cannot be resolved"))))); //$NON-NLS-1$ + } + +} diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java index 3ed306a49d0..a1a1c72ec2c 100644 --- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java +++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java @@ -44,11 +44,16 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.URIConverter; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.papyrus.junit.utils.JUnitUtils; import org.eclipse.papyrus.junit.utils.rules.ProjectFixture; import org.eclipse.papyrus.toolsmiths.plugin.builder.preferences.PluginBuilderPreferencesConstants; import org.eclipse.papyrus.toolsmiths.validation.common.checkers.IPluginChecker2; +import org.eclipse.papyrus.toolsmiths.validation.common.utils.ModelResourceMapper; import org.junit.runner.Description; import org.junit.runners.model.Statement; @@ -181,6 +186,51 @@ public class TestProjectFixture extends ProjectFixture { } } + /** + * Load a model resource in a suitable resource set. + * + * @param modelFile + * the model file to load + * @return the resource, loaded in a resource set + */ + public Resource loadModelResource(IFile modelFile) { + Resource result; + + URI uri = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + URI rsetURI = uri; + + if ("uml".equals(uri.fileExtension()) || "notation".equals(uri.fileExtension())) { //$NON-NLS-1$//$NON-NLS-2$ + // Look for a DI file to initialize the resource set, instead + URI di = uri.trimFileExtension().appendFileExtension("di"); //$NON-NLS-1$ + if (URIConverter.INSTANCE.exists(di, null)) { + rsetURI = di; + } + } + + ResourceSet rset = ("di".equals(rsetURI.fileExtension())) //$NON-NLS-1$ + ? ModelResourceMapper.modelSets().apply(rsetURI) + : ModelResourceMapper.resourceSets().apply(rsetURI); + + try { + result = rset.getResource(uri, true); + } catch (Exception e) { + throw new AssertionError("Failed to load test model resource: " + modelFile.getFullPath(), e); //$NON-NLS-1$ + } + + return result; + } + + /** + * Load a model resource in a suitable resource set. + * + * @param modelPath + * the project-relative path of the model file to load + * @return the resource, loaded in a resource set + */ + public Resource loadModelResource(String modelPath) { + return loadModelResource(getFile(modelPath)); + } + // // Nested types // |