james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject james-project git commit: JAMES-2046 getMessageList sort use sentDate and not internal date
Date Mon, 05 Jun 2017 03:07:56 GMT
Repository: james-project
Updated Branches:
  refs/heads/master a34bc332e -> b432e3c41


JAMES-2046 getMessageList sort use sentDate and not internal date


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/b432e3c4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b432e3c4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b432e3c4

Branch: refs/heads/master
Commit: b432e3c41a8b874b9a2f307d2fe95a8847629725
Parents: a34bc33
Author: Luc DUZAN <lduzan@linagora.com>
Authored: Fri Jun 2 15:28:50 2017 +0200
Committer: Luc DUZAN <lduzan@linagora.com>
Committed: Fri Jun 2 15:28:50 2017 +0200

----------------------------------------------------------------------
 .../jmap/methods/integration/GetMessageListMethodTest.java   | 6 +++---
 .../main/java/org/apache/james/jmap/utils/SortConverter.java | 2 +-
 .../java/org/apache/james/jmap/utils/SortConverterTest.java  | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b432e3c4/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
index c455813..b166420 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/GetMessageListMethodTest.java
@@ -807,9 +807,9 @@ public abstract class GetMessageListMethodTest {
 
         LocalDate date = LocalDate.now();
         ComposedMessageId message1 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE,
username, "mailbox"),
-                new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)),
false, new Flags());
+                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 13:54:59 +0200\r\nSubject:
test\r\n\r\ntestmail".getBytes()), convertToDate(date.plusDays(1)), false, new Flags());
         ComposedMessageId message2 = mailboxProbe.appendMessage(username, new MailboxPath(MailboxConstants.USER_NAMESPACE,
username, "mailbox"),
-                new ByteArrayInputStream("Subject: test2\r\n\r\ntestmail".getBytes()), convertToDate(date),
false, new Flags());
+                new ByteArrayInputStream("Date: Fri, 02 Jun 2017 14:54:59 +0200\r\nSubject:
test2\r\n\r\ntestmail".getBytes()), convertToDate(date), false, new Flags());
         await();
 
         given()
@@ -820,7 +820,7 @@ public abstract class GetMessageListMethodTest {
         .then()
             .statusCode(200)
             .body(NAME, equalTo("messageList"))
-            .body(ARGUMENTS + ".messageIds", contains(message2.getMessageId().serialize(),
message1.getMessageId().serialize()));
+            .body(ARGUMENTS + ".messageIds", contains(message1.getMessageId().serialize(),
message2.getMessageId().serialize()));
     }
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/b432e3c4/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortConverter.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortConverter.java
b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortConverter.java
index f9e2020..2a97f46 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortConverter.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortConverter.java
@@ -36,7 +36,7 @@ public class SortConverter {
     private static final String ASC_ORDERING = "asc";
 
     private static final Map<String, SearchQuery.Sort.SortClause> SORT_CLAUSE_MAP =
ImmutableMap.of(
-        "date", SearchQuery.Sort.SortClause.Arrival,
+        "date", SearchQuery.Sort.SortClause.SentDate,
         "id", SearchQuery.Sort.SortClause.Id);
 
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/b432e3c4/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortConverterTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortConverterTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortConverterTest.java
index eb79e61..b30aeb2 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortConverterTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortConverterTest.java
@@ -72,7 +72,7 @@ public class SortConverterTest {
     @Test
     public void convertToSortsShouldSupportDate() {
         assertThat(SortConverter.convertToSorts(ImmutableList.of("date desc")))
-            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.Arrival, REVERSE));
+            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.SentDate, REVERSE));
     }
 
     @Test
@@ -84,7 +84,7 @@ public class SortConverterTest {
     @Test
     public void convertToSortsShouldBeDescWhenNoOrderClause() {
         assertThat(SortConverter.convertToSorts(ImmutableList.of("date")))
-            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.Arrival, REVERSE));
+            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.SentDate, REVERSE));
     }
 
     @Test
@@ -96,7 +96,7 @@ public class SortConverterTest {
     @Test
     public void convertToSortsShouldSupportAscOrder() {
         assertThat(SortConverter.convertToSorts(ImmutableList.of("date asc")))
-            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.Arrival, NOT_REVERSE));
+            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.SentDate, NOT_REVERSE));
     }
 
     @Test
@@ -108,7 +108,7 @@ public class SortConverterTest {
     @Test
     public void convertToSortsShouldSupportMultipleSorts() {
         assertThat(SortConverter.convertToSorts(ImmutableList.of("date asc", "id desc")))
-            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.Arrival, NOT_REVERSE),
+            .containsExactly(new SearchQuery.Sort(SearchQuery.Sort.SortClause.SentDate, NOT_REVERSE),
                 new SearchQuery.Sort(SearchQuery.Sort.SortClause.Id, REVERSE));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message