Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2021-03-17 15:03:58 +0000
committerVincent Lorenzo2021-03-24 14:28:07 +0000
commit38390e7242e3590c13877336a4424827bd7715f5 (patch)
tree5dc4db8f1ebc4ad3b84d1475a0db03f194775020
parentaf89edb868f3681b8ce1c8a989ae18ca8643fc3c (diff)
downloadorg.eclipse.papyrus-38390e7242e3590c13877336a4424827bd7715f5.tar.gz
org.eclipse.papyrus-38390e7242e3590c13877336a4424827bd7715f5.tar.xz
org.eclipse.papyrus-38390e7242e3590c13877336a4424827bd7715f5.zip
Bug 569357: [Toolsmiths] ElementTypes: Model and Plug-in Validation
- initial cases of project builder tests to parallel the validation menu tests - add JUnit test cases for build that should not find problems - JUnit test coverage for model validation - JUnit test coverage for build.properties validation - JUnit test coverage for plugin.xml validation - factor out test project fixture into a new common tests bundle Change-Id: I90f8cfd541cd9fa859aa5361fff015cebae02ec5 Signed-off-by: Christian W. Damus <give.a.damus@gmail.com> Also-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/MoreMatchers.java130
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/WorkspaceMatchers.java70
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java97
-rw-r--r--tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ProjectFixture.java21
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.classpath7
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.project28
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.core.prefs319
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.ui.prefs127
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.pde.api.tools.prefs104
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF20
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/about.html28
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties8
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/plugin.properties19
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/pom.xml15
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/bug569357/BookStore-weirdHREF.profile.uml75
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.classpath7
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.project34
-rwxr-xr-xtests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/.settings/org.eclipse.jdt.core.prefs319
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/META-INF/MANIFEST.MF16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/build.properties20
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.properties14
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/plugin.xml41
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.di2
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.notation121
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/org.eclipse.papyrus.toolsmiths.validation.common.example/resources/BookStore.profile.uml69
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/AllTests.java31
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/ModelDependenciesCheckerTest.java127
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/Build.java35
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/MarkerType.java35
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/OverlayFile.java62
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProject.java33
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java465
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/META-INF/MANIFEST.MF6
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-noProfile.properties21
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-explicit.properties22
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-folder.properties21
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noClientContext.xml24
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noExtension.xml26
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-wrongPath.xml31
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/BookStore-metamodelNSURI.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unqualifiedStereotypeName.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedFeatureName.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedProfileName.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedStereotypeName.elementtypesconfigurations16
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-ok.elementtypesconfigurations9
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedProfileURI.elementtypesconfigurations9
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedStereotypeName.elementtypesconfigurations9
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-ok.elementtypesconfigurations7
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedFeature.elementtypesconfigurations7
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedStereotype.elementtypesconfigurations7
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/META-INF/MANIFEST.MF18
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/build.properties21
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/plugin.xml47
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.elementtypesconfigurations33
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.profile.uml95
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/.project6
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/AllTests.java10
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesBuildPropertiesBuilderTest.java88
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesModelBuilderTest.java233
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginBuilderTest.java137
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginValidationTest.java58
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginXMLBuilderTest.java88
-rwxr-xr-xtests/junit/plugins/toolsmiths/pom.xml1
-rw-r--r--tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/plugin.xml13
67 files changed, 3566 insertions, 80 deletions
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 743b2432f1c..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
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2014, 2018 Christian W. Damus and others.
- *
+ * Copyright (c) 2014, 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
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.junit.matchers;
@@ -18,9 +18,12 @@ 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;
import org.hamcrest.core.CombinableMatcher;
@@ -38,7 +41,7 @@ public class MoreMatchers {
/**
* Obtain a matcher for numbers greater than a {@code minimum}.
- *
+ *
* @param minimum
* the lower bound (exclusive) to match against
* @return the matcher
@@ -49,7 +52,7 @@ public class MoreMatchers {
/**
* Obtain a matcher for numbers less than a {@code maximum}.
- *
+ *
* @param maximum
* the upper bound (exclusive) to match against
* @return the matcher
@@ -60,7 +63,7 @@ public class MoreMatchers {
/**
* Obtain a matcher for numbers greater or equal to a {@code minimum}.
- *
+ *
* @param minimum
* the lower bound (inclusive) to match against
* @return the matcher
@@ -72,7 +75,7 @@ public class MoreMatchers {
/**
* Obtain a matcher for numbers less or equal to a {@code maximum}.
- *
+ *
* @param maximum
* the upper bound (inclusive) to match against
* @return the matcher
@@ -85,7 +88,7 @@ public class MoreMatchers {
/**
* Obtain a matcher for comparables that matches comparisons yielding the given
* {@code sign}.
- *
+ *
* @param compareTo
* the value to compare with
* @param sign
@@ -94,14 +97,14 @@ public class MoreMatchers {
* or zero for equal to {@code compareTo}
* @param orEqual
* in the case of non-zero {@code sign}, whether to match equality also
- *
+ *
* @return the matcher
- *
+ *
* @since 2.2
*/
public static <C extends Comparable<C>> Matcher<C> comparesAs(final C compareTo, final int sign, final boolean orEqual) {
final int normalizedSign = Integer.signum(sign);
- return new TypeSafeMatcher<C>() {
+ return new TypeSafeMatcher<>() {
@Override
public void describeTo(Description description) {
switch (normalizedSign) {
@@ -135,11 +138,11 @@ public class MoreMatchers {
/**
* Match empty iterables of any kind.
- *
+ *
* @see #emptyIterable()
*/
public static Matcher<Iterable<?>> isEmpty() {
- return new BaseMatcher<Iterable<?>>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("is empty");
@@ -156,11 +159,11 @@ public class MoreMatchers {
* The {@link CombinableMatcher}s of Hamcrest require matching generic signatures,
* for which the wildcard of the {@link #isEmpty()} matcher doesn't work very well,
* so this equivalent matcher may be used instead in those cases.
- *
+ *
* @see #isEmpty()
*/
public static <E> Matcher<Iterable<E>> emptyIterable() {
- return new BaseMatcher<Iterable<E>>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("is empty");
@@ -174,7 +177,7 @@ public class MoreMatchers {
}
public static Matcher<String> regexMatches(final String pattern) {
- return new BaseMatcher<String>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("matches /").appendText(pattern).appendText("/");
@@ -191,7 +194,7 @@ public class MoreMatchers {
public static Matcher<String> regexContains(final String pattern) {
final Pattern regex = Pattern.compile(pattern);
- return new BaseMatcher<String>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("contains /").appendText(pattern).appendText("/");
@@ -206,7 +209,7 @@ public class MoreMatchers {
}
public static Matcher<IStatus> statusWithMessage(final Matcher<? super String> matcher) {
- return new BaseMatcher<IStatus>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("status with message ").appendDescriptionOf(matcher);
@@ -225,7 +228,7 @@ public class MoreMatchers {
}
public static Matcher<IStatus> statusWithException(final Matcher<?> matcher) {
- return new BaseMatcher<IStatus>() {
+ return new BaseMatcher<>() {
@Override
public void describeTo(Description description) {
description.appendText("status with exception ").appendDescriptionOf(matcher);
@@ -242,4 +245,93 @@ 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.
+ *
+ * @param <T>
+ * the iterable element type
+ * @param <N>
+ * the type of count of elements
+ * @param countMatcher
+ * the matcher of the number of elements that must match
+ * @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) {
+ return new TypeSafeDiagnosingMatcher<>() {
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("has ").appendDescriptionOf(countMatcher); //$NON-NLS-1$
+ description.appendText(" items that ").appendDescriptionOf(elementMatcher); //$NON-NLS-1$
+ }
+
+ @Override
+ protected boolean matchesSafely(Iterable<T> item, Description mismatchDescription) {
+ int satisfiedCount = 0;
+
+ for (T next : item) {
+ if (elementMatcher.matches(next)) {
+ satisfiedCount = satisfiedCount + 1;
+ }
+ }
+
+ if (!countMatcher.matches(satisfiedCount)) {
+ mismatchDescription.appendText("has "); //$NON-NLS-1$
+ countMatcher.describeMismatch(satisfiedCount, mismatchDescription);
+ mismatchDescription.appendText(" items that "); //$NON-NLS-1$
+ mismatchDescription.appendDescriptionOf(elementMatcher);
+ }
+
+ return countMatcher.matches(satisfiedCount);
+ }
+ };
+ }
+
+ /**
+ * Create a matcher for iterables to verify that some maximum number of items match some criterion.
+ *
+ * @param <T>
+ * the iterable element type
+ * @param max
+ * the maximum number of elements of the iterable to match
+ * @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) {
+ return hasCount(lessThanOrEqual(max), elementMatcher);
+ }
+
+ /**
+ * Create a matcher for iterables to verify that some minimum number of items match some criterion.
+ *
+ * @param <T>
+ * the iterable element type
+ * @param min
+ * the minimum number of elements of the iterable to match
+ * @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) {
+ return hasCount(greaterThanOrEqual(min), elementMatcher);
+ }
+
}
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/WorkspaceMatchers.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/WorkspaceMatchers.java
new file mode 100644
index 00000000000..ff61135bf06
--- /dev/null
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/matchers/WorkspaceMatchers.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * 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.junit.matchers;
+
+import static org.hamcrest.CoreMatchers.is;
+
+import org.eclipse.core.resources.IMarker;
+import org.hamcrest.FeatureMatcher;
+import org.hamcrest.Matcher;
+
+/**
+ * Hamcrest matchers for the <em>Eclipse Workspace</em> API.
+ *
+ * @since 3.0
+ */
+public class WorkspaceMatchers {
+
+ /**
+ * Not instantiable by clients.
+ */
+ private WorkspaceMatchers() {
+ super();
+ }
+
+ /**
+ * Create a matcher for markers by severity.
+ *
+ * @param severity
+ * the marker severity to match
+ * @return the marker matcher
+ */
+ public static Matcher<IMarker> isMarkerSeverity(final int severity) {
+ return new FeatureMatcher<>(is(severity), "marker severity", "severity") { //$NON-NLS-1$//$NON-NLS-2$
+ @Override
+ protected Integer featureValueOf(IMarker actual) {
+ return actual.getAttribute(IMarker.SEVERITY, -1);
+ }
+ };
+ }
+
+ /**
+ * Create a matcher for markers by message.
+ *
+ * @param messageMatcher
+ * a message matcher to match markers
+ * @return the marker matcher
+ */
+ public static Matcher<IMarker> isMarkerMessage(Matcher<? super String> messageMatcher) {
+ return new FeatureMatcher<IMarker, String>(messageMatcher, "marker message", "message") { //$NON-NLS-1$//$NON-NLS-2$
+ @Override
+ protected String featureValueOf(IMarker actual) {
+ return actual.getAttribute(IMarker.MESSAGE, "");
+ }
+ };
+ }
+
+}
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
index a970a91e915..43767f581f2 100644
--- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
+++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2015 Christian W. Damus and others.
- *
+ * Copyright (c) 2015, 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
@@ -10,12 +10,18 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.junit.utils;
import java.lang.annotation.Annotation;
+import java.lang.annotation.Repeatable;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import org.junit.rules.TestRule;
@@ -37,11 +43,11 @@ public class JUnitUtils {
/**
* Obtains the test class implied by a {@code description} that is supplied to a {@link TestRule}.
- *
+ *
* @param description
* a rule's owning description, which generally would be a test method or a test class
* (as these are the contexts in which rules are invoked)
- *
+ *
* @return the test class, or {@code null} in the unlikely event that none can be found
*/
public static Class<?> getTestClass(Description description) {
@@ -63,11 +69,11 @@ public class JUnitUtils {
* Obtains the annotations applied to a {@code description} that is supplied to a {@link TestRule}.
* If the description is for a test method, the annotations of its owning class are included,
* excepting annotations of the same type applied to the method.
- *
+ *
* @param description
* a rule's owning description, which generally would be a test method or a test class
* (as these are the contexts in which rules are invoked)
- *
+ *
* @return all of the annotations applied to the test description
*/
public static Iterable<Annotation> getAnnotations(Description description) {
@@ -92,13 +98,13 @@ public class JUnitUtils {
* Obtains the annotation of the specified {@code type} applicable to a {@code description} that is supplied to a {@link TestRule}.
* If the description is for a test method, then if that method doesn't have the requested annotation, its owning class is searched
* for the annotation.
- *
+ *
* @param description
* a rule's owning description, which generally would be a test method or a test class
* (as these are the contexts in which rules are invoked)
* @param type
* the annotation type to look for
- *
+ *
* @return the requested annotation, or {@code null} if none was found
*/
public static <A extends Annotation> A getAnnotation(Description description, Class<A> type) {
@@ -112,16 +118,83 @@ public class JUnitUtils {
}
/**
+ * Obtains all of the repetitions of an annotation of the specified {@code type} applicable to a {@code description} that is supplied to a {@link TestRule}.
+ * If the description is for a test method, then the annotations on the test class (if any) are added to the method's annotations. This API
+ * may not be used to get the annotations on a test method and its class for non-repeatable annotations: for these, test method annotations
+ * strictly supersede test class annotations.
+ *
+ * @param description
+ * a rule's owning description, which generally would be a test method or a test class
+ * (as these are the contexts in which rules are invoked)
+ * @param type
+ * the annotation type to look for
+ *
+ * @return the requested annotations, or an empty list if none were found
+ *
+ * @throws IllegalArgumentException
+ * if the annotation {@code type} is not {@linkplain Repeatable repeatable}
+ *
+ * @since 3.0
+ *
+ * @see AnnotatedElement#getAnnotationsByType(Class)
+ */
+ public static <A extends Annotation> List<A> getAnnotationsByType(Description description, Class<A> type) {
+ if (!type.isAnnotationPresent(Repeatable.class)) {
+ throw new IllegalArgumentException("not a repeatable annotation: @" + type.getName());
+ }
+
+ List<A> result = new ArrayList<>();
+
+ Class<? extends Annotation> containerType = type.getAnnotation(Repeatable.class).value();
+ Annotation container = description.getAnnotation(containerType);
+ if (container != null) {
+ try {
+ Method method = findAnnotationContainerValue(containerType, type);
+ @SuppressWarnings("unchecked") // We did check in the finder method
+ A[] annotations = (A[]) method.invoke(container);
+ result.addAll(Arrays.asList(annotations));
+ } catch (Exception e) {
+ // OK, so no annotations from this description, then
+ }
+ } else {
+ // Maybe the annotation is present, but only once
+ A annotation = description.getAnnotation(type);
+ if (annotation != null) {
+ result.add(annotation);
+ }
+ }
+
+ if (description.getTestClass() != null) {
+ result.addAll(Arrays.asList(description.getTestClass().getAnnotationsByType(type)));
+ }
+
+ return result;
+ }
+
+ private static Method findAnnotationContainerValue(Class<? extends Annotation> containerType, Class<? extends Annotation> repeatableAnnotationType) {
+ Method result = null;
+
+ for (Method next : containerType.getMethods()) {
+ if (next.getParameterCount() == 0 && next.getReturnType().isArray() && next.getReturnType().getComponentType() == repeatableAnnotationType) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ /**
* Obtains the annotation of any one of the specified {@code types} applicable to a {@code description} that is supplied to a {@link TestRule}.
* If the description is for a test method, then if that method doesn't have any of the requested annotations, its owning class is searched
* for the annotations.
- *
+ *
* @param description
* a rule's owning description, which generally would be a test method or a test class
* (as these are the contexts in which rules are invoked)
* @param types
* the annotation types to look for
- *
+ *
* @return the first available of the requested annotations, or {@code null} if none was found
*/
@SafeVarargs
@@ -152,7 +225,7 @@ public class JUnitUtils {
/**
* Queries whether the current JUnit test execution is running in the automated build environment
* (whether actually on the build server or not; users can run local builds on their development systems, too).
- *
+ *
* @return whether the tests are running in the automated build environment
*/
public static boolean isAutomatedBuildExecution() {
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/.classpath b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.classpath
new file mode 100644
index 00000000000..e801ebfb468
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-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/.project b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.project
new file mode 100644
index 00000000000..c39bc7270a4
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.toolsmiths.validation.common.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.resources.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..896a9a53a53
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8 \ No newline at end of file
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.runtime.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..5a0ad22d2a7
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..037f04a07c2
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.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/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..ba7542ef658
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,127 @@
+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
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+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 2.0\n * which accompanies this distribution, and is available at\n * http\://www.eclipse.org/legal/epl-2.0/\n *\n * SPDX-License-Identifier: EPL-2.0\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>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_modifiers=false
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.pde.api.tools.prefs b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.pde.api.tools.prefs
new file mode 100644
index 00000000000..b2260f87129
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/.settings/org.eclipse.pde.api.tools.prefs
@@ -0,0 +1,104 @@
+ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_FIELD=Warning
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Ignore
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_ANNOTATION=Ignore
+INVALID_JAVADOC_TAG=Ignore
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=Enabled
+changed_execution_env=Warning
+eclipse.preferences.version=1
+incompatible_api_component_version=Warning
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+incompatible_api_component_version_report_major_without_breaking_change=Error
+incompatible_api_component_version_report_minor_without_api_change=Error
+invalid_since_tag_version=Error
+malformed_since_tag=Error
+missing_since_tag=Error
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
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
new file mode 100644
index 00000000000..2a7ef7bcfce
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.validation.common.tests;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-11
+Require-Bundle: org.eclipse.gmf.runtime.emf.type.core;bundle-version="[1.9.0,2.0.0)",
+ org.eclipse.papyrus.infra.core.log;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.framework;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.junit.utils;bundle-version="[3.0.0,4.0.0)",
+ org.junit;bundle-version="[4.13.0,5.0.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.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
+Bundle-Localization: plugin
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/about.html b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/about.html
new file mode 100644
index 00000000000..ef2872f2845
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 30, 2017</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 2.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties
new file mode 100644
index 00000000000..4cb3ab7b83e
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties,\
+ resources/
+src.includes = about.html
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/plugin.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/plugin.properties
new file mode 100644
index 00000000000..d5db154dcef
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/plugin.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
+#
+##################################################################################
+
+pluginName = Toolsmiths Common Validation Tests
+providerName = Eclipse Modeling Project
+pluginDescription=JUnit tests for the Toolsmiths Common Validation APIs and also \
+ common test frameworks for other toolsmiths validation builder plug-ins.
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/pom.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/pom.xml
new file mode 100644
index 00000000000..81f1bdbf825
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.toolsmiths.tests.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.eclipse.papyrus.tests</groupId>
+ <artifactId>org.eclipse.papyrus.toolsmiths.validation.common.tests</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/bug569357/BookStore-weirdHREF.profile.uml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/bug569357/BookStore-weirdHREF.profile.uml
new file mode 100644
index 00000000000..2c116fb7a8e
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/resources/bug569357/BookStore-weirdHREF.profile.uml
@@ -0,0 +1,75 @@
+<?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="&lt;undefined>"/>
+ <details xmi:id="_wHX8Ez7mEeuL4ce7dqV7ZQ" key="Copyright" value=""/>
+ <details xmi:id="_wHX8FD7mEeuL4ce7dqV7ZQ" key="Date" value=""/>
+ <details xmi:id="_wHX8FT7mEeuL4ce7dqV7ZQ" key="Author" value="&lt;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) 2020 Christian W. Damus, CEA LIST, and others.&#xA;&#xA;All rights reserved. This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License 2.0&#xA;which accompanies this distribution, and is available at&#xA;https://www.eclipse.org/legal/epl-2.0/&#xA;&#xA;SPDX-License-Identifier: EPL-2.0&#xA;&#xA;Contributors:&#xA; Christian W. Damus - Initial API and implementation&#xA;"/>
+ <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>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_OMyuID8AEeuYB657Az5Z-A" name="corporationKind" lowerBound="1">
+ <eType xmi:type="ecore:EEnum" href="http://schema.eclipse.org/BookStore#/ecore/CorporationKind"/>
+ </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>
+ <ownedAttribute xmi:id="_gvxWkD7_EeuYB657Az5Z-A" name="corporationKind">
+ <type xmi:type="uml:Enumeration" href="http://schema.eclipse.org/BookStore#/uml/CorporationKind"/>
+ </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_Package" 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_Class" 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/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..211857fb948
--- /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,20 @@
+# 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.\
+ resources/
+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..6f73275958a
--- /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="&lt;undefined>"/>
+ <details xmi:id="_wHX8Ez7mEeuL4ce7dqV7ZQ" key="Copyright" value=""/>
+ <details xmi:id="_wHX8FD7mEeuL4ce7dqV7ZQ" key="Date" value=""/>
+ <details xmi:id="_wHX8FT7mEeuL4ce7dqV7ZQ" key="Author" value="&lt;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) 2020 Christian W. Damus, CEA LIST, and others.&#xA;&#xA;All rights reserved. This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License 2.0&#xA;which accompanies this distribution, and is available at&#xA;https://www.eclipse.org/legal/epl-2.0/&#xA;&#xA;SPDX-License-Identifier: EPL-2.0&#xA;&#xA;Contributors:&#xA; Christian W. Damus - Initial API and implementation&#xA;"/>
+ <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_Package" 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_Class" 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..4dabb495c0b
--- /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,127 @@
+/*****************************************************************************
+ * 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.isEmpty;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.regexMatches;
+import static org.hamcrest.CoreMatchers.both;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.everyItem;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.List;
+import java.util.function.Consumer;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.papyrus.infra.core.utils.TransactionHelper;
+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.OverlayFile;
+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() {
+ List<Diagnostic> diagnostics = checkModel(BOOKSTORE_PROFILE);
+
+ assertThat(diagnostics, not(hasItem(MoreMatchers.diagnosticWithMessage(containsString("must be declared as required plug-in"))))); //$NON-NLS-1$
+ assertThat(diagnostics, not(hasItem(MoreMatchers.diagnosticWithMessage(containsString("Cross-document reference by file URI"))))); //$NON-NLS-1$
+ assertThat(diagnostics, not(hasItem(MoreMatchers.diagnosticWithMessage(regexMatches("The URI .* cannot be resolved"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Verify the reporting of cross-document URIs (HREFs) with schemes that do
+ * not imply a bundle name, even if the authority looks like one.
+ */
+ @Test
+ @OverlayFile(value = "bug569357/Bookstore-weirdHREF.profile.uml", path = BOOKSTORE_PROFILE)
+ public void unresolvedNonBundleDeployedURI() {
+ List<Diagnostic> diagnostics = checkModel(BOOKSTORE_PROFILE,
+ // Pre-resolve the HREF that doesn't imply bundle deployment
+ rset -> {
+ URI libraryURI = URI.createURI("http://schema.eclipse.org/BookStore"); //$NON-NLS-1$
+ Resource library = Resource.Factory.Registry.INSTANCE.getFactory(libraryURI, EcorePackage.eCONTENT_TYPE).createResource(libraryURI);
+ library.getContents().add(EcoreFactory.eINSTANCE.createEPackage());
+ rset.getResources().add(library);
+ });
+
+ assertThat(diagnostics, both(everyItem(MoreMatchers.diagnosticWithMessage(containsString("Suspicious URI: cannot infer bundle name"))))
+ .and(not(isEmpty())));
+ }
+
+ //
+ // Test framework
+ //
+
+ List<Diagnostic> checkModel(String path) {
+ return checkModel(path, null);
+ }
+
+ List<Diagnostic> checkModel(String path, Consumer<? super ResourceSet> doctorResourceSet) {
+ Resource profile = project.loadModelResource(path);
+ if (doctorResourceSet != null) {
+ Runnable doctorIt = () -> doctorResourceSet.accept(profile.getResourceSet());
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(profile);
+ if (domain == null) {
+ doctorIt.run();
+ } else {
+ try {
+ TransactionHelper.run(domain, doctorIt);
+ } catch (Exception e) {
+ throw new AssertionError("Failed to doctor the resource set in the test.", e);
+ }
+ }
+ }
+
+ ModelDependenciesChecker checker = new ModelDependenciesChecker(project.getProject(), project.getFile(BOOKSTORE_PROFILE), profile);
+
+ BasicDiagnostic diagnostics = new BasicDiagnostic();
+ checker.check(diagnostics, null);
+
+ return diagnostics.getChildren();
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/Build.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/Build.java
new file mode 100644
index 00000000000..862224e091e
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/Build.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * 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.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a test or test class to indicate that the project should be built before running the test.
+ *
+ * @see TestProjectFixture
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Build {
+ /**
+ * Whether to build the project. A {@code false} value can override a default specified on the class.
+ */
+ boolean value() default true;
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/MarkerType.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/MarkerType.java
new file mode 100644
index 00000000000..493f14462de
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/MarkerType.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * 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.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a test or test class with the marker type to extract from test resources.
+ * If unspecified, the {@link TestProjectFixture} will extract all Java markers.
+ *
+ * @see TestProjectFixture
+ * @see TestProjectFixture#getMarkers(org.eclipse.core.resources.IResource)
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MarkerType {
+ /** The marker type to retrieve. */
+ String value();
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/OverlayFile.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/OverlayFile.java
new file mode 100644
index 00000000000..2a1992b3d00
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/OverlayFile.java
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * 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.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a test or test class with a file to overlay on the {@link TestProject project content}
+ * after that has initially been populated.
+ *
+ * @see TestProjectFixture
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+@Repeatable(OverlayFile.OverlayFiles.class)
+public @interface OverlayFile {
+
+ /**
+ * The source path of the file to overlay on the project, relative to the {@code resources/} folder.
+ */
+ String value();
+
+ /**
+ * The path of the file to create in the project. If omitted, the file is created at the same path
+ * relative to the project as the source is relative to the first-level nested folder of the
+ * {@code resources/} folder in the bundle in which the source file is contained. If the source
+ * file is a direct member of the {@code resources/} folder, then it is created in the root of
+ * the project.
+ */
+ String path() default "";
+
+ //
+ // Nested types
+ //
+
+ /**
+ * Container of the repeatable {@code OverlayFile} annotation.
+ */
+ @Target({ ElementType.METHOD, ElementType.TYPE })
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface OverlayFiles {
+ OverlayFile[] value();
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProject.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProject.java
new file mode 100644
index 00000000000..acdc8229ff4
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProject.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * 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.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Annotates a test or test class with a path to the content to copy into the project.
+ *
+ * @see TestProjectFixture
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TestProject {
+ /** The path to the project template folder, relative to the {@code resources/} folder. */
+ String value();
+}
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
new file mode 100644
index 00000000000..a1a1c72ec2c
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.common.tests/src/org/eclipse/papyrus/toolsmiths/validation/common/tests/rules/TestProjectFixture.java
@@ -0,0 +1,465 @@
+/*****************************************************************************
+ * 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.rules;
+
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Predicate;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+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;
+
+/**
+ * A project fixture that copies initial content into the project and ensures that the project name
+ * matches the bundle symbolic name if the project is a bundle project.
+ */
+public class TestProjectFixture extends ProjectFixture {
+
+ static final String JAVA_PROBLEM = "org.eclipse.jdt.core.problem"; //$NON-NLS-1$
+ static final Pattern BUNDLE_SYMBOLIC_NAME = Pattern.compile("Bundle-SymbolicName:\\s*([^;]+)"); //$NON-NLS-1$
+
+ private String markerType = JAVA_PROBLEM;
+ private String projectNameOverride;
+ private final Set<String> filteredDiagnosticSources = new HashSet<>();
+
+ /**
+ * Initializes me.
+ */
+ public TestProjectFixture() {
+ super();
+ }
+
+ /**
+ * Configure the fixture with a {@link Diagnostic} source to ignore. This allows, for example,
+ * model validation tests to ignore problems reported by validators of other languages, such as
+ * on UML concepts that are inappropriately reused in the models being validated.
+ *
+ * @param source
+ * a diagnostic source to filter out
+ * @return myself, for convenience of call chaining
+ */
+ public TestProjectFixture filterDiagnosticSource(String source) {
+ filteredDiagnosticSources.add(source);
+ return this;
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+ Build build = JUnitUtils.getAnnotation(description, Build.class);
+ if (build != null && build.value()) {
+ base = new BuildProject(base);
+ }
+
+ List<OverlayFile> overlayFiles = JUnitUtils.getAnnotationsByType(description, OverlayFile.class);
+ if (!overlayFiles.isEmpty()) {
+ base = new OverlayFilesInProject(overlayFiles, base, description);
+ }
+
+ TestProject testProject = JUnitUtils.getAnnotation(description, TestProject.class);
+ Statement initProject = new Preferences(new InitializeProject(testProject, base, description));
+
+ Statement createProject = super.apply(initProject, description);
+
+ Statement projectName = new InitProjectName(testProject, createProject, description);
+
+ MarkerType markerTypeAnnotation = JUnitUtils.getAnnotation(description, MarkerType.class);
+ Statement markerType = new SetMarkerType(markerTypeAnnotation, projectName, description);
+
+ return markerType;
+ }
+
+ /**
+ * Build the test project.
+ */
+ public void build() {
+ try {
+ getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
+ getProject().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ } catch (CoreException e) {
+ throw new AssertionError("Failed to build project.", e);
+ }
+ }
+
+ /**
+ * Get all of the markers in the project.
+ *
+ * @return the markers
+ * @see #getMarkers(IResource)
+ */
+ public List<IMarker> getMarkers() {
+ return getMarkers(getProject());
+ }
+
+ /**
+ * Get the markers on the given {@code resource}. In the case that the resource is a container,
+ * the markers of all contained resources are aggregated within it.
+ *
+ * @param resource
+ * the resource for which to get markers
+ * @return the markers
+ */
+ public List<IMarker> getMarkers(IResource resource) {
+ List<IMarker> result = null;
+
+ try {
+ Predicate<IMarker> markerPredicate = Predicate.not(marker -> filteredDiagnosticSources.contains(marker.getAttribute(IPluginChecker2.MARKER_ATTRIBUTE_DIAGNOSTIC_SOURCE, (String) null)));
+ result = Stream.of(resource.findMarkers(markerType, true, IResource.DEPTH_INFINITE))
+ .filter(markerPredicate)
+ .collect(Collectors.toList());
+ } catch (CoreException e) {
+ throw new AssertionError("Failed to get project markers.", e); //$NON-NLS-1$
+ }
+
+ return result;
+ }
+
+ /**
+ * Get the markers on the named resource. In the case that the resource is a container,
+ * the markers of all contained resources are aggregated within it.
+ *
+ * @param path
+ * the resource path for which to get markers
+ * @return the markers
+ * @see #getMarkers(IResource)
+ */
+ public List<IMarker> getMarkers(String path) {
+ IResource resource = getProject().findMember(path);
+ assertThat("No such resource in the project: " + path, resource, notNullValue()); //$NON-NLS-1$
+
+ return getMarkers(resource);
+ }
+
+ @Override
+ protected void createProject(String name) throws CoreException {
+ if (projectNameOverride != null) {
+ super.createProject(projectNameOverride);
+ } else {
+ super.createProject(name);
+ }
+ }
+
+ /**
+ * 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
+ //
+
+ /**
+ * A statement that peeks into the contents of the project before the project is created,
+ * to override the name of the project that will be created with the bundle symbolic name
+ * in the case that the project's content will be a bundle project.
+ */
+ private final class InitProjectName extends Statement {
+ private final TestProject testProject;
+ private final Statement base;
+ private final Description description;
+
+ InitProjectName(TestProject testProject, Statement base, Description description) {
+ super();
+
+ this.testProject = testProject;
+ this.base = base;
+ this.description = description;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ initializeProjectNameOverride();
+
+ base.evaluate();
+ }
+
+ private void initializeProjectNameOverride() throws IOException {
+ String path = testProject.value();
+ while (path.endsWith("/")) {
+ path = path.substring(0, path.length() - 1);
+ }
+
+ // If it's a bundle project, it needs to have the same name as the bundle
+ String resourcePath = "resources/" + path + "/META-INF/MANIFEST.MF";
+ URL resource = JUnitUtils.getTestClass(description).getClassLoader().getResource(resourcePath);
+ if (resource != null) {
+ Matcher m = null;
+ try (InputStream input = resource.openStream()) {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
+ for (String line = reader.readLine(); line != null; line = reader.readLine()) {
+ if (m == null) {
+ m = BUNDLE_SYMBOLIC_NAME.matcher(line);
+ } else {
+ m.reset(line);
+ }
+ if (m.find()) {
+ projectNameOverride = m.group(1);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * A statement that initializes the contents of the project before the test.
+ */
+ private final class InitializeProject extends Statement {
+ private final TestProject testProject;
+ private final Statement base;
+ private final Description description;
+
+ InitializeProject(TestProject testProject, Statement base, Description description) {
+ super();
+
+ this.testProject = testProject;
+ this.base = base;
+ this.description = description;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ if (testProject == null) {
+ throw new IllegalStateException("No @TestProject annotation found."); //$NON-NLS-1$
+ }
+
+ try {
+ copyFolder(JUnitUtils.getTestClass(description), "resources/" + testProject.value()); //$NON-NLS-1$
+ } catch (IOException e) {
+ throw new IOException("Failed to initialize project contents.", e); //$NON-NLS-1$
+ }
+
+ base.evaluate();
+ }
+ }
+
+ /**
+ * A statement that overlays additional files onto the initialized project.
+ *
+ * @see InitializeProject
+ */
+ private final class OverlayFilesInProject extends Statement {
+ private final List<OverlayFile> overlayFiles;
+ private final Statement base;
+ private final Description description;
+
+ OverlayFilesInProject(List<OverlayFile> overlayFiles, Statement base, Description description) {
+ super();
+
+ this.overlayFiles = List.copyOf(overlayFiles);
+ this.base = base;
+ this.description = description;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ Class<?> testClass = JUnitUtils.getTestClass(description);
+
+ for (OverlayFile overlay : overlayFiles) {
+ URL resource = testClass.getClassLoader().getResource("resources/" + overlay.value()); //$NON-NLS-1$
+ try (InputStream input = resource.openStream()) {
+ IFile file = getProject().getFile(getTargetPath(overlay));
+ if (file.exists()) {
+ file.setContents(input, true, false, null);
+ } else {
+ file.create(input, true, null);
+ }
+ }
+ }
+
+ base.evaluate();
+ }
+
+ private IPath getTargetPath(OverlayFile overlay) {
+ IPath result;
+
+ if (overlay.path().isBlank()) {
+ result = new Path(overlay.value());
+ if (result.segmentCount() > 1) {
+ result = result.removeFirstSegments(1);
+ }
+ } else {
+ result = new Path(overlay.path());
+ }
+
+ return result;
+ }
+
+ }
+
+ /**
+ * A statement that builds the project before the test.
+ */
+ private final class BuildProject extends Statement {
+ private final Statement base;
+
+ BuildProject(Statement base) {
+ super();
+
+ this.base = base;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ build();
+ base.evaluate();
+ }
+
+ }
+
+ /**
+ * A statement that ensures that Papyrus builders are enabled in the preferences
+ * and restores the preferences to the previous values when complete.
+ */
+ private final class Preferences extends Statement {
+ private final Set<String> prefNames = Set.of(
+ PluginBuilderPreferencesConstants.ACTIVATE_MAIN_PAPYRUS_BUILDER,
+ PluginBuilderPreferencesConstants.ACTIVATE_PAPYRUS_MODEL_BUILDER,
+ PluginBuilderPreferencesConstants.PAPYRUS_MODEL_BUILDER_CHECK_MODEL_DEPENDENCIES,
+ PluginBuilderPreferencesConstants.PAPYRUS_MODEL_BUILDER_VALIDATE_MODEL,
+ PluginBuilderPreferencesConstants.ACTIVATE_PAPYRUS_MANIFEST_BUILDER,
+ PluginBuilderPreferencesConstants.PAPYRUS_MANIFEST_BUILDER_CHECK_DEPENDENCY_RANGE,
+ PluginBuilderPreferencesConstants.PAPYRUS_MANIFEST_BUILDER_CHECK_NO_REEXPORT);
+ private final IPreferenceStore prefs = org.eclipse.papyrus.toolsmiths.plugin.builder.Activator.getDefault().getPreferenceStore();
+ private final Statement base;
+
+ private final Map<String, Boolean> restorePrefs = new HashMap<>();
+
+ Preferences(Statement base) {
+ super();
+
+ this.base = base;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ prefNames.forEach(pref -> restorePrefs.put(pref, prefs.getBoolean(pref)));
+ prefNames.forEach(pref -> prefs.setValue(pref, true));
+
+ try {
+ base.evaluate();
+ } finally {
+ restorePrefs.forEach((pref, restore) -> prefs.setValue(pref, restore));
+ }
+ }
+
+ }
+
+ /**
+ * A statement that sets the marker type to extract from resources for the duration of a test.
+ */
+ private final class SetMarkerType extends Statement {
+ private final String testMarkerType;
+ private final Statement base;
+ private String restoreMarkerType;
+
+ SetMarkerType(MarkerType annotation, Statement base, Description description) {
+ super();
+
+ this.testMarkerType = Optional.ofNullable(annotation).map(MarkerType::value).orElse(JAVA_PROBLEM);
+ this.base = base;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ restoreMarkerType = TestProjectFixture.this.markerType;
+
+ try {
+ TestProjectFixture.this.markerType = testMarkerType;
+ base.evaluate();
+ } finally {
+ TestProjectFixture.this.markerType = restoreMarkerType;
+ }
+ }
+
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/META-INF/MANIFEST.MF
index 58570886bae..6ce1b3e58b6 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/META-INF/MANIFEST.MF
@@ -12,7 +12,11 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="[2.18.0,3.0.0)",
org.eclipse.papyrus.junit.utils;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.toolsmiths.validation.elementtypes;bundle-version="[2.0.0,3.0.0)",
org.eclipse.ui.views.properties.tabbed;bundle-version="[3.8.0,4.0.0)",
- org.junit;bundle-version="[4.13.0,5.0.0)"
+ org.junit;bundle-version="[4.13.0,5.0.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.uml2.uml;bundle-version="[5.5.0,6.0.0)",
+ org.eclipse.papyrus.toolsmiths.validation.common.tests;bundle-version="[2.0.0,3.0.0)"
Bundle-Activator: org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests.Activator
Export-Package: org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests
Automatic-Module-Name: org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-noProfile.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-noProfile.properties
new file mode 100644
index 00000000000..2a264b08c73
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-noProfile.properties
@@ -0,0 +1,21 @@
+# Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 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
+# Christian W. Damus - bug 569357
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ resources/BookStore.elementtypesconfigurations
+jars.compile.order = .
+source.. = src
+output.. = bin/
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-explicit.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-explicit.properties
new file mode 100644
index 00000000000..4becabc7ad2
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-explicit.properties
@@ -0,0 +1,22 @@
+# Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 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
+# Christian W. Damus - bug 569357
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ resources/BookStore.elementtypesconfigurations,\
+ resources/BookStore.profile.uml
+jars.compile.order = .
+source.. = src
+output.. = bin/
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-folder.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-folder.properties
new file mode 100644
index 00000000000..925902ac2f5
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-build/build-ok-folder.properties
@@ -0,0 +1,21 @@
+# Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 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
+# Christian W. Damus - bug 569357
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ resources/
+jars.compile.order = .
+source.. = src
+output.. = bin/
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noClientContext.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noClientContext.xml
new file mode 100644
index 00000000000..a4caf49cdc2
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noClientContext.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
+ <elementTypeSet
+ path="resources/BookStore.elementtypesconfigurations"/>
+ </extension>
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noExtension.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noExtension.xml
new file mode 100644
index 00000000000..70e56bc2fc9
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-noExtension.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.emf.ecore.uri_mapping">
+ <mapping
+ source="pathmap://TEST/BOOK_STORE/"
+ target="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/resources/">
+ </mapping>
+ </extension>
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-wrongPath.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-wrongPath.xml
new file mode 100644
index 00000000000..46bf3319dc1
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-extensions/plugin-wrongPath.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
+ <elementTypeSet
+ clientContextID="org.eclipse.papyrus.infra.types.context"
+ path="resources/BookStore.elementtypesconfigurations"/>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
+ <elementTypeSet
+ clientContextID="org.eclipse.papyrus.infra.types.context"
+ path="resources/NoSuchFile.elementtypesconfigurations"/>
+ </extension>
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/BookStore-metamodelNSURI.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/BookStore-metamodelNSURI.elementtypesconfigurations
new file mode 100644
index 00000000000..9fbe57e878a
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/BookStore-metamodelNSURI.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/Papyrus/Test/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_JZsN4DpSEeubmtHuaj6Y7A" featureName="isbn">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_UUKsgDpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_WRLLwDpUEeubmtHuaj6Y7A" value="0-684-81870-1"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations
new file mode 100644
index 00000000000..47de4fba62b
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_JZsN4DpSEeubmtHuaj6Y7A" featureName="isbn">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_f7Az0DpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_f7Az0TpUEeubmtHuaj6Y7A" value="0-684-81870-1"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unqualifiedStereotypeName.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unqualifiedStereotypeName.elementtypesconfigurations
new file mode 100644
index 00000000000..d60b0c594af
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unqualifiedStereotypeName.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_JZsN4DpSEeubmtHuaj6Y7A" featureName="isbn">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_f7Az0DpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_f7Az0TpUEeubmtHuaj6Y7A" value="0-684-81870-1"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedFeatureName.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedFeatureName.elementtypesconfigurations
new file mode 100644
index 00000000000..61797da214d
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedFeatureName.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_JZsN4DpSEeubmtHuaj6Y7A" featureName="whatever">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_gsX_UDpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_gsYmYDpUEeubmtHuaj6Y7A" value="Hello, world!"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedProfileName.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedProfileName.elementtypesconfigurations
new file mode 100644
index 00000000000..68d0df50eeb
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedProfileName.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Book">
+ <requiredProfiles>NoSuchProfile</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_gjzkEDpSEeubmtHuaj6Y7A" featureName="isbn">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_hdM_UDpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_hdM_UTpUEeubmtHuaj6Y7A" value="0-684-81870-1"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedStereotypeName.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedStereotypeName.elementtypesconfigurations
new file mode 100644
index 00000000000..9f8667d6754
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/applyStereotype/BookStore-unresolvedStereotypeName.elementtypesconfigurations
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="NoSuchProfile::Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ <featuresToSet xmi:type="applystereotypeadvice:FeatureToSet" xmi:id="_gufKEDpSEeubmtHuaj6Y7A" featureName="isbn">
+ <value xmi:type="applystereotypeadvice:ConstantValue" xmi:id="_iZjS0DpUEeubmtHuaj6Y7A">
+ <valueInstance xmi:type="uml:LiteralString" xmi:id="_iZjS0TpUEeubmtHuaj6Y7A" value="0-684-81870-1"/>
+ </value>
+ </featuresToSet>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-ok.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-ok.elementtypesconfigurations
new file mode 100644
index 00000000000..680da92136b
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-ok.elementtypesconfigurations
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypematcher="http://www.eclipse.org/papyrus/uml/types/stereotypematcher/1.1" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" matcherConfiguration="_zHHHMDpSEeubmtHuaj6Y7A">
+ <ownedConfigurations xmi:type="stereotypematcher:StereotypeMatcherAdviceConfiguration" xmi:id="_zHHHMDpSEeubmtHuaj6Y7A" identifier="test.BookStore.Book" target="_fen2kGBhEemoFuWBTUmJOQ" matchedType="_fen2kGBhEemoFuWBTUmJOQ" profileUri="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore">
+ <stereotypesQualifiedNames>BookStore::Book</stereotypesQualifiedNames>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedProfileURI.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedProfileURI.elementtypesconfigurations
new file mode 100644
index 00000000000..b6b37107893
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedProfileURI.elementtypesconfigurations
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypematcher="http://www.eclipse.org/papyrus/uml/types/stereotypematcher/1.1" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" matcherConfiguration="_zHHHMDpSEeubmtHuaj6Y7A">
+ <ownedConfigurations xmi:type="stereotypematcher:StereotypeMatcherAdviceConfiguration" xmi:id="_zHHHMDpSEeubmtHuaj6Y7A" identifier="test.BookStore.Book" target="_fen2kGBhEemoFuWBTUmJOQ" matchedType="_fen2kGBhEemoFuWBTUmJOQ" profileUri="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/bogus">
+ <stereotypesQualifiedNames>BookStore::Book</stereotypesQualifiedNames>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedStereotypeName.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedStereotypeName.elementtypesconfigurations
new file mode 100644
index 00000000000..60a8b14cbbb
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeMatcher/BookStore-unresolvedStereotypeName.elementtypesconfigurations
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypematcher="http://www.eclipse.org/papyrus/uml/types/stereotypematcher/1.1" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" matcherConfiguration="_zHHHMDpSEeubmtHuaj6Y7A">
+ <ownedConfigurations xmi:type="stereotypematcher:StereotypeMatcherAdviceConfiguration" xmi:id="_zHHHMDpSEeubmtHuaj6Y7A" identifier="test.BookStore.Book" target="_fen2kGBhEemoFuWBTUmJOQ" matchedType="_fen2kGBhEemoFuWBTUmJOQ" profileUri="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore">
+ <stereotypesQualifiedNames>Bogus::Book</stereotypesQualifiedNames>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-ok.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-ok.elementtypesconfigurations
new file mode 100644
index 00000000000..d31f953a9ee
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-ok.elementtypesconfigurations
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypepropertyreferenceedgeadvice="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration" xmi:id="_5Qb3EDpsEeubmtHuaj6Y7A" identifier="test.Bookstore.Book.advice" target="_fen2kGBhEemoFuWBTUmJOQ" featureToSet="author" stereotypeQualifiedName="BookStore::Book" edgeLabel="author"/>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedFeature.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedFeature.elementtypesconfigurations
new file mode 100644
index 00000000000..25c8525763d
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedFeature.elementtypesconfigurations
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypepropertyreferenceedgeadvice="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration" xmi:id="_5Qb3EDpsEeubmtHuaj6Y7A" identifier="test.Bookstore.Book.advice" target="_fen2kGBhEemoFuWBTUmJOQ" featureToSet="writer" stereotypeQualifiedName="BookStore::Book" edgeLabel="author"/>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedStereotype.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedStereotype.elementtypesconfigurations
new file mode 100644
index 00000000000..8d1058f50f4
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-models/stereotypeReference/BookStore-unresolvedStereotype.elementtypesconfigurations
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:stereotypepropertyreferenceedgeadvice="http://www.eclipse.org/papyrus/uml/types/stereotypepropertyreferenceedgeadvice/1.0" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="stereotypepropertyreferenceedgeadvice:StereotypePropertyReferenceEdgeAdviceConfiguration" xmi:id="_5Qb3EDpsEeubmtHuaj6Y7A" identifier="test.Bookstore.Book.advice" target="_fen2kGBhEemoFuWBTUmJOQ" featureToSet="author" stereotypeQualifiedName="BookSeller::Book" edgeLabel="author"/>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/META-INF/MANIFEST.MF b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..286247154f0
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.validation.elementtypes.example;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.toolsmiths.validation.elementtypes.example.Activator
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
+ org.eclipse.uml2.uml;bundle-version="[1.0.0,99.0.0)",
+ org.eclipse.papyrus.infra.types;bundle-version="[1.0.0,99.0.0)",
+ org.eclipse.papyrus.infra.types.core;bundle-version="[1.0.0,99.0.0)",
+ org.eclipse.papyrus.uml.service.types;bundle-version="[1.0.0,99.0.0)",
+ org.eclipse.papyrus.sysml16.service.types;bundle-version="[1.0.0,99.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-11
+Automatic-Module-Name: org.eclipse.papyrus.toolsmiths.validation.elementtypes.example
+Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/build.properties b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/build.properties
new file mode 100644
index 00000000000..925902ac2f5
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/build.properties
@@ -0,0 +1,21 @@
+# Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 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
+# Christian W. Damus - bug 569357
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ resources/
+jars.compile.order = .
+source.. = src
+output.. = bin/
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/plugin.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/plugin.xml
new file mode 100644
index 00000000000..750ac3eace9
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/plugin.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License 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
+ Christian W. Damus - bug 569357
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
+ <elementTypeSet
+ clientContextID="org.eclipse.papyrus.infra.types.context"
+ path="resources/BookStore.elementtypesconfigurations"/>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecore.uri_mapping">
+ <mapping
+ source="pathmap://TEST/BOOK_STORE/"
+ target="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/resources/">
+ </mapping>
+ </extension>
+ <extension
+ point="org.eclipse.emf.ecore.dynamic_package">
+ <resource
+ location="pathmap://TEST/BOOK_STORE/BookStore.profile.uml#_pafKgTpKEeubmtHuaj6Y7A"
+ uri="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore">
+ </resource>
+ </extension>
+ <extension
+ point="org.eclipse.uml2.uml.dynamic_package">
+ <profile
+ location="pathmap://TEST/BOOK_STORE/BookStore.profile.uml#_3SkxIDpJEeubmtHuaj6Y7A"
+ uri="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore">
+ </profile>
+ </extension>
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.elementtypesconfigurations b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.elementtypesconfigurations
new file mode 100644
index 00000000000..7c0c39bb78b
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.elementtypesconfigurations
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<elementtypesconfigurations:ElementTypeSetConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:applystereotypeadvice="http://www.eclipse.org/papyrus/uml/types/applystereotypeadvice/1.1" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmi:id="_c0DGsGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.elementTypeSet" name="BookStore" metamodelNsURI="http://www.eclipse.org/uml2/5.0.0/UML">
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_fen2kGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Book" name="Book" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_h1LeQGBhEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.book" target="_fen2kGBhEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_SncTUGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Book">
+ <requiredProfiles>BookStore</requiredProfiles>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_ECdm8GBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Person" name="Person" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_NnwtQGBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.person" target="_ECdm8GBiEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_S5wyYGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Person">
+ <requiredProfiles>BookStore</requiredProfiles>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ <specializedTypes xmi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Class"/>
+ </elementTypeConfigurations>
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_EIk2AGBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Author" name="Author" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" specializedTypes="_ECdm8GBiEemoFuWBTUmJOQ">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_Ns-kcGBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.author" target="_EIk2AGBiEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_TK9QEGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Author">
+ <requiredProfiles>BookStore</requiredProfiles>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ </elementTypeConfigurations>
+ <elementTypeConfigurations xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" xmi:id="_ENo8MGBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.Editor" name="Editor" hint="UML::Class" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" specializedTypes="_ECdm8GBiEemoFuWBTUmJOQ">
+ <ownedConfigurations xmi:type="applystereotypeadvice:ApplyStereotypeAdviceConfiguration" xmi:id="_N72t8GBiEemoFuWBTUmJOQ" identifier="org.eclipse.papyrus.toolsmiths.validation.elementtypes.editor" target="_ENo8MGBiEemoFuWBTUmJOQ">
+ <stereotypesToApply xmi:type="applystereotypeadvice:StereotypeToApply" xmi:id="_T9BmMGBiEemoFuWBTUmJOQ" stereotypeQualifiedName="BookStore::Editor">
+ <requiredProfiles>BookStore</requiredProfiles>
+ </stereotypesToApply>
+ </ownedConfigurations>
+ </elementTypeConfigurations>
+</elementtypesconfigurations:ElementTypeSetConfiguration>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.profile.uml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.profile.uml
new file mode 100644
index 00000000000..86ac309b0cb
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/bug569357-ok/resources/BookStore.profile.uml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Ecore="http://www.eclipse.org/uml2/schemas/Ecore/5" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Ecore/5 pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA">
+ <uml:Profile xmi:id="_3SkxIDpJEeubmtHuaj6Y7A" name="BookStore" URI="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore" metaclassReference="_RifaoDpKEeubmtHuaj6Y7A _aPhcMDpKEeubmtHuaj6Y7A">
+ <eAnnotations xmi:id="_pafKgDpKEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <contents xmi:type="ecore:EPackage" xmi:id="_pafKgTpKEeubmtHuaj6Y7A" name="bookstore" nsURI="http://www.eclipse.org/Papyrus/2020/Toolsmiths/test/builder/elementtypes/BookStore" nsPrefix="bkst">
+ <eAnnotations xmi:id="_8t_toTptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <details xmi:id="_8t_tojptEeubmtHuaj6Y7A" key="originalName" value="BookStore"/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8t_tozptEeubmtHuaj6Y7A" name="BookStore">
+ <eAnnotations xmi:id="_8t_tpDptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_T-C3EDpKEeubmtHuaj6Y7A"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8t_tpTptEeubmtHuaj6Y7A" name="base_Package" ordered="false" lowerBound="1">
+ <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="_8t_tpzptEeubmtHuaj6Y7A" name="Book">
+ <eAnnotations xmi:id="_8t_tqDptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_c17dwDpKEeubmtHuaj6Y7A"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8t_tqTptEeubmtHuaj6Y7A" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_8t_tqzptEeubmtHuaj6Y7A" name="isbn" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8t_trTptEeubmtHuaj6Y7A" name="author" ordered="false" lowerBound="1" upperBound="-1" eType="_8t_trzptEeubmtHuaj6Y7A"/>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8t_trzptEeubmtHuaj6Y7A" name="Author" eSuperTypes="_8t_tsjptEeubmtHuaj6Y7A">
+ <eAnnotations xmi:id="_8t_tsDptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fIc6ADpKEeubmtHuaj6Y7A"/>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8t_tsjptEeubmtHuaj6Y7A" name="Person">
+ <eAnnotations xmi:id="_8t_tszptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_e3vkgDpKEeubmtHuaj6Y7A"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8t_ttDptEeubmtHuaj6Y7A" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8t_ttjptEeubmtHuaj6Y7A" name="Editor" eSuperTypes="_8t_tsjptEeubmtHuaj6Y7A">
+ <eAnnotations xmi:id="_8t_ttzptEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fQATgDpKEeubmtHuaj6Y7A"/>
+ </eClassifiers>
+ </contents>
+ </eAnnotations>
+ <elementImport xmi:id="_RifaoDpKEeubmtHuaj6Y7A">
+ <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </elementImport>
+ <elementImport xmi:id="_aPhcMDpKEeubmtHuaj6Y7A">
+ <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/>
+ </elementImport>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_T-C3EDpKEeubmtHuaj6Y7A" name="BookStore">
+ <ownedAttribute xmi:id="_b3uJEDpKEeubmtHuaj6Y7A" name="base_Package" association="_b3tiADpKEeubmtHuaj6Y7A">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_b3tiADpKEeubmtHuaj6Y7A" name="Package_BookStore" memberEnd="_b3tiATpKEeubmtHuaj6Y7A _b3uJEDpKEeubmtHuaj6Y7A">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_b3tiATpKEeubmtHuaj6Y7A" name="extension_BookStore" type="_T-C3EDpKEeubmtHuaj6Y7A" aggregation="composite" association="_b3tiADpKEeubmtHuaj6Y7A"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_c17dwDpKEeubmtHuaj6Y7A" name="Book">
+ <ownedAttribute xmi:id="_ko2ngjpKEeubmtHuaj6Y7A" name="base_Class" association="_ko2ngDpKEeubmtHuaj6Y7A">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="_PEAFUDpSEeubmtHuaj6Y7A" name="isbn">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:id="_TXii0DptEeubmtHuaj6Y7A" name="author" type="_fIc6ADpKEeubmtHuaj6Y7A" association="_a6ORIDptEeubmtHuaj6Y7A">
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_VQ_-0DptEeubmtHuaj6Y7A" value="*"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_e3vkgDpKEeubmtHuaj6Y7A" name="Person">
+ <ownedAttribute xmi:id="_lwpWAjpKEeubmtHuaj6Y7A" name="base_Class" association="_lwpWADpKEeubmtHuaj6Y7A">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_fIc6ADpKEeubmtHuaj6Y7A" name="Author">
+ <generalization xmi:id="_N_kYkDptEeubmtHuaj6Y7A" general="_e3vkgDpKEeubmtHuaj6Y7A"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_fQATgDpKEeubmtHuaj6Y7A" name="Editor">
+ <generalization xmi:id="_Pbs_YDptEeubmtHuaj6Y7A" general="_e3vkgDpKEeubmtHuaj6Y7A"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_ko2ngDpKEeubmtHuaj6Y7A" name="Class_Book" memberEnd="_ko2ngTpKEeubmtHuaj6Y7A _ko2ngjpKEeubmtHuaj6Y7A">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_ko2ngTpKEeubmtHuaj6Y7A" name="extension_Book" type="_c17dwDpKEeubmtHuaj6Y7A" aggregation="composite" association="_ko2ngDpKEeubmtHuaj6Y7A"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_lwpWADpKEeubmtHuaj6Y7A" name="Class_Person" memberEnd="_lwpWATpKEeubmtHuaj6Y7A _lwpWAjpKEeubmtHuaj6Y7A">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_lwpWATpKEeubmtHuaj6Y7A" name="extension_Person" type="_e3vkgDpKEeubmtHuaj6Y7A" aggregation="composite" association="_lwpWADpKEeubmtHuaj6Y7A"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Association" xmi:id="_a6ORIDptEeubmtHuaj6Y7A" memberEnd="_TXii0DptEeubmtHuaj6Y7A _eBI-wDptEeubmtHuaj6Y7A">
+ <ownedEnd xmi:id="_eBI-wDptEeubmtHuaj6Y7A" name="book" association="_a6ORIDptEeubmtHuaj6Y7A">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mRN-kDptEeubmtHuaj6Y7A"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_lva5EDptEeubmtHuaj6Y7A" value="*"/>
+ </ownedEnd>
+ </packagedElement>
+ <profileApplication xmi:id="_GB33IDpKEeubmtHuaj6Y7A">
+ <eAnnotations xmi:id="_GB7hgDpKEeubmtHuaj6Y7A" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="pathmap://UML_PROFILES/Ecore.profile.uml#_z1OFcHjqEdy8S4Cr8Rc_NA"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
+ </profileApplication>
+ </uml:Profile>
+ <Ecore:EPackage xmi:id="_JbI5ADpKEeubmtHuaj6Y7A" base_Package="_3SkxIDpJEeubmtHuaj6Y7A" packageName="bookstore" nsPrefix="bkst"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/.project b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/.project
index bb1457d0325..a7610e2f834 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/.project
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example/.project
@@ -20,9 +20,15 @@
<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.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/AllTests.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/AllTests.java
index a369f44a5b9..9043092917c 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/AllTests.java
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/AllTests.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2019 CEA LIST, and others.
+ * Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 569357
*
*****************************************************************************/
package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
@@ -22,7 +23,12 @@ import org.junit.runners.Suite.SuiteClasses;
* All tests for Element types plug-in validation
*/
@RunWith(Suite.class)
-@SuiteClasses({ ElementTypesPluginValidationTest.class
+@SuiteClasses({
+ ElementTypesPluginValidationTest.class,
+ ElementTypesPluginBuilderTest.class,
+ ElementTypesPluginXMLBuilderTest.class,
+ ElementTypesModelBuilderTest.class,
+ ElementTypesBuildPropertiesBuilderTest.class,
})
public class AllTests {
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesBuildPropertiesBuilderTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesBuildPropertiesBuilderTest.java
new file mode 100644
index 00000000000..1dda21b37fe
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesBuildPropertiesBuilderTest.java
@@ -0,0 +1,88 @@
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
+
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerMessage;
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerSeverity;
+import static org.eclipse.papyrus.toolsmiths.validation.elementtypes.constants.ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE;
+import static org.hamcrest.CoreMatchers.anything;
+import static org.hamcrest.CoreMatchers.both;
+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 java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.Build;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.MarkerType;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.OverlayFile;
+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;
+
+/**
+ * Test cases for the <em>Element Types Configurations</em> validation of <tt>build.properties</tt>
+ * in the project builder.
+ */
+@TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+@OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+@MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+@Build
+public class ElementTypesBuildPropertiesBuilderTest extends AbstractPapyrusTest {
+
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture();
+
+ /**
+ * Test the reporting of a co-defined model resource (a UML Profile in this case) that is not included in the build.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-build/build-noProfile.properties", path = "build.properties")
+ public void missingReferencedResource() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("build.properties"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("BookStore.profile.uml"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test that it is okay when all required resources from the project are explicitly listed.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-build/build-ok-explicit.properties", path = "build.properties")
+ public void allReferencesExplicit() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("build.properties"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+
+ /**
+ * Test that it is okay when all required resources from the project are implicitly listed by a folder.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-build/build-ok-folder.properties", path = "build.properties")
+ public void allReferencedByFolder() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("build.properties"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesModelBuilderTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesModelBuilderTest.java
new file mode 100644
index 00000000000..d7b6f78380d
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesModelBuilderTest.java
@@ -0,0 +1,233 @@
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
+
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerMessage;
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerSeverity;
+import static org.eclipse.papyrus.toolsmiths.validation.elementtypes.constants.ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE;
+import static org.hamcrest.CoreMatchers.anything;
+import static org.hamcrest.CoreMatchers.both;
+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 java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.Build;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.MarkerType;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.OverlayFile;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.TestProject;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.TestProjectFixture;
+import org.eclipse.uml2.uml.util.UMLValidator;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
+
+/**
+ * Test cases for the <em>Element Types Configurations</em> validation of the model resource
+ * in the project builder.
+ */
+@RunWith(Enclosed.class)
+public class ElementTypesModelBuilderTest extends AbstractPapyrusTest {
+
+ @TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+ @OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+ @OverlayFile("bug569357-ok/plugin.xml")
+ @MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+ @Build
+ public static class General {
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture().filterDiagnosticSource(UMLValidator.DIAGNOSTIC_SOURCE);
+
+ /**
+ * Test the reporting of an unresolved metamodel NS URI.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/BookStore-metamodelNSURI.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedMetamodelNSURI() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved metamodel NS URI"))))); //$NON-NLS-1$
+ }
+ }
+
+ @TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+ @OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+ @OverlayFile("bug569357-ok/plugin.xml")
+ @MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+ @Build
+ public static class ApplyStereotypeAdvice {
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture().filterDiagnosticSource(UMLValidator.DIAGNOSTIC_SOURCE);
+
+ /**
+ * Test the reporting of an unresolved profile qualified name.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-unresolvedProfileName.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedProfileQualifiedName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved profile 'NoSuchProfile'"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of an unresolved stereotype qualified name.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-unresolvedStereotypeName.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedStereotypeQualifiedName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved stereotype"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of an unresolved feature name to set.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-unresolvedFeatureName.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedFeatureName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("No such feature 'whatever'"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of an unresolved stereotype because the name was not qualified.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-unqualifiedStereotypeName.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unqualifiedStereotypeQualifiedName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved stereotype"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the validation of a model that is OK.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void ok() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+ }
+
+ @TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+ @OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+ @OverlayFile("bug569357-ok/plugin.xml")
+ @MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+ @Build
+ public static class StereotypeMatcherAdvice {
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture().filterDiagnosticSource(UMLValidator.DIAGNOSTIC_SOURCE);
+
+ /**
+ * Test the reporting of an unresolved profile qualified name.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/stereotypeMatcher/BookStore-unresolvedProfileURI.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedProfileURI() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved profile"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of an unresolved stereotype qualified name.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/stereotypeMatcher/BookStore-unresolvedStereotypeName.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedStereotypeQualifiedName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved stereotype"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the validation of a model that is OK.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/stereotypeMatcher/BookStore-ok.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void ok() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+ }
+
+ @TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+ @OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+ @OverlayFile("bug569357-ok/plugin.xml")
+ @MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+ @Build
+ public static class StereotypeReferenceEdgeAdvice {
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture().filterDiagnosticSource(UMLValidator.DIAGNOSTIC_SOURCE);
+
+ /**
+ * Test the reporting of an unresolved stereotype qualified name.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/stereotypeReference/BookStore-unresolvedStereotype.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedStereotypeQualifiedName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved stereotype"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of an unresolved feature name to set.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/stereotypeReference/BookStore-unresolvedFeature.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void unresolvedFeatureName() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("Unresolved feature 'writer'"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the validation of a model that is OK.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-models/applyStereotype/BookStore-ok.elementtypesconfigurations", path = "resources/BookStore.elementtypesconfigurations")
+ public void ok() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginBuilderTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginBuilderTest.java
new file mode 100644
index 00000000000..32877cbecdc
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginBuilderTest.java
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 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
+ * Christian W. Damus - bug 569357
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
+
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThanOrEqual;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.hasAtLeast;
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerSeverity;
+import static org.eclipse.papyrus.toolsmiths.validation.elementtypes.constants.ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE;
+import static org.hamcrest.CoreMatchers.anything;
+import static org.hamcrest.CoreMatchers.everyItem;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.Build;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.MarkerType;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.OverlayFile;
+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;
+
+/**
+ * Test cases for the <em>Element Types Configurations</em> project builder configurations.
+ */
+@TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+@MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+@Build
+public class ElementTypesPluginBuilderTest extends AbstractPapyrusTest {
+
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture();
+
+ /**
+ * Test the reporting of problems on the element types model resource.
+ */
+ @Test
+ public void modelValidationFails() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+ assertThat("The number of markers for model file is not correct", modelMarkers.size(), greaterThanOrEqual(2)); //$NON-NLS-1$
+ assertThat("The severity of the model markesr is not correct", modelMarkers, everyItem(isMarkerSeverity(IMarker.SEVERITY_ERROR))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of problems on the bundle manifest.
+ */
+ @Test
+ public void dependencyValidationFails() {
+ final List<IMarker> dependenciesMarkers = fixture.getMarkers("META-INF/MANIFEST.MF"); //$NON-NLS-1$
+ assertThat("The number of markers for dependencies is not correct", dependenciesMarkers.size(), greaterThanOrEqual(5)); //$NON-NLS-1$
+ assertThat("The number of warning markers for dependencies is not correct", dependenciesMarkers, hasAtLeast(2, isMarkerSeverity(IMarker.SEVERITY_WARNING))); //$NON-NLS-1$
+ assertThat("The number of error markers for dependencies is not correct", dependenciesMarkers, hasAtLeast(3, isMarkerSeverity(IMarker.SEVERITY_ERROR))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of problems on the <tt>build.properties</tt> file.
+ */
+ @Test
+ public void buildPropertiesValidationFails() {
+ final List<IMarker> buildMarkers = fixture.getMarkers("build.properties"); //$NON-NLS-1$
+ assertThat("The number of markers for dependencies is not correct", buildMarkers.size(), greaterThanOrEqual(1)); //$NON-NLS-1$
+ assertThat("The number of error markers for build.properties is not correct", buildMarkers, hasAtLeast(1, isMarkerSeverity(IMarker.SEVERITY_ERROR))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of problems on the <tt>plugin.xml</tt> file.
+ */
+ @Test
+ public void extensionValidationFails() {
+ final List<IMarker> extensionsMarkers = fixture.getMarkers("plugin.xml"); //$NON-NLS-1$
+ assertThat("The number of markers for extensions is not correct", extensionsMarkers.size(), greaterThanOrEqual(1)); //$NON-NLS-1$
+ assertThat("Missing extension should be a warning", extensionsMarkers, hasItem(isMarkerSeverity(IMarker.SEVERITY_WARNING))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test that a build of a correct project produces no markers on the bundle manifest.
+ */
+ @Test
+ @OverlayFile("bug569357-ok/META-INF/MANIFEST.MF")
+ public void dependencyValidationPasses() {
+ final List<IMarker> markers = fixture.getMarkers("META-INF/MANIFEST.MF"); //$NON-NLS-1$
+ assertThat(markers, not(hasItem(anything())));
+ }
+
+ /**
+ * Test that a build of a correct project produces no markers on the <tt>build.properties</tt> file.
+ */
+ @Test
+ @OverlayFile("bug569357-ok/build.properties")
+ public void buildPropertiesValidationPasses() {
+ final List<IMarker> markers = fixture.getMarkers("build.properties"); //$NON-NLS-1$
+ assertThat(markers, not(hasItem(anything())));
+ }
+
+ /**
+ * Test that a build of a correct project produces no markers on the <tt>plugin.xml</tt> file.
+ */
+ @Test
+ @OverlayFile("bug569357-ok/plugin.xml")
+ public void extensionValidationPasses() {
+ final List<IMarker> markers = fixture.getMarkers("plugin.xml"); //$NON-NLS-1$
+ assertThat(markers, not(hasItem(anything())));
+ }
+
+ /**
+ * Test that a build of a correct project produces no markers on the element-types model file.
+ */
+ @Test
+ @OverlayFile("bug569357-ok/plugin.xml")
+ @OverlayFile("bug569357-ok/resources/BookStore.elementtypesconfigurations")
+ @OverlayFile("bug569357-ok/resources/BookStore.profile.uml")
+ public void modelValidationPasses() {
+ final List<IMarker> markers = fixture.getMarkers("resources/BookStore.elementtypesconfigurations"); //$NON-NLS-1$
+ assertThat(markers, not(hasItem(anything())));
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginValidationTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginValidationTest.java
index 22d97389f6d..e53b30c34fe 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginValidationTest.java
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginValidationTest.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2019 CEA LIST, and others.
+ * Copyright (c) 2019, 2020 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,10 +10,18 @@
*
* Contributors:
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 569357
*
*****************************************************************************/
package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.greaterThanOrEqual;
+import static org.eclipse.papyrus.junit.matchers.MoreMatchers.hasAtLeast;
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerSeverity;
+import static org.hamcrest.CoreMatchers.everyItem;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.MatcherAssert.assertThat;
+
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
@@ -44,11 +52,6 @@ public class ElementTypesPluginValidationTest extends AbstractPapyrusTest {
private static final String PLUGIN_PATH = "resources/org.eclipse.papyrus.toolsmiths.validation.elementtypes.example";//$NON-NLS-1$
/**
- * The severity attribute identifier.
- */
- private static final String SEVERITY_ID = "severity"; //$NON-NLS-1$
-
- /**
* The project fixture to manage easily the project.
*/
@Rule
@@ -77,53 +80,28 @@ public class ElementTypesPluginValidationTest extends AbstractPapyrusTest {
// Get the markers
List<IMarker> markers = null;
try {
- markers = Arrays.asList(fixture.getProject().findMarkers(ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_TYPE, true, IResource.DEPTH_INFINITE));
+ markers = Arrays.asList(fixture.getProject().findMarkers(ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE, true, IResource.DEPTH_INFINITE));
} catch (CoreException e) {
Assert.fail("Error with resource"); //$NON-NLS-1$
}
// Now check the markers
- Assert.assertNotNull("The markers have to be found", markers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers is not correct", 11, markers.size()); //$NON-NLS-1$
// Check the elementtypesconfigurations file markers
final List<IMarker> elementtypesFileMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("BookStore.elementtypesconfigurations")).collect(Collectors.toList()); //$NON-NLS-1$
- Assert.assertNotNull("Elementtypesconfigurations file markers are not found", elementtypesFileMarkers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers for elementtypesconfigurations file is not correct", 2, elementtypesFileMarkers.size()); //$NON-NLS-1$
- Assert.assertTrue("The severity of elementtypesconfigurations marker is not correct", isMarkerSeverity(elementtypesFileMarkers.get(0), IMarker.SEVERITY_ERROR)); //$NON-NLS-1$
+ assertThat("The number of markers for elementtypesconfigurations file is not correct", elementtypesFileMarkers.size(), greaterThanOrEqual(2)); //$NON-NLS-1$
+ assertThat("The severity of elementtypesconfigurations marker is not correct", elementtypesFileMarkers, everyItem(isMarkerSeverity(IMarker.SEVERITY_ERROR))); //$NON-NLS-1$
// Check the dependencies markers
final List<IMarker> dependenciesMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("MANIFEST.MF")).collect(Collectors.toList()); //$NON-NLS-1$
- Assert.assertNotNull("Dependencies markers are not found", dependenciesMarkers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers for dependencies is not correct", 8, dependenciesMarkers.size()); //$NON-NLS-1$
- final List<IMarker> warningExtensionsMarkers = dependenciesMarkers.stream().filter(marker -> isMarkerSeverity(marker, IMarker.SEVERITY_WARNING)).collect(Collectors.toList());
- Assert.assertEquals("The number of warning markers for dependencies is not correct", 6, warningExtensionsMarkers.size()); //$NON-NLS-1$
- final List<IMarker> errorExtensionsMarkers = dependenciesMarkers.stream().filter(marker -> isMarkerSeverity(marker, IMarker.SEVERITY_ERROR)).collect(Collectors.toList());
- Assert.assertEquals("The number of error markers for dependencies is not correct", 2, errorExtensionsMarkers.size()); //$NON-NLS-1$
+ assertThat("The number of markers for dependencies is not correct", dependenciesMarkers.size(), greaterThanOrEqual(5)); //$NON-NLS-1$
+ assertThat("The number of warning markers for dependencies is not correct", dependenciesMarkers, hasAtLeast(2, isMarkerSeverity(IMarker.SEVERITY_WARNING))); //$NON-NLS-1$
+ assertThat("The number of error markers for dependencies is not correct", dependenciesMarkers, hasAtLeast(3, isMarkerSeverity(IMarker.SEVERITY_ERROR))); //$NON-NLS-1$
// Check the extensions markers
final List<IMarker> extensionsMarkers = markers.stream().filter(marker -> marker.getResource().getFullPath().toString().endsWith("plugin.xml")).collect(Collectors.toList()); //$NON-NLS-1$
- Assert.assertNotNull("Extensions markers are not found", extensionsMarkers); //$NON-NLS-1$
- Assert.assertEquals("The number of markers for extensions is not correct", 1, extensionsMarkers.size()); //$NON-NLS-1$
- Assert.assertTrue("The severity of extensions marker is not correct", isMarkerSeverity(elementtypesFileMarkers.get(0), IMarker.SEVERITY_ERROR)); //$NON-NLS-1$
- }
-
- /**
- * This allows to determinate if a marker got the correct severity.
- *
- * @param marker
- * the marker.
- * @param severity
- * The severity to get.
- * @return <code>true</code> if the marker got the correct severity, <code>false</code> otherwise.
- */
- private boolean isMarkerSeverity(final IMarker marker, final int severity) {
- try {
- return severity == (int) marker.getAttribute(SEVERITY_ID);
- } catch (CoreException e) {
- Assert.fail("Error while getting " + SEVERITY_ID); //$NON-NLS-1$
- return false;
- }
+ assertThat("The number of markers for extensions is not correct", extensionsMarkers.size(), greaterThanOrEqual(1)); //$NON-NLS-1$
+ assertThat("Missing extension should be a warning", extensionsMarkers, hasItem(isMarkerSeverity(IMarker.SEVERITY_WARNING))); //$NON-NLS-1$
}
-} \ No newline at end of file
+}
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginXMLBuilderTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginXMLBuilderTest.java
new file mode 100644
index 00000000000..c0c4557da93
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests/src/org/eclipse/papyrus/toolsmiths/validation/elementtypes/tests/ElementTypesPluginXMLBuilderTest.java
@@ -0,0 +1,88 @@
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests;
+
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerMessage;
+import static org.eclipse.papyrus.junit.matchers.WorkspaceMatchers.isMarkerSeverity;
+import static org.eclipse.papyrus.toolsmiths.validation.elementtypes.constants.ElementTypesPluginValidationConstants.ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE;
+import static org.hamcrest.CoreMatchers.anything;
+import static org.hamcrest.CoreMatchers.both;
+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 java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.Build;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.MarkerType;
+import org.eclipse.papyrus.toolsmiths.validation.common.tests.rules.OverlayFile;
+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;
+
+/**
+ * Test cases for the <em>Element Types Configurations</em> validation of <tt>plugin.xml</tt>
+ * in the project builder.
+ */
+@TestProject("org.eclipse.papyrus.toolsmiths.validation.elementtypes.example")
+@MarkerType(ELEMENTTYPES_PLUGIN_VALIDATION_MARKER_TYPE)
+@Build
+public class ElementTypesPluginXMLBuilderTest extends AbstractPapyrusTest {
+
+ /**
+ * The project fixture to manage easily the project.
+ */
+ @Rule
+ public final TestProjectFixture fixture = new TestProjectFixture();
+
+ /**
+ * Test the reporting of a missing extension point where the extension point is just entirely missing.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-extensions/plugin-noExtension.xml", path = "plugin.xml")
+ public void noExtension() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("plugin.xml"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_WARNING)).and(isMarkerMessage(containsString("Missing extension"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the reporting of a missing client-context ID where the extension point is otherwise present.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-extensions/plugin-noClientContext.xml", path = "plugin.xml")
+ public void noClientContext() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("plugin.xml"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_ERROR)).and(isMarkerMessage(containsString("client context ID"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test that an extension that references a non-existent element types model file does not report
+ * an error from our builder because that is covered by the PDE Builder.
+ */
+ @Test
+ @OverlayFile(value = "bug569357-extensions/plugin-wrongPath.xml", path = "plugin.xml")
+ public void noSuchModelFile() {
+ final List<IMarker> modelMarkers = fixture.getMarkers("plugin.xml"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(anything())));
+ }
+
+}
diff --git a/tests/junit/plugins/toolsmiths/pom.xml b/tests/junit/plugins/toolsmiths/pom.xml
index ee847c642d6..cb36a3f827a 100755
--- a/tests/junit/plugins/toolsmiths/pom.xml
+++ b/tests/junit/plugins/toolsmiths/pom.xml
@@ -18,6 +18,7 @@
<!-- Suites -->
<module>org.eclipse.papyrus.toolsmiths.suite.tests</module>
+ <module>org.eclipse.papyrus.toolsmiths.validation.common.tests</module>
<module>org.eclipse.papyrus.toolsmiths.profilemigration.tests</module>
<module>org.eclipse.papyrus.toolsmiths.validation.profile.tests</module>
<module>org.eclipse.papyrus.toolsmiths.validation.elementtypes.tests</module>
diff --git a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/plugin.xml b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/plugin.xml
index 354ddd5db5b..9f55fb9ab8d 100644
--- a/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/plugin.xml
+++ b/tests/junit/plugins/uml/org.eclipse.papyrus.uml.service.types.tests/plugin.xml
@@ -32,14 +32,14 @@
<extension
point="org.eclipse.emf.ecore.dynamic_package">
<resource
- location="resource/UnitTest.profile.uml#_bPTI4CkMEeuEo8scjf0hcw"
+ location="pathmap://UML_SERVICE_TYPES_TESTS/UnitTest.profile.uml#_bPTI4CkMEeuEo8scjf0hcw"
uri="http://www.eclipse.org/Papyrus/2020/test/UnitTest">
</resource>
</extension>
<extension
point="org.eclipse.uml2.uml.dynamic_package">
<profile
- location="resource/UnitTest.profile.uml#_9GF5oCkLEeuEo8scjf0hcw"
+ location="pathmap://UML_SERVICE_TYPES_TESTS/UnitTest.profile.uml#_9GF5oCkLEeuEo8scjf0hcw"
uri="http://www.eclipse.org/Papyrus/2020/test/UnitTest">
</profile>
</extension>
@@ -51,11 +51,18 @@
</elementTypeSet>
</extension>
<extension
+ point="org.eclipse.emf.ecore.uri_mapping">
+ <mapping
+ source="pathmap://UML_SERVICE_TYPES_TESTS/"
+ target="platform:/plugin/org.eclipse.papyrus.uml.service.types.tests/resource/">
+ </mapping>
+ </extension>
+ <extension
point="org.eclipse.papyrus.uml.extensionpoints.UMLProfile">
<profile
description="Unit Test profile for UML Service Types tests"
name="Unit Test Profile"
- path="resource/UnitTest.profile.uml">
+ path="pathmap://UML_SERVICE_TYPES_TESTS/UnitTest.profile.uml">
</profile>
</extension>

Back to the top