Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2021-04-28 14:02:32 -0400
committerChristian W. Damus2021-05-04 13:44:32 -0400
commita13bd677c325d68075459701a99cc08dd4a6f3ec (patch)
treee72756d091798c7c5bc4739aa78e857b2c27d14a
parent54146ca02afebe9048e59214824476b97fc10e8f (diff)
downloadorg.eclipse.papyrus-a13bd677c325d68075459701a99cc08dd4a6f3ec.tar.gz
org.eclipse.papyrus-a13bd677c325d68075459701a99cc08dd4a6f3ec.tar.xz
org.eclipse.papyrus-a13bd677c325d68075459701a99cc08dd4a6f3ec.zip
Bug 570486: [Architecture] Architecture model shall clearly define merge and inherit concepts
- warn on implicit merges Change-Id: Id9a4a1821dd985812892113a801173fba5b8fb9d Signed-off-by: Christian W. Damus <give.a.damus@gmail.com>
-rw-r--r--plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/META-INF/MANIFEST.MF1
-rw-r--r--plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/checkers/ArchitectureCustomValidator.java76
-rw-r--r--plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/Messages.java2
-rw-r--r--plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/messages.properties5
-rw-r--r--plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/internal/utils/ArchitectureIndex.java112
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-explicitMerge.xml44
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-implicitMerge.xml44
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ExplicitMergeBookStore.architecture33
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ImplicitMergeBookStore.architecture32
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration53
-rw-r--r--tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/src/org/eclipse/papyrus/toolsmiths/validation/architecture/tests/ArchitectureModelBuilderTest.java40
11 files changed, 398 insertions, 44 deletions
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/META-INF/MANIFEST.MF b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/META-INF/MANIFEST.MF
index 0de6e1ab7b3..495640be8ce 100644
--- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/META-INF/MANIFEST.MF
+++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/META-INF/MANIFEST.MF
@@ -39,3 +39,4 @@ Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.toolsmiths.validation.architecture;singleton:=true
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: org.eclipse.papyrus.toolsmiths.validation.architecture
+Import-Package: com.google.common.collect;version="[30.1.0,31.0.0)"
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/checkers/ArchitectureCustomValidator.java b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/checkers/ArchitectureCustomValidator.java
index a573926891e..aa8df738a0f 100644
--- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/checkers/ArchitectureCustomValidator.java
+++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/checkers/ArchitectureCustomValidator.java
@@ -29,10 +29,15 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.papyrus.infra.core.architecture.ADElement;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureContext;
+import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain;
import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureViewpoint;
+import org.eclipse.papyrus.infra.core.architecture.Concern;
import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
+import org.eclipse.papyrus.infra.core.architecture.Stakeholder;
+import org.eclipse.papyrus.infra.core.architecture.util.ArchitectureSwitch;
import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration;
import org.eclipse.papyrus.infra.types.core.extensionpoints.IElementTypeSetExtensionPoint;
import org.eclipse.papyrus.toolsmiths.validation.architecture.internal.messages.Messages;
@@ -47,10 +52,16 @@ public class ArchitectureCustomValidator extends CustomModelChecker.SwitchValida
private static final String ELEM_ELEMENT_TYPE_SET = "elementTypeSet"; //$NON-NLS-1$
+ private final ArchitectureSwitch<Boolean> explicitMergeTester = new ExplicitMergeTester();
+
public ArchitectureCustomValidator(String nsURI) {
super(nsURI);
}
+ public void validate(ADElement element, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ validateImplicitMerge(element, diagnostics, context);
+ }
+
public void validate(RepresentationKind representation, DiagnosticChain diagnostics, Map<Object, Object> context) {
validateRepresentationKindUsed(representation, diagnostics, context);
}
@@ -73,7 +84,7 @@ public class ArchitectureCustomValidator extends CustomModelChecker.SwitchValida
private void validateRepresentationKindUsed(RepresentationKind representation, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (!findArchitectureContextReference(representation)) {
- diagnostics.add(createDiagnostic(Diagnostic.WARNING, representation, format("No viewpoint includes ''{0}'', so it is not accessible.", context, representation)));
+ diagnostics.add(createDiagnostic(Diagnostic.WARNING, representation, format(Messages.ArchitectureCustomValidator_3, context, representation)));
}
}
@@ -116,4 +127,67 @@ public class ArchitectureCustomValidator extends CustomModelChecker.SwitchValida
return result;
}
+
+ private void validateImplicitMerge(ADElement element, DiagnosticChain diagnostics, Map<Object, Object> context) {
+ String name = element.getQualifiedName();
+ if (name != null // Otherwise, that's a different problem reported separately
+ && !isExplicitlyMerged(element)) { // We're only checking for accidental implicit merges
+ Collection<ADElement> all = ArchitectureIndex.getInstance().getElementsByQualifiedName(element.eClass(), element.getQualifiedName());
+ if (all.size() > 1) {
+ diagnostics.add(createDiagnostic(Diagnostic.WARNING, element, format(Messages.ArchitectureCustomValidator_4, context, element)));
+ }
+ }
+ }
+
+ private boolean isExplicitlyMerged(ADElement element) {
+ return explicitMergeTester.doSwitch(element);
+ }
+
+ boolean hasSpecializations(ArchitectureContext context) {
+ return ArchitectureIndex.getInstance().isReferenced(context, ArchitecturePackage.Literals.ARCHITECTURE_CONTEXT__GENERAL_CONTEXT);
+ }
+
+ boolean hasExtensions(ArchitectureContext context) {
+ return ArchitectureIndex.getInstance().isReferenced(context, ArchitecturePackage.Literals.ARCHITECTURE_CONTEXT__EXTENDED_CONTEXTS);
+ }
+
+ //
+ // Nested types
+ //
+
+ private final class ExplicitMergeTester extends ArchitectureSwitch<Boolean> {
+
+ @Override
+ public Boolean defaultCase(EObject object) {
+ return false;
+ }
+
+ @Override
+ public Boolean caseArchitectureContext(ArchitectureContext object) {
+ return object.getGeneralContext() != null || object.isExtension()
+ || hasSpecializations(object) || hasExtensions(object);
+ }
+
+ @Override
+ public Boolean caseArchitectureDomain(ArchitectureDomain object) {
+ return object.getContexts().stream().anyMatch(this::doSwitch);
+ }
+
+ @Override
+ public Boolean caseConcern(Concern object) {
+ return object.getDomain() != null && doSwitch(object.getDomain());
+ }
+
+ @Override
+ public Boolean caseStakeholder(Stakeholder object) {
+ return object.getDomain() != null && doSwitch(object.getDomain());
+ }
+
+ @Override
+ public Boolean caseArchitectureViewpoint(ArchitectureViewpoint object) {
+ return object.getContext() != null && doSwitch(object.getContext());
+ }
+
+ }
+
}
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/Messages.java b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/Messages.java
index 3ba68cf49f6..68c4375484c 100644
--- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/Messages.java
+++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/Messages.java
@@ -23,6 +23,8 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.papyrus.toolsmiths.validation.architecture.internal.messages.messages"; //$NON-NLS-1$
public static String ArchitectureCustomValidator_2;
+ public static String ArchitectureCustomValidator_3;
+ public static String ArchitectureCustomValidator_4;
public static String ArchitecturePluginChecker_0;
public static String ArchitecturePluginChecker_1;
public static String MissingArchitectureExtension_0;
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/messages.properties b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/messages.properties
index b8af02b6977..8b3bebe222b 100644
--- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/messages.properties
+++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.architecture/src/org/eclipse/papyrus/toolsmiths/validation/architecture/internal/messages/messages.properties
@@ -10,11 +10,14 @@
#
# Contributors:
# CEA LIST - Initial API and implementation
-# Christian W. Damus - bugs 570097, 542945
+# Christian W. Damus - bugs 570097, 542945, 570486
#
##################################################################################
ArchitectureCustomValidator_2=''{0}'' is registered to a different context.
+ArchitectureCustomValidator_3=No viewpoint includes ''{0}'', so it is not accessible.
+ArchitectureCustomValidator_4={0} will be merged implicitly with another registered under the same qualified name. \
+ Prefer explicit context extension or inheritance.
ArchitecturePluginChecker_0=Validate Architecture plug-in
ArchitecturePluginChecker_1=Prepare plug-in validation
MissingArchitectureExtension_0=Register architecture model
diff --git a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/internal/utils/ArchitectureIndex.java b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/internal/utils/ArchitectureIndex.java
index 818e8cffbff..a18c8dc4411 100644
--- a/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/internal/utils/ArchitectureIndex.java
+++ b/plugins/toolsmiths/validation/org.eclipse.papyrus.toolsmiths.validation.common/src/org/eclipse/papyrus/toolsmiths/validation/common/internal/utils/ArchitectureIndex.java
@@ -17,6 +17,7 @@ package org.eclipse.papyrus.toolsmiths.validation.common.internal.utils;
import java.util.Collection;
import java.util.EnumMap;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
@@ -30,6 +31,7 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -40,11 +42,13 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.papyrus.infra.architecture.ArchitectureDomainManager;
import org.eclipse.papyrus.infra.core.architecture.ADElement;
import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain;
+import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage;
import org.eclipse.papyrus.infra.core.utils.JobExecutorService;
import org.eclipse.papyrus.infra.emf.utils.InternalCrossReferencer;
import org.eclipse.papyrus.toolsmiths.validation.common.Activator;
import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
/**
@@ -63,6 +67,11 @@ public class ArchitectureIndex {
Mode.EXTERNAL_CROSS_REFERENCE, new Computation<>(this::computeExternalCrossReferences),
Mode.INTERNAL_CROSS_REFERENCE, new Computation<>(this::computeInternalCrossReferences)));
+ private final Map<EClass, Computation<Multimap<String, ADElement>>> elementsByQualifiedName = ArchitecturePackage.eINSTANCE.getEClassifiers().stream()
+ .filter(EClass.class::isInstance).map(EClass.class::cast)
+ .filter(ArchitecturePackage.Literals.AD_ELEMENT::isSuperTypeOf)
+ .collect(Collectors.toMap(Function.identity(), eClass -> new Computation<>(() -> computeQualifiedNameMap(eClass))));
+
/**
* Not instantiable by clients.
*/
@@ -143,6 +152,7 @@ public class ArchitectureIndex {
*/
private void domainManagerChanged() {
crossReferences.values().forEach(Computation::reset);
+ elementsByQualifiedName.values().forEach(Computation::reset);
}
/**
@@ -301,6 +311,108 @@ public class ArchitectureIndex {
return getCrossReferences(crossReferenceMode).thenApply(isReferenced::test);
}
+ /**
+ * Obtain a mapping of instances of the given {@link EClass} by name.
+ *
+ * @param <T>
+ * the type of elements requested, according to the given {@link EClass}
+ * @param eClass
+ * the {@link EClass} of elements for which to get the name map. It should conform to
+ * {@link ArchitecturePackage.Literals#AD_ELEMENT ADElement} to be useful
+ * @return the name map, which may be empty, especially in the case that the requested {@link EClass} is of an inapplicable type
+ *
+ * @see #getElementsByQualifiedNameAsync(EClass, String)
+ * @see #getElementsByName(EClass, String)
+ */
+ public <T extends ADElement> CompletableFuture<Multimap<String, T>> getElementsByQualifiedName(EClass eClass) {
+ if (ArchitecturePackage.Literals.AD_ELEMENT.isSuperTypeOf(eClass)) {
+ // The actual EClass may not be one from the Architecture Package that we have enumerated
+ eClass = findArchitectureEClass(eClass);
+ if (eClass != null) {
+ // The maps computed are immutable, so the cast is safe because we know a priori that all
+ // elements of the map conform and none can be added
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ CompletableFuture<Multimap<String, T>> result = (CompletableFuture) elementsByQualifiedName.get(eClass).get();
+ return result;
+ }
+ }
+
+ return CompletableFuture.completedFuture(ImmutableMultimap.of());
+ }
+
+ private EClass findArchitectureEClass(EClass eClass) {
+ if (eClass.getEPackage() == ArchitecturePackage.eINSTANCE) {
+ return eClass;
+ }
+ for (EClass next : eClass.getEAllSuperTypes()) {
+ if (next.getEPackage() == ArchitecturePackage.eINSTANCE) {
+ return next;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Obtain the instances of the given {@link EClass} having some qualified {@code name}.
+ *
+ * @param <T>
+ * the type of elements requested, according to the given {@link EClass}
+ * @param eClass
+ * the {@link EClass} of elements to query. It should conform to
+ * {@link ArchitecturePackage.Literals#AD_ELEMENT ADElement} to be useful
+ * @param name
+ * the qualified name to search for
+ * @return the elements having the given qualified {@code name}
+ *
+ * @see #getElementsByName(EClass)
+ * @see #getElementsByQualifiedNameAsync(EClass, String)
+ */
+ public <T extends ADElement> Collection<T> getElementsByQualifiedName(EClass eClass, String name) {
+ Collection<T> result;
+
+ try {
+ result = this.<T> getElementsByQualifiedNameAsync(eClass, name).get();
+ } catch (ExecutionException | InterruptedException e) {
+ // Cannot access the architecture index? Then we didn't find anything
+ Activator.log.error("Error querying Architecture Context models.", e); //$NON-NLS-1$
+ result = List.of();
+ }
+
+ return result;
+ }
+
+ /**
+ * Obtain the instances of the given {@link EClass} having some qualified {@code name}.
+ *
+ * @param <T>
+ * the type of elements requested, according to the given {@link EClass}
+ * @param eClass
+ * the {@link EClass} of elements to query. It should conform to
+ * {@link ArchitecturePackage.Literals#AD_ELEMENT ADElement} to be useful
+ * @param name
+ * the qualified name to search for
+ * @return the elements having the given qualified {@code name}
+ *
+ * @see #getElementsByName(EClass)
+ * @see #getElementsByQualifiedName(EClass, String)
+ */
+ public <T extends ADElement> CompletableFuture<Collection<T>> getElementsByQualifiedNameAsync(EClass eClass, String name) {
+ return this.<T> getElementsByQualifiedName(eClass).thenApply(map -> map.get(name));
+ }
+
+ private Multimap<String, ADElement> computeQualifiedNameMap(EClass eClass) {
+ ImmutableListMultimap.Builder<String, ADElement> result = ImmutableListMultimap.builder();
+
+ EcoreUtil.getAllContents(ArchitectureDomainManager.getInstance().getRegisteredArchitectureDomains()).forEachRemaining(object -> {
+ if (eClass.isInstance(object)) {
+ ADElement element = (ADElement) object;
+ result.put(element.getQualifiedName(), element);
+ }
+ });
+
+ return result.build();
+ }
+
//
// Nested types
//
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-explicitMerge.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-explicitMerge.xml
new file mode 100644
index 00000000000..919d127a4b8
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-explicitMerge.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2021 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.dynamic_package">
+ <resource
+ uri="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore"
+ location="resources/BookStore.profile.uml#_e24cAVG7EeuXzM4mqVly4g">
+ </resource>
+ </extension>
+ <extension
+ point="org.eclipse.uml2.uml.dynamic_package">
+ <profile
+ uri="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore"
+ location="resources/BookStore.profile.uml#_gnO0wFG6EeuXzM4mqVly4g">
+ </profile>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.architecture.models">
+ <model
+ path="resources/BookStore.architecture">
+ </model>
+ <model
+ path="resources/ExplicitMergeBookStore.architecture">
+ </model>
+ </extension>
+
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-implicitMerge.xml b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-implicitMerge.xml
new file mode 100644
index 00000000000..0e93e969d32
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/plugin-implicitMerge.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2021 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.dynamic_package">
+ <resource
+ uri="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore"
+ location="resources/BookStore.profile.uml#_e24cAVG7EeuXzM4mqVly4g">
+ </resource>
+ </extension>
+ <extension
+ point="org.eclipse.uml2.uml.dynamic_package">
+ <profile
+ uri="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore"
+ location="resources/BookStore.profile.uml#_gnO0wFG6EeuXzM4mqVly4g">
+ </profile>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.architecture.models">
+ <model
+ path="resources/BookStore.architecture">
+ </model>
+ <model
+ path="resources/ImplicitMergeBookStore.architecture">
+ </model>
+ </extension>
+
+</plugin>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ExplicitMergeBookStore.architecture b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ExplicitMergeBookStore.architecture
new file mode 100644
index 00000000000..8d932a5bf07
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ExplicitMergeBookStore.architecture
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<architecture:ArchitectureDomain xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:gmfdiagrepresentation="http://www.eclipse.org/papyrus/infra/gmfdiag/representation" xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.8" xmlns:representation="http://www.eclipse.org/papyrus/infra/core/architecture/representation" xmi:id="_W0vj0FG2EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstore" name="BookStore" description="Example architecture domain for testing: a book store modeling language." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png">
+ <stakeholders xmi:type="architecture:Stakeholder" xmi:id="_zYz54FG5EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookvendor" name="Book Vendor" description="A seeler of books, in a bookstore." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/book_vendor.png" concerns="_95r3oFG5EeuXzM4mqVly4g"/>
+ <concerns xmi:type="architecture:Concern" xmi:id="_95r3oFG5EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookselling" name="Book Selling" description="The concern of selling books, in a book store." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png"/>
+ <contexts xmi:type="architecture:ArchitectureDescriptionLanguage" xmi:id="_Ty_tQFG6EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstorelang" name="BookStore" icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png" defaultViewpoints="_fnEJgFHAEeuwtJo37XL9OQ" extensionPrefix="bookstore" creationCommandClass="org.eclipse.papyrus.toolsmiths.validation.architecture.example.internal.commands.CreateBookstoreModelCommand">
+ <viewpoints xmi:type="architecture:ArchitectureViewpoint" xmi:id="_fnEJgFHAEeuwtJo37XL9OQ" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstoremanagement" name="BookStore Management" description="The viewpoint of the book store manager who needs to track inventory." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/book_vendor.png" concerns="_95r3oFG5EeuXzM4mqVly4g" representationKinds="_u1T1UFHAEeuwtJo37XL9OQ"/>
+ <elementTypes xmi:type="elementtypesconfigurations:ElementTypeSetConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_c0DGsGBhEemoFuWBTUmJOQ"/>
+ <extendedContexts xmi:type="architecture:ArchitectureDescriptionLanguage" href="BookStore.architecture#_Ty_tQFG6EeuXzM4mqVly4g"/>
+ <representationKinds xmi:type="gmfdiagrepresentation:PapyrusDiagram" xmi:id="_u1T1UFHAEeuwtJo37XL9OQ" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.process" name="ProcessDiagram" description="Book store process diagram." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png" concerns="_95r3oFG5EeuXzM4mqVly4g" grayedIcon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore_d.png" implementationID="org.eclipse.papyrus.toolsmiths.validation.architecture.example.ProcessDiagram" creationCommandClass="org.eclipse.papyrus.toolsmiths.validation.architecture.example.internal.commands.CreateProcessDiagramCommand">
+ <modelRules xmi:type="representation:ModelRule" xmi:id="__8BXQFHDEeuwtJo37XL9OQ" permit="true" elementMultiplicity="1" multiplicity="-1">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cBFG7EeuXzM4mqVly4g"/>
+ </modelRules>
+ <owningRules xmi:type="representation:OwningRule" xmi:id="_GnAokFHEEeuwtJo37XL9OQ" permit="true" multiplicity="-1">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cBFG7EeuXzM4mqVly4g"/>
+ </owningRules>
+ <childRules xmi:type="gmfdiagrepresentation:ChildRule" xmi:id="_LyaWcFHEEeuwtJo37XL9OQ" permit="true">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cDFG7EeuXzM4mqVly4g"/>
+ <origin xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </childRules>
+ <childRules xmi:type="gmfdiagrepresentation:ChildRule" xmi:id="_TjwL0FHEEeuwtJo37XL9OQ" permit="true">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cCFG7EeuXzM4mqVly4g"/>
+ <origin xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </childRules>
+ <palettes xmi:type="paletteconfiguration:PaletteConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration#/"/>
+ </representationKinds>
+ <metamodel xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
+ <profiles xmi:type="ecore:EPackage" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cAVG7EeuXzM4mqVly4g"/>
+ </contexts>
+</architecture:ArchitectureDomain>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ImplicitMergeBookStore.architecture b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ImplicitMergeBookStore.architecture
new file mode 100644
index 00000000000..0d3eccc94f5
--- /dev/null
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/bug570486-models/resources/ImplicitMergeBookStore.architecture
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<architecture:ArchitectureDomain xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:gmfdiagrepresentation="http://www.eclipse.org/papyrus/infra/gmfdiag/representation" xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.8" xmlns:representation="http://www.eclipse.org/papyrus/infra/core/architecture/representation" xmi:id="_W0vj0FG2EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstore" name="BookStore" description="Example architecture domain for testing: a book store modeling language." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png">
+ <stakeholders xmi:type="architecture:Stakeholder" xmi:id="_zYz54FG5EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookvendor" name="Book Vendor" description="A seeler of books, in a bookstore." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/book_vendor.png" concerns="_95r3oFG5EeuXzM4mqVly4g"/>
+ <concerns xmi:type="architecture:Concern" xmi:id="_95r3oFG5EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookselling" name="Book Selling" description="The concern of selling books, in a book store." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png"/>
+ <contexts xmi:type="architecture:ArchitectureDescriptionLanguage" xmi:id="_Ty_tQFG6EeuXzM4mqVly4g" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstorelang" name="BookStore" icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png" defaultViewpoints="_fnEJgFHAEeuwtJo37XL9OQ" extensionPrefix="bookstore" creationCommandClass="org.eclipse.papyrus.toolsmiths.validation.architecture.example.internal.commands.CreateBookstoreModelCommand">
+ <viewpoints xmi:type="architecture:ArchitectureViewpoint" xmi:id="_fnEJgFHAEeuwtJo37XL9OQ" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.bookstoremanagement" name="BookStore Management" description="The viewpoint of the book store manager who needs to track inventory." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/book_vendor.png" concerns="_95r3oFG5EeuXzM4mqVly4g" representationKinds="_u1T1UFHAEeuwtJo37XL9OQ"/>
+ <elementTypes xmi:type="elementtypesconfigurations:ElementTypeSetConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_c0DGsGBhEemoFuWBTUmJOQ"/>
+ <representationKinds xmi:type="gmfdiagrepresentation:PapyrusDiagram" xmi:id="_u1T1UFHAEeuwtJo37XL9OQ" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.process" name="ProcessDiagram" description="Book store process diagram." icon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore.png" concerns="_95r3oFG5EeuXzM4mqVly4g" grayedIcon="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/icons/full/obj16/bookstore_d.png" implementationID="org.eclipse.papyrus.toolsmiths.validation.architecture.example.ProcessDiagram" creationCommandClass="org.eclipse.papyrus.toolsmiths.validation.architecture.example.internal.commands.CreateProcessDiagramCommand">
+ <modelRules xmi:type="representation:ModelRule" xmi:id="__8BXQFHDEeuwtJo37XL9OQ" permit="true" elementMultiplicity="1" multiplicity="-1">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cBFG7EeuXzM4mqVly4g"/>
+ </modelRules>
+ <owningRules xmi:type="representation:OwningRule" xmi:id="_GnAokFHEEeuwtJo37XL9OQ" permit="true" multiplicity="-1">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cBFG7EeuXzM4mqVly4g"/>
+ </owningRules>
+ <childRules xmi:type="gmfdiagrepresentation:ChildRule" xmi:id="_LyaWcFHEEeuwtJo37XL9OQ" permit="true">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cDFG7EeuXzM4mqVly4g"/>
+ <origin xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </childRules>
+ <childRules xmi:type="gmfdiagrepresentation:ChildRule" xmi:id="_TjwL0FHEEeuwtJo37XL9OQ" permit="true">
+ <element xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ <stereotypes xmi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cCFG7EeuXzM4mqVly4g"/>
+ <origin xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package"/>
+ </childRules>
+ <palettes xmi:type="paletteconfiguration:PaletteConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration#/"/>
+ </representationKinds>
+ <metamodel xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
+ <profiles xmi:type="ecore:EPackage" href="http://www.eclipse.org/Papyrus/test/toolsmiths/architecturebuilder/BookStore#_e24cAVG7EeuXzM4mqVly4g"/>
+ </contexts>
+</architecture:ArchitectureDomain>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration
index 105e341690c..811e0da385e 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/resources/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.paletteconfiguration
@@ -1,48 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<paletteconfiguration:PaletteConfiguration
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2"
- xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.8"
- id="bookstore_1610122179627"
- label="Book Store">
- <drawerConfigurations
- xmi:type="paletteconfiguration:DrawerConfiguration"
- id="Default_1610122179627"
- label="Book Store">
- <icon xmi:type="paletteconfiguration:IconDescriptor"
- pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example"
- iconPath="/icons/full/obj16/bookstore.png"/>
- <ownedConfigurations
- xmi:type="paletteconfiguration:ToolConfiguration"
- id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.book"
- label="Book"
- kind="CreationTool">
- <icon
- xmi:type="paletteconfiguration:IconDescriptor"
- pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example"
- iconPath="/icons/full/obj16/bookstore.png"/>
- <elementDescriptors
- xmi:type="paletteconfiguration:ElementDescriptor">
- <elementType
- xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration"
- href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_fen2kGBhEemoFuWBTUmJOQ"/>
+<paletteconfiguration:PaletteConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.8" id="bookstore_1610122179627" label="Book Store">
+ <drawerConfigurations xmi:type="paletteconfiguration:DrawerConfiguration" id="Default_1610122179627" label="Book Store">
+ <icon xmi:type="paletteconfiguration:IconDescriptor" pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example" iconPath="/icons/full/obj16/bookstore.png"/>
+ <ownedConfigurations xmi:type="paletteconfiguration:ToolConfiguration" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.book" label="Book" kind="CreationTool">
+ <icon xmi:type="paletteconfiguration:IconDescriptor" pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example" iconPath="/icons/full/obj16/bookstore.png"/>
+ <elementDescriptors xmi:type="paletteconfiguration:ElementDescriptor">
+ <elementType xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_fen2kGBhEemoFuWBTUmJOQ"/>
</elementDescriptors>
</ownedConfigurations>
- <ownedConfigurations
- xmi:type="paletteconfiguration:ToolConfiguration"
- id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.vendor"
- label="Vendor"
- kind="CreationTool">
- <icon
- xmi:type="paletteconfiguration:IconDescriptor"
- pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example"
- iconPath="/icons/full/obj16/book_vendorpng"/>
- <elementDescriptors
- xmi:type="paletteconfiguration:ElementDescriptor">
- <elementType
- xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration"
- href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_IIVLAFG8EeuXzM4mqVly4g"/>
+ <ownedConfigurations xmi:type="paletteconfiguration:ToolConfiguration" id="org.eclipse.papyrus.toolsmiths.validation.architecture.example.vendor" label="Vendor" kind="CreationTool">
+ <icon xmi:type="paletteconfiguration:IconDescriptor" pluginID="org.eclipse.papyrus.toolsmiths.validation.architecture.example" iconPath="/icons/full/obj16/book_vendorpng"/>
+ <elementDescriptors xmi:type="paletteconfiguration:ElementDescriptor">
+ <elementType xmi:type="elementtypesconfigurations:SpecializationTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.toolsmiths.validation.architecture.example/resources/BookStore.elementtypesconfigurations#_IIVLAFG8EeuXzM4mqVly4g"/>
</elementDescriptors>
</ownedConfigurations>
</drawerConfigurations>
diff --git a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/src/org/eclipse/papyrus/toolsmiths/validation/architecture/tests/ArchitectureModelBuilderTest.java b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/src/org/eclipse/papyrus/toolsmiths/validation/architecture/tests/ArchitectureModelBuilderTest.java
index 19397046e25..48cee2452ed 100644
--- a/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/src/org/eclipse/papyrus/toolsmiths/validation/architecture/tests/ArchitectureModelBuilderTest.java
+++ b/tests/junit/plugins/toolsmiths/org.eclipse.papyrus.toolsmiths.validation.architecture.tests/src/org/eclipse/papyrus/toolsmiths/validation/architecture/tests/ArchitectureModelBuilderTest.java
@@ -191,6 +191,46 @@ public class ArchitectureModelBuilderTest extends AbstractPapyrusTest {
assertThat(modelMarkers, not(hasItem(isMarkerMessage(containsString("No viewpoint includes"))))); //$NON-NLS-1$
}
+ /**
+ * Test the reporting of an implicitly merged context.
+ *
+ * @see <a href="http://eclip.se/570486">bug 570486</a>
+ */
+ @Test
+ @OverlayFile("bug570486-models/resources/ImplicitMergeBookStore.architecture")
+ @OverlayFile(value = "bug570486-models/plugin-implicitMerge.xml", path = "plugin.xml")
+ public void implicitMergeWarning() {
+ List<IMarker> modelMarkers = fixture.getMarkers("resources/ImplicitMergeBookStore.architecture"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_WARNING)).and(
+ isMarkerMessage(containsString("will be merged implicitly"))))); //$NON-NLS-1$
+
+ // Same applies to the other, also
+ modelMarkers = fixture.getMarkers("resources/BookStore.architecture"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, hasItem(both(isMarkerSeverity(IMarker.SEVERITY_WARNING)).and(
+ isMarkerMessage(containsString("will be merged implicitly"))))); //$NON-NLS-1$
+ }
+
+ /**
+ * Test that an explicitly merged context does not report any warning even when it matches some other registered
+ * context by name.
+ *
+ * @see <a href="http://eclip.se/570486">bug 570486</a>
+ */
+ @Test
+ @OverlayFile("bug570486-models/resources/ExplicitMergeBookStore.architecture")
+ @OverlayFile(value = "bug570486-models/plugin-explicitMerge.xml", path = "plugin.xml")
+ public void explicitMergeNotWarned() {
+ List<IMarker> modelMarkers = fixture.getMarkers("resources/BookStore.architecture"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(isMarkerMessage(containsString("will be merged implicitly"))))); //$NON-NLS-1$
+
+ // Same applies to the other, also
+ modelMarkers = fixture.getMarkers("resources/BookStore.architecture"); //$NON-NLS-1$
+
+ assertThat(modelMarkers, not(hasItem(isMarkerMessage(containsString("will be merged implicitly"))))); //$NON-NLS-1$
+ }
}
}

Back to the top