Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2017-01-20 16:24:43 +0000
committerGerrit Code Review @ Eclipse.org2017-01-23 16:53:07 +0000
commita7692b73f0a9b8c9de73c46bba54d5b3d8668abd (patch)
tree1b27a6093880f98f178461298e34f8cb606b64ea /extraplugins
parent39616640315c29cbc36db90e93a1b823bb33d0e7 (diff)
downloadorg.eclipse.papyrus-a7692b73f0a9b8c9de73c46bba54d5b3d8668abd.tar.gz
org.eclipse.papyrus-a7692b73f0a9b8c9de73c46bba54d5b3d8668abd.tar.xz
org.eclipse.papyrus-a7692b73f0a9b8c9de73c46bba54d5b3d8668abd.zip
Bug 510858: [Importer][Rhapsody] Imported Rhapsody Libraries must be sorted to ease JUnit tests work
Change-Id: If2f14bdb4eddb4ffff64352445da3f752b999161 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'extraplugins')
-rwxr-xr-xextraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.blackboxes/src/org/eclipse/papyrus/migration/rhapsody/blackboxes/rhapsody/RhapsodyHelper.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.blackboxes/src/org/eclipse/papyrus/migration/rhapsody/blackboxes/rhapsody/RhapsodyHelper.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.blackboxes/src/org/eclipse/papyrus/migration/rhapsody/blackboxes/rhapsody/RhapsodyHelper.java
index 32e3d1b0a37..3a49da39c37 100755
--- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.blackboxes/src/org/eclipse/papyrus/migration/rhapsody/blackboxes/rhapsody/RhapsodyHelper.java
+++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody.blackboxes/src/org/eclipse/papyrus/migration/rhapsody/blackboxes/rhapsody/RhapsodyHelper.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.migration.rhapsody.blackboxes.rhapsody;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.List;
import org.eclipse.emf.common.util.URI;
@@ -55,6 +56,23 @@ public class RhapsodyHelper {
}
}
}
+ // we add a comparator to generate the import always in the same order (to fix trouble with Junit test)
+ subs.sort(new Comparator<ISubsystem>() {
+
+ @Override
+ public int compare(final ISubsystem o1, final ISubsystem o2) {
+ if (o1 == o2 || o1 == null || o2 == null) {
+ return 0; // should not be possible
+ }
+ final String name1 = o1.getName();
+ final String name2 = o2.getName();
+ if (name1 == null || name2 == null) {
+ return 0; // should not be possible
+ }
+ return o1.getName().compareToIgnoreCase(o2.getName());
+ }
+
+ });
return subs;
}

Back to the top