Skip to content

Commit 3f5ed20

Browse files
committed
update for release 1.3.4
1 parent a74e0b5 commit 3f5ed20

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.espirit.moddev</groupId>
77
<artifactId>basicworkflows</artifactId>
8-
<version>1.3.2</version>
8+
<version>1.3.4</version>
99
<packaging>jar</packaging>
1010
<name>${project.displayName}</name>
1111
<inceptionYear>2018</inceptionYear>

src/main/java/com/espirit/moddev/basicworkflows/util/StoreComparator.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,24 @@ public int compare(final Object o1, final Object o2) {
4949
}
5050
final Type type1 = storeElement1.getStore().getType();
5151
final Type type2 = storeElement2.getStore().getType();
52-
if (isPageStoreObject(type1)) {
53-
if (isPageStoreObject(type2)) {
52+
// MediaStoreObject < PageStoreObject < SiteStoreObject < others
53+
if (isMediaStoreObject(type1)) {
54+
if (isMediaStoreObject(type2)) {
5455
return 0;
5556
} else {
5657
return -1;
5758
}
58-
} else {
59-
if (isPageStoreObject(type2)) {
59+
} else if (isPageStoreObject(type1)) {
60+
if (isMediaStoreObject(type2)) {
61+
return 1;
62+
}
63+
else if (isPageStoreObject(type2)) {
64+
return 0;
65+
} else {
66+
return -1;
67+
}
68+
} else {
69+
if (isMediaStoreObject(type2) || isPageStoreObject(type2)) {
6070
return 1;
6171
} else if (isSiteStoreObject(type2)) {
6272
return 0;
@@ -66,6 +76,9 @@ public int compare(final Object o1, final Object o2) {
6676
}
6777
}
6878

79+
private boolean isMediaStoreObject(final Type type) {
80+
return type == Store.Type.MEDIASTORE;
81+
}
6982

7083
private boolean isPageStoreObject(final Type type) {
7184
return type == Store.Type.PAGESTORE;

src/test/java/com/espirit/moddev/basicworkflows/util/StoreComparatorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testStoreComparator() throws Exception {
4242

4343
Collections.sort(releaseObjects, new StoreComparator());
4444

45-
assertEquals(Store.Type.PAGESTORE, releaseObjects.get(0).getStore().getType());
46-
assertEquals(Store.Type.PAGESTORE, releaseObjects.get(1).getStore().getType());
47-
assertEquals(Store.Type.SITESTORE, releaseObjects.get(2).getStore().getType());
48-
assertEquals(Store.Type.SITESTORE, releaseObjects.get(3).getStore().getType());
49-
assertEquals(Store.Type.MEDIASTORE, releaseObjects.get(4).getStore().getType());
50-
assertEquals(Store.Type.MEDIASTORE, releaseObjects.get(5).getStore().getType());
45+
assertEquals(Store.Type.MEDIASTORE, releaseObjects.get(0).getStore().getType());
46+
assertEquals(Store.Type.MEDIASTORE, releaseObjects.get(1).getStore().getType());
47+
assertEquals(Store.Type.PAGESTORE, releaseObjects.get(2).getStore().getType());
48+
assertEquals(Store.Type.PAGESTORE, releaseObjects.get(3).getStore().getType());
49+
assertEquals(Store.Type.SITESTORE, releaseObjects.get(4).getStore().getType());
50+
assertEquals(Store.Type.SITESTORE, releaseObjects.get(5).getStore().getType());
5151
}
5252

5353

0 commit comments

Comments
 (0)