You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/10/04 05:08:07 UTC

[james-project] branch master updated (4dd45cd -> 4a21b62)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from 4dd45cd  JAMES-2813 remove default type in Task
     new 627e330  JAMES-2078 Add integration tests for dynamic mappings behavior with ES
     new 080c35c  JAMES-2900 Use UnicastProcessor instead of WorkQueueProcessor
     new 4a21b62  JAMES-2901 Fix JamesUsers link

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../ElasticSearchIntegrationTest.java              | 50 ++++++++++++++++++++++
 .../test/resources/eml/mailCustomDateHeader.eml    |  9 ++++
 .../test/resources/eml/mailCustomStringHeader.eml  |  9 ++++
 .../mailetcontainer/impl/JamesMailSpoolerTest.java |  6 +--
 src/site/xdoc/documentation.xml                    |  2 +-
 5 files changed, 72 insertions(+), 4 deletions(-)
 create mode 100644 mailbox/elasticsearch/src/test/resources/eml/mailCustomDateHeader.eml
 create mode 100644 mailbox/elasticsearch/src/test/resources/eml/mailCustomStringHeader.eml


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


[james-project] 01/03: JAMES-2078 Add integration tests for dynamic mappings behavior with ES

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 627e3301dfa36f78a0438261c7eab00b0c4e99b2
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Sep 27 16:56:49 2019 +0700

    JAMES-2078 Add integration tests for dynamic mappings behavior with ES
---
 .../ElasticSearchIntegrationTest.java              | 50 ++++++++++++++++++++++
 .../test/resources/eml/mailCustomDateHeader.eml    |  9 ++++
 .../test/resources/eml/mailCustomStringHeader.eml  |  9 ++++
 3 files changed, 68 insertions(+)

diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
index 0b4f2be..2c30a29 100644
--- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
+++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
@@ -51,6 +51,7 @@ import org.apache.james.mime4j.dom.Message;
 import org.elasticsearch.client.RestHighLevelClient;
 import org.junit.After;
 import org.junit.ClassRule;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -218,4 +219,53 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest
         assertThat(messageManager.search(new SearchQuery(SearchQuery.bodyContains(reasonableLongTerm)), session))
             .containsExactly(composedMessageId.getUid());
     }
+
+    @Test
+    @Ignore("JAMES-2078 issue with dynamic mapping")
+    public void headerSearchShouldIncludeMessageWhenDifferentTypesOnAnIndexedField() throws Exception {
+        MailboxPath mailboxPath = MailboxPath.forUser(USERNAME, INBOX);
+        MailboxSession session = MailboxSessionUtil.create(USERNAME);
+        MessageManager messageManager = storeMailboxManager.getMailbox(mailboxPath, session);
+
+        ComposedMessageId customDateHeaderMessageId = messageManager.appendMessage(
+            MessageManager.AppendCommand.builder()
+                .build(ClassLoader.getSystemResourceAsStream("eml/mailCustomDateHeader.eml")),
+            session);
+
+        elasticSearch.awaitForElasticSearch();
+
+        ComposedMessageId customStringHeaderMessageId = messageManager.appendMessage(
+            MessageManager.AppendCommand.builder()
+                .build(ClassLoader.getSystemResourceAsStream("eml/mailCustomStringHeader.eml")),
+            session);
+
+        elasticSearch.awaitForElasticSearch();
+
+        assertThat(messageManager.search(new SearchQuery(SearchQuery.headerExists("Custom-header")), session))
+            .containsExactly(customDateHeaderMessageId.getUid(), customStringHeaderMessageId.getUid());
+    }
+
+    @Test
+    public void messageShouldStillBeIndexedEvenAfterOneFieldFailsIndexation() throws Exception {
+        MailboxPath mailboxPath = MailboxPath.forUser(USERNAME, INBOX);
+        MailboxSession session = MailboxSessionUtil.create(USERNAME);
+        MessageManager messageManager = storeMailboxManager.getMailbox(mailboxPath, session);
+
+        messageManager.appendMessage(
+            MessageManager.AppendCommand.builder()
+                .build(ClassLoader.getSystemResourceAsStream("eml/mailCustomDateHeader.eml")),
+            session);
+
+        elasticSearch.awaitForElasticSearch();
+
+        ComposedMessageId customStringHeaderMessageId = messageManager.appendMessage(
+            MessageManager.AppendCommand.builder()
+                .build(ClassLoader.getSystemResourceAsStream("eml/mailCustomStringHeader.eml")),
+            session);
+
+        elasticSearch.awaitForElasticSearch();
+
+        assertThat(messageManager.search(new SearchQuery(SearchQuery.all()), session))
+            .contains(customStringHeaderMessageId.getUid());
+    }
 }
\ No newline at end of file
diff --git a/mailbox/elasticsearch/src/test/resources/eml/mailCustomDateHeader.eml b/mailbox/elasticsearch/src/test/resources/eml/mailCustomDateHeader.eml
new file mode 100644
index 0000000..2f42d75
--- /dev/null
+++ b/mailbox/elasticsearch/src/test/resources/eml/mailCustomDateHeader.eml
@@ -0,0 +1,9 @@
+Content-Type: text/plain; Charset=UTF-8
+Subject: my subject test
+MIME-Version: 1.0
+Message-Id: <20...@lenny>
+From: B <b...@test>
+To: c@test
+Custom-header: 2015/09/02
+
+Mail content
diff --git a/mailbox/elasticsearch/src/test/resources/eml/mailCustomStringHeader.eml b/mailbox/elasticsearch/src/test/resources/eml/mailCustomStringHeader.eml
new file mode 100644
index 0000000..0abb9f8
--- /dev/null
+++ b/mailbox/elasticsearch/src/test/resources/eml/mailCustomStringHeader.eml
@@ -0,0 +1,9 @@
+Content-Type: text/plain; Charset=UTF-8
+Subject: subject
+MIME-Version: 1.0
+Message-Id: <20...@lenny>
+From: a@test
+To: b@test
+Custom-header: custom header
+
+Mail content
\ No newline at end of file


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


[james-project] 02/03: JAMES-2900 Use UnicastProcessor instead of WorkQueueProcessor

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 080c35ca469fc9ef338002c79ecac5580d663579
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Wed Sep 25 16:10:18 2019 +0200

    JAMES-2900 Use UnicastProcessor instead of WorkQueueProcessor
---
 .../org/apache/james/mailetcontainer/impl/JamesMailSpoolerTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailSpoolerTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailSpoolerTest.java
index db43fcc..7a10d13 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailSpoolerTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailSpoolerTest.java
@@ -46,7 +46,7 @@ import org.awaitility.Awaitility;
 import org.awaitility.core.ConditionFactory;
 import org.junit.jupiter.api.Test;
 
-import reactor.core.publisher.WorkQueueProcessor;
+import reactor.core.publisher.UnicastProcessor;
 
 class JamesMailSpoolerTest {
     private static final ConditionFactory CALMLY_AWAIT = Awaitility
@@ -62,7 +62,7 @@ class JamesMailSpoolerTest {
         JamesMailSpooler spooler = new JamesMailSpooler(metricFactory);
         MailQueueFactory<?> queueFactory = mock(MailQueueFactory.class);
 
-        WorkQueueProcessor<MockedMailQueueItem> workQueue = WorkQueueProcessor.create("fakeMQ", 1);
+        UnicastProcessor<MockedMailQueueItem> workQueue = UnicastProcessor.create();
         MockedMailQueueItem item = new MockedMailQueueItem();
         item.addCallback(isDone -> {
             if (!isDone) {
@@ -98,7 +98,7 @@ class JamesMailSpoolerTest {
         JamesMailSpooler spooler = new JamesMailSpooler(metricFactory);
         MailQueueFactory<?> queueFactory = mock(MailQueueFactory.class);
 
-        WorkQueueProcessor<MockedMailQueueItem> workQueue = WorkQueueProcessor.create("fakeMQ", 1);
+        UnicastProcessor<MockedMailQueueItem> workQueue = UnicastProcessor.create();
         MockedMailQueueItem item = new MockedMailQueueItem();
         item.addCallback(isDone -> {
             if (!isDone) {


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


[james-project] 03/03: JAMES-2901 Fix JamesUsers link

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 4a21b62f9aa7069af7186a0fe4b6f2fca498daba
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Wed Sep 25 16:16:09 2019 +0200

    JAMES-2901 Fix JamesUsers link
---
 src/site/xdoc/documentation.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/xdoc/documentation.xml b/src/site/xdoc/documentation.xml
index 490dbef..eb902e0 100644
--- a/src/site/xdoc/documentation.xml
+++ b/src/site/xdoc/documentation.xml
@@ -43,7 +43,7 @@
              James is made of <b>internal projects</b> - Server, Mailet, Mailbox, Protocols, MPT - and of <b>external projects</b> – Hupa, Mime4J, jSieve, jSPF, jDKIM.</p>
 
           <p>You can also read the <a href="http://wiki.apache.org/james/">wiki</a>
-             (discover <a href="http://wiki.apache.org/james/JamesUsers">who uses James</a>,...)</p>
+             (discover <a href="https://cwiki.apache.org/confluence/display/JAMES2/JamesUsers">who uses James</a>,...)</p>
 
         <img class="centered" src="images/james-schema-subprojects.png" alt="" usemap="#Map" />
            <map name="Map" id="Map">


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