Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Daussy2014-07-01 11:29:29 -0400
committerMikael Barbero2014-07-07 08:26:07 -0400
commit4c60210fd4816f1923d4c48826941d2caf5792ef (patch)
treeea4565f91b01e5fb5d524f7aed52c223b7b1c1bb /plugins/org.eclipse.emf.compare.uml2.tests
parent6474b03e2bb42855895d4a0736451d1aabc16b08 (diff)
downloadorg.eclipse.emf.compare-4c60210fd4816f1923d4c48826941d2caf5792ef.tar.gz
org.eclipse.emf.compare-4c60210fd4816f1923d4c48826941d2caf5792ef.tar.xz
org.eclipse.emf.compare-4c60210fd4816f1923d4c48826941d2caf5792ef.zip
Test integration of profiles in EMF Compare.
Adds two tests to test the display of static and dynamic profile in EMF Compare. Change-Id: Ide7245bf03651e1850b481cd6b39183ef6b25902 Signed-off-by: Arthur Daussy <arthur.daussy@obeo.fr>
Diffstat (limited to 'plugins/org.eclipse.emf.compare.uml2.tests')
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/edit/provider/StereotypedElementItemProviderTestUtil.java19
2 files changed, 17 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
index d499ab301..15d2bcc3b 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Export-Package: org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile
org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl,
org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.provider,
org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.util,
- org.eclipse.emf.compare.uml2.tests
+ org.eclipse.emf.compare.uml2.tests,
+ org.eclipse.emf.compare.uml2.tests.edit.provider
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.uml2.uml;bundle-version="5.0.0";visibility:=reexport,
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/edit/provider/StereotypedElementItemProviderTestUtil.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/edit/provider/StereotypedElementItemProviderTestUtil.java
index 9823ce6cc..70bf7b55f 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/edit/provider/StereotypedElementItemProviderTestUtil.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/edit/provider/StereotypedElementItemProviderTestUtil.java
@@ -37,7 +37,9 @@ import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.Stereotype;
/**
- * Util class for testing the {@link org.eclipse.emf.compare.uml2.internal.provider.decorator.UMLProfileItemProviderAdapterFactoryDecorator}.
+ * Util class for testing the
+ * {@link org.eclipse.emf.compare.uml2.internal.provider.decorator.UMLProfileItemProviderAdapterFactoryDecorator}
+ * .
*
* @author <a href="mailto:arthur.daussy@obeo.fr">Arthur Daussy</a>
*/
@@ -70,8 +72,7 @@ public class StereotypedElementItemProviderTestUtil {
assertEquals(1, actualIcons.size());
assertEquals(
"Wrong icon for stereotypes :" + generateExpectedIconKey(appliedStereotypes), //$NON-NLS-1$
- getExpectedIcon(appliedStereotypes, expectedStaticIcons), actualIcons
- .get(0));
+ getExpectedIcon(appliedStereotypes, expectedStaticIcons), actualIcons.get(0));
} else {
assertNotNull(itemLabelProvider);
assertTrue("Wrong item provider for object " + itemLabelProvider.getText(eObject), //$NON-NLS-1$
@@ -95,7 +96,17 @@ public class StereotypedElementItemProviderTestUtil {
return Joiner.on(',').join(Iterables.transform(stereotypes, TO_NAME_FUNCTION));
}
- private static List<String> getIconsLocation(Object icon) {
+ /**
+ * Retrieves the name of each icon from the object returned by an item provider.
+ * <p>
+ * The name of an icon is only the last segment of its full path location
+ * </p>
+ *
+ * @param icon
+ * Object returned by the {@link org.eclipse.emf.edit.provider.ItemProvider#getImage()} method.
+ * @return A list of name of icon.
+ */
+ public static List<String> getIconsLocation(Object icon) {
final List<String> result = Lists.newArrayList();
if (icon instanceof ComposedImage) {
for (Object image : ((ComposedImage)icon).getImages()) {

Back to the top