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/05/14 02:41:02 UTC

[james-project] branch master updated (db3aad0 -> 68cf7e0)

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 db3aad0  Merge remote-tracking branch 'remk/JAMES-2725-2'
     new 052ad51  JAMES-2272 Make webadmin IT tests uses the right path
     new 826e149  JAMES-2149 Simple integration test for Domain mappings
     new 8bb3a68  JAMES-2758 Disable CassandraBulkOperationTest failed test
     new 68cf7e0  JAMES-2758 Bulk deletion rate now is managed by Reactor limitRate()

The 4 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:
 .../mailets/DomainMappingTest.java}                | 73 ++++++++++++++++------
 .../jmap/cassandra/CassandraBulkOperationTest.java |  7 ++-
 .../integration/WebAdminServerIntegrationTest.java |  8 ++-
 3 files changed, 64 insertions(+), 24 deletions(-)
 copy server/mailet/integration-testing/src/test/java/org/apache/james/{smtp/SmtpNullSenderTest.java => transport/mailets/DomainMappingTest.java} (54%)


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


[james-project] 04/04: JAMES-2758 Bulk deletion rate now is managed by Reactor limitRate()

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 68cf7e09902172b6bc7b3d9bbeff405df74f6988
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Mon May 13 14:32:49 2019 +0700

    JAMES-2758 Bulk deletion rate now is managed by Reactor limitRate()
---
 .../apache/james/jmap/cassandra/CassandraBulkOperationTest.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
index 80f5289..5e3eb8f 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
@@ -51,7 +51,6 @@ import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -104,9 +103,8 @@ public class CassandraBulkOperationTest {
             .body(ARGUMENTS + ".destroyed", hasSize(NUMBER_OF_MAIL_TO_CREATE));
     }
 
-    @Ignore("JAMES-2758 this test currently fails on master, disable it until the issue is resolved")
     @Test
-    public void setMessagesShouldFailForHugeNumberOfEmailsToTrashWhenChunksConfigurationAreTooBig() throws Exception {
+    public void setMessagesShouldWorkForHugeNumberOfEmailsToTrashWhenChunksConfigurationAreTooBig() throws Exception {
         jmapServer = createServerWithExpungeChunkSize(NUMBER_OF_MAIL_TO_CREATE);
         String mailIds = provistionMails(NUMBER_OF_MAIL_TO_CREATE);
 
@@ -117,7 +115,10 @@ public class CassandraBulkOperationTest {
         .when()
             .post("/jmap")
         .then()
-            .statusCode(400);
+            .statusCode(200)
+            .log().ifValidationFails()
+            .body(NAME, equalTo("messagesSet"))
+            .body(ARGUMENTS + ".destroyed", hasSize(NUMBER_OF_MAIL_TO_CREATE));
     }
 
     private String provistionMails(int count) {


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


[james-project] 02/04: JAMES-2149 Simple integration test for Domain mappings

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 826e149691ba51796b736ba4564e413f13226892
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri May 10 14:19:33 2019 +0700

    JAMES-2149 Simple integration test for Domain mappings
---
 .../james/transport/mailets/DomainMappingTest.java | 116 +++++++++++++++++++++
 1 file changed, 116 insertions(+)

diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
new file mode 100644
index 0000000..01005c4
--- /dev/null
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
@@ -0,0 +1,116 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.transport.mailets;
+
+import static org.apache.james.mailets.configuration.Constants.DEFAULT_DOMAIN;
+import static org.apache.james.mailets.configuration.Constants.LOCALHOST_IP;
+import static org.apache.james.mailets.configuration.Constants.PASSWORD;
+import static org.apache.james.mailets.configuration.Constants.awaitAtMostOneMinute;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import javax.mail.internet.MimeMessage;
+
+import org.apache.james.core.builder.MimeMessageBuilder;
+import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailets.TemporaryJamesServer;
+import org.apache.james.modules.MailboxProbeImpl;
+import org.apache.james.modules.protocols.ImapGuiceProbe;
+import org.apache.james.modules.protocols.SmtpGuiceProbe;
+import org.apache.james.utils.DataProbeImpl;
+import org.apache.james.utils.IMAPMessageReader;
+import org.apache.james.utils.SMTPMessageSender;
+import org.apache.james.utils.WebAdminGuiceProbe;
+import org.apache.james.webadmin.WebAdminUtils;
+import org.apache.mailet.base.test.FakeMail;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import io.restassured.specification.RequestSpecification;
+
+public class DomainMappingTest {
+    private static final String DOMAIN1 = "domain1.com";
+    private static final String DOMAIN2 = "domain2.com";
+
+    private static final String SENDER_LOCAL_PART = "fromuser";
+    private static final String SENDER = SENDER_LOCAL_PART + "@" + DOMAIN1;
+    private static final String USER_DOMAIN1 = "user@" + DOMAIN1;
+    private static final String USER_DOMAIN2 = "user@" + DOMAIN2;
+    private static final String MESSAGE_CONTENT = "any text";
+
+    private TemporaryJamesServer jamesServer;
+    private MimeMessage message;
+    private RequestSpecification webAdminApi;
+
+    @Rule
+    public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @Rule
+    public IMAPMessageReader imapMessageReader = new IMAPMessageReader();
+    @Rule
+    public SMTPMessageSender messageSender = new SMTPMessageSender(DEFAULT_DOMAIN);
+
+    @Before
+    public void setup() throws Exception {
+        jamesServer = TemporaryJamesServer.builder()
+            .build(temporaryFolder);
+
+        jamesServer.getProbe(DataProbeImpl.class).fluent()
+            .addDomain(DOMAIN1)
+            .addDomain(DOMAIN2)
+            .addUser(SENDER, PASSWORD)
+            .addUser(USER_DOMAIN1, PASSWORD);
+
+        jamesServer.getProbe(MailboxProbeImpl.class).createMailbox(MailboxPath.forUser(USER_DOMAIN1, MailboxConstants.INBOX));
+        jamesServer.getProbe(MailboxProbeImpl.class).createMailbox(MailboxPath.forUser(USER_DOMAIN2, MailboxConstants.INBOX));
+
+        webAdminApi = WebAdminUtils.spec(jamesServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort());
+
+        message = MimeMessageBuilder.mimeMessageBuilder()
+            .setSubject("test")
+            .setText(MESSAGE_CONTENT)
+            .build();
+    }
+
+    @After
+    public void tearDown() {
+        jamesServer.shutdown();
+    }
+
+    @Test
+    public void messageShouldRedirectToUserWhenBelongingToGroup() throws Exception {
+        webAdminApi.body(DOMAIN1).put("/domainMappings/" + DOMAIN2);
+
+        messageSender.connect(LOCALHOST_IP, jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .sendMessage(FakeMail.builder()
+                .name("name")
+                .mimeMessage(message)
+                .sender(SENDER)
+                .recipient(USER_DOMAIN2));
+
+        imapMessageReader.connect(LOCALHOST_IP, jamesServer.getProbe(ImapGuiceProbe.class).getImapPort())
+            .login(USER_DOMAIN1, PASSWORD)
+            .select(IMAPMessageReader.INBOX)
+            .awaitMessage(awaitAtMostOneMinute);
+        assertThat(imapMessageReader.readFirstMessage()).contains(MESSAGE_CONTENT);
+    }
+}


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


[james-project] 03/04: JAMES-2758 Disable CassandraBulkOperationTest failed test

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 8bb3a6803b07cda32df4a3c924056280c74f4474
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Fri May 10 09:58:52 2019 +0700

    JAMES-2758 Disable CassandraBulkOperationTest failed test
---
 .../org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
index 369c3c3..80f5289 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraBulkOperationTest.java
@@ -51,6 +51,7 @@ import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -103,6 +104,7 @@ public class CassandraBulkOperationTest {
             .body(ARGUMENTS + ".destroyed", hasSize(NUMBER_OF_MAIL_TO_CREATE));
     }
 
+    @Ignore("JAMES-2758 this test currently fails on master, disable it until the issue is resolved")
     @Test
     public void setMessagesShouldFailForHugeNumberOfEmailsToTrashWhenChunksConfigurationAreTooBig() throws Exception {
         jmapServer = createServerWithExpungeChunkSize(NUMBER_OF_MAIL_TO_CREATE);


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


[james-project] 01/04: JAMES-2272 Make webadmin IT tests uses the right path

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 052ad512c6545f7172752468cb25119cd9abf592
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Mon May 13 17:57:35 2019 +0700

    JAMES-2272 Make webadmin IT tests uses the right path
---
 .../james/webadmin/integration/WebAdminServerIntegrationTest.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
index 3df2137..081b2a0 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
@@ -254,7 +254,9 @@ public class WebAdminServerIntegrationTest {
             .get("taskId");
 
         with()
-            .get("/task/" + taskId + "/await");
+            .get("/tasks/" + taskId + "/await")
+        .then()
+            .body("status", is("completed"));
 
         Awaitility.await()
             .atMost(Duration.TEN_SECONDS)
@@ -275,7 +277,9 @@ public class WebAdminServerIntegrationTest {
             .get("taskId");
 
         with()
-            .get("/task/" + taskId + "/await");
+            .get("/tasks/" + taskId + "/await")
+        .then()
+            .body("status", is("completed"));
 
         when()
             .get(VERSION)


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