james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [1/7] james-project git commit: JAMES-2137 Attachment text search capability is mandatory in JMAP
Date Fri, 08 Sep 2017 20:14:49 GMT
Repository: james-project
Updated Branches:
  refs/heads/master adad8aad9 -> 2c411e8b5


JAMES-2137 Attachment text search capability is mandatory in JMAP


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

Branch: refs/heads/master
Commit: f319cd39afbe0c60d720d996d91e79a130217e81
Parents: d76f8fc
Author: Antoine Duprat <aduprat@linagora.com>
Authored: Tue Sep 5 14:41:15 2017 +0200
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Fri Sep 8 21:53:13 2017 +0200

----------------------------------------------------------------------
 .../apache/james/JamesCapabilitiesServerTest.java    | 15 +++++++++++++++
 .../main/java/org/apache/james/jmap/JMAPModule.java  |  2 ++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f319cd39/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 5fee8a5..cedaccb 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -116,6 +116,21 @@ public class JamesCapabilitiesServerTest {
     }
     
     @Test
+    public void startShouldFailWhenNoAttachmentSearchCapability() throws Exception {
+        MailboxManager mailboxManager = mock(MailboxManager.class);
+        when(mailboxManager.getSupportedMailboxCapabilities())
+            .thenReturn(EnumSet.allOf(MailboxManager.MailboxCapabilities.class));
+        when(mailboxManager.getSupportedMessageCapabilities())
+            .thenReturn(EnumSet.allOf(MailboxManager.MessageCapabilities.class));
+        when(mailboxManager.getSupportedSearchCapabilities())
+            .thenReturn(EnumSet.complementOf(EnumSet.of(MailboxManager.SearchCapabilities.Attachment)));
+
+        server = createCassandraJamesServer(mailboxManager);
+
+        assertThatThrownBy(() -> server.start()).isInstanceOf(IllegalArgumentException.class);
+    }
+    
+    @Test
     public void startShouldFailWhenNoMultimailboxSearchCapability() throws Exception {
         MailboxManager mailboxManager = mock(MailboxManager.class);
         when(mailboxManager.getSupportedMailboxCapabilities())

http://git-wip-us.apache.org/repos/asf/james-project/blob/f319cd39/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
index a04a866..88de16a 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -153,6 +153,8 @@ public class JMAPModule extends AbstractModule {
                     "Multimailbox search in MailboxManager is required by JMAP Module");
             Preconditions.checkArgument(searchCapabilities.contains(MailboxManager.SearchCapabilities.Text),
                     "Text support in MailboxManager is required by JMAP Module");
+            Preconditions.checkArgument(searchCapabilities.contains(MailboxManager.SearchCapabilities.Attachment),
+                    "Attachment Search support in MailboxManager is required by JMAP Module");
         }
 
         @Override


---------------------------------------------------------------------
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