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 2018/11/26 09:41:27 UTC

[1/7] james-project git commit: JAMES-2589 Avoid failing when the container already exist

Repository: james-project
Updated Branches:
  refs/heads/master 211b3f1cf -> 92a41825d


JAMES-2589 Avoid failing when the container already exist

This is for instance the case when you reboot James.


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

Branch: refs/heads/master
Commit: 744c98935a23aba6e8c9f1ee6a57bcb84b0646f9
Parents: 211b3f1
Author: Benoit Tellier <bt...@linagora.com>
Authored: Thu Nov 22 15:40:32 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:39:11 2018 +0700

----------------------------------------------------------------------
 .../james/blob/objectstorage/ObjectStorageBlobsDAO.java | 12 +++++++-----
 .../blob/objectstorage/ObjectStorageBlobsDAOTest.java   | 11 +++++------
 2 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/744c9893/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
index 5a1cc62..ea71d10 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
@@ -35,6 +35,8 @@ import org.jclouds.blobstore.domain.Blob;
 import org.jclouds.blobstore.options.CopyOptions;
 import org.jclouds.domain.Location;
 import org.jclouds.io.Payload;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.annotations.VisibleForTesting;
@@ -44,7 +46,8 @@ import com.google.common.hash.HashingInputStream;
 
 public class ObjectStorageBlobsDAO implements BlobStore {
     private static final InputStream EMPTY_STREAM = new ByteArrayInputStream(new byte[0]);
-    public static final Location DEFAULT_LOCATION = null;
+    private static final Location DEFAULT_LOCATION = null;
+    private static final Logger LOGGER = LoggerFactory.getLogger(ObjectStorageBlobsDAO.class);
 
 
     private final BlobId.Factory blobIdFactory;
@@ -76,11 +79,10 @@ public class ObjectStorageBlobsDAO implements BlobStore {
     public CompletableFuture<ContainerName> createContainer(ContainerName name) {
         return CompletableFuture.supplyAsync(() -> blobStore.createContainerInLocation(DEFAULT_LOCATION, name.value()))
             .thenApply(created -> {
-                if (created) {
-                    return name;
-                } else {
-                    throw new ObjectStoreException("Unable to create container " + name.value());
+                if (!created) {
+                    LOGGER.debug("{} already existed", name);
                 }
+                return name;
             });
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/744c9893/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
index c5deef5..265bc9f 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
@@ -20,7 +20,7 @@
 package org.apache.james.blob.objectstorage;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.assertThatCode;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -33,7 +33,6 @@ import org.apache.james.blob.api.BlobStore;
 import org.apache.james.blob.api.HashBlobId;
 import org.apache.james.blob.api.MetricableBlobStore;
 import org.apache.james.blob.api.MetricableBlobStoreContract;
-import org.apache.james.blob.api.ObjectStoreException;
 import org.apache.james.blob.objectstorage.crypto.CryptoConfig;
 import org.apache.james.blob.objectstorage.swift.Credentials;
 import org.apache.james.blob.objectstorage.swift.Identity;
@@ -110,12 +109,12 @@ public class ObjectStorageBlobsDAOTest implements MetricableBlobStoreContract {
     }
 
     @Test
-    void createContainerShouldFailWithRuntimeExceptionWhenCreateContainerTwice() throws Exception {
+    void createContainerShouldNotFailWithRuntimeExceptionWhenCreateContainerTwice() throws Exception {
         ContainerName containerName = ContainerName.of(UUID.randomUUID().toString());
+
         objectStorageBlobsDAO.createContainer(containerName).get();
-        assertThatThrownBy(() -> objectStorageBlobsDAO.createContainer(containerName).get())
-            .hasCauseInstanceOf(ObjectStoreException.class)
-            .hasMessageContaining("Unable to create container");
+        assertThatCode(() -> objectStorageBlobsDAO.createContainer(containerName).get())
+            .doesNotThrowAnyException();
     }
 
     @Test


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


[5/7] james-project git commit: JAMES-2597 Implement DockerLdapSingleton

Posted by bt...@apache.org.
JAMES-2597 Implement DockerLdapSingleton


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

Branch: refs/heads/master
Commit: bf8c0b84b43e0cb351cab6e6d51c95cc655de4ae
Parents: 93a9124
Author: datph <dp...@linagora.com>
Authored: Wed Nov 21 15:09:15 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:41:05 2018 +0700

----------------------------------------------------------------------
 .../james/CassandraLdapJamesServerTest.java     |  6 +-
 .../james/CassandraLdapJmapJamesServerTest.java |  2 +-
 .../java/org/apache/james/DockerLdapRule.java   | 72 +++++++++++++++++++
 .../org/apache/james/LdapTestExtension.java     | 52 ++++++++++++++
 .../org/apache/james/LdapTestExtention.java     | 73 --------------------
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml |  4 +-
 ...assandraRabbitMQLdapJmapJamesServerTest.java |  7 +-
 server/container/guice/pom.xml                  |  7 --
 .../james/user/ldap/DockerLdapSingleton.java    | 36 ++++++++++
 .../ldap/ReadOnlyUsersLDAPRepositoryTest.java   | 10 +--
 10 files changed, 175 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
index 8a0b9e1..61f11c6 100644
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
@@ -19,6 +19,8 @@
 
 package org.apache.james;
 
+import static org.apache.james.user.ldap.DockerLdapSingleton.JAMES_USER;
+import static org.apache.james.user.ldap.DockerLdapSingleton.PASSWORD;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS;
 
@@ -38,8 +40,6 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 
 class CassandraLdapJamesServerTest implements JamesServerContract {
     private static final int LIMIT_TO_10_MESSAGES = 10;
-    private static final String JAMES_USER = "james-user";
-    private static final String PASSWORD = "secret";
     private static Duration slowPacedPollInterval = ONE_HUNDRED_MILLISECONDS;
     private static ConditionFactory calmlyAwait = Awaitility.with()
         .pollInterval(slowPacedPollInterval)
@@ -57,7 +57,7 @@ class CassandraLdapJamesServerTest implements JamesServerContract {
     static JamesServerExtension testExtension = new JamesServerExtensionBuilder()
         .extension(new EmbeddedElasticSearchExtension())
         .extension(new CassandraExtension())
-        .extension(new LdapTestExtention())
+        .extension(new LdapTestExtension())
         .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
             .combineWith(CassandraLdapJamesServerMain.MODULES)
             .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
index 16476e9..853603a 100644
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJmapJamesServerTest.java
@@ -29,7 +29,7 @@ class CassandraLdapJmapJamesServerTest implements JmapJamesServerContract {
     static JamesServerExtension testExtension = new JamesServerExtensionBuilder()
         .extension(new EmbeddedElasticSearchExtension())
         .extension(new CassandraExtension())
-        .extension(new LdapTestExtention())
+        .extension(new LdapTestExtension())
         .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
             .combineWith(CassandraLdapJamesServerMain.MODULES)
             .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/DockerLdapRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/DockerLdapRule.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/DockerLdapRule.java
new file mode 100644
index 0000000..b8a36e3
--- /dev/null
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/DockerLdapRule.java
@@ -0,0 +1,72 @@
+/****************************************************************
+ * 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;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.user.ldap.DockerLdapSingleton;
+import org.apache.james.user.ldap.LdapRepositoryConfiguration;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import com.google.inject.Module;
+
+public class DockerLdapRule implements GuiceModuleTestRule {
+
+    @Override
+    public Module getModule() {
+        return binder -> binder.bind(LdapRepositoryConfiguration.class)
+            .toInstance(computeConfiguration(DockerLdapSingleton.ldapContainer.getLdapHost()));
+    }
+
+    @Override
+    public void await() {
+    }
+
+    @Override
+    public Statement apply(Statement statement, Description description) {
+        return statement;
+    }
+
+    private LdapRepositoryConfiguration computeConfiguration(String ldapIp) {
+        try {
+            return LdapRepositoryConfiguration.builder()
+                .ldapHost(ldapIp)
+                .principal("cn=admin,dc=james,dc=org")
+                .credentials("mysecretpassword")
+                .userBase("ou=People,dc=james,dc=org")
+                .userIdAttribute("uid")
+                .userObjectClass("inetOrgPerson")
+                .maxRetries(4)
+                .retryStartInterval(0)
+                .retryMaxInterval(8)
+                .scale(1000)
+                .build();
+        } catch (ConfigurationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void start() {
+        DockerLdapSingleton.ldapContainer.start();
+    }
+
+    public void stop() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtension.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtension.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtension.java
new file mode 100644
index 0000000..8ac99fc
--- /dev/null
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtension.java
@@ -0,0 +1,52 @@
+/****************************************************************
+ * 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;
+
+import org.junit.jupiter.api.extension.ExtensionContext;
+
+import com.google.inject.Module;
+
+public class LdapTestExtension implements GuiceModuleTestExtension {
+
+    private DockerLdapRule ldapRule;
+
+    LdapTestExtension() {
+        this(new DockerLdapRule());
+    }
+
+    LdapTestExtension(DockerLdapRule ldapRule) {
+        this.ldapRule = ldapRule;
+    }
+
+    @Override
+    public void beforeAll(ExtensionContext extensionContext) {
+        ldapRule.start();
+    }
+
+    @Override
+    public void afterAll(ExtensionContext extensionContext) {
+        ldapRule.stop();
+    }
+
+    @Override
+    public Module getModule() {
+        return ldapRule.getModule();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtention.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtention.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtention.java
deleted file mode 100644
index a0aaea5..0000000
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/LdapTestExtention.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************
- * 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;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.james.user.ldap.LdapGenericContainer;
-import org.apache.james.user.ldap.LdapRepositoryConfiguration;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import com.google.inject.Module;
-
-public class LdapTestExtention implements GuiceModuleTestExtension {
-    private static final String DOMAIN = "james.org";
-    private static final String ADMIN_PASSWORD = "mysecretpassword";
-
-    private LdapGenericContainer ldapContainer;
-
-    @Override
-    public void beforeAll(ExtensionContext extensionContext) {
-        ldapContainer = LdapGenericContainer.builder()
-            .domain(DOMAIN)
-            .password(ADMIN_PASSWORD)
-            .build();
-        ldapContainer.start();
-    }
-
-    @Override
-    public void afterAll(ExtensionContext extensionContext) {
-        ldapContainer.stop();
-    }
-
-    @Override
-    public Module getModule() {
-        return binder -> binder.bind(LdapRepositoryConfiguration.class)
-            .toInstance(computeConfiguration(ldapContainer.getLdapHost()));
-    }
-
-    private LdapRepositoryConfiguration computeConfiguration(String ldapIp) {
-        try {
-            return LdapRepositoryConfiguration.builder()
-                .ldapHost(ldapIp)
-                .principal("cn=admin,dc=james,dc=org")
-                .credentials("mysecretpassword")
-                .userBase("ou=People,dc=james,dc=org")
-                .userIdAttribute("uid")
-                .userObjectClass("inetOrgPerson")
-                .maxRetries(4)
-                .retryStartInterval(0)
-                .retryMaxInterval(8)
-                .scale(1000)
-                .build();
-        } catch (ConfigurationException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
index 6ba6d33..f7c713f 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
@@ -93,6 +93,7 @@
             <groupId>org.apache.james</groupId>
             <artifactId>james-server-data-ldap-integration-testing</artifactId>
             <type>test-jar</type>
+            <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -118,8 +119,7 @@
         </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-api</artifactId>
-            <version>${junit.jupiter.version}</version>
+            <artifactId>junit-jupiter-engine</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
index e79f136..62284a5 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
@@ -85,7 +85,8 @@ class CassandraRabbitMQLdapJmapJamesServerTest {
         }
     }
 
-    interface ContractSuite extends JmapJamesServerContract, MailsShouldBeWellReceived, UserFromLdapShouldLogin {}
+    interface ContractSuite extends JmapJamesServerContract, MailsShouldBeWellReceived,
+        UserFromLdapShouldLogin, JamesServerContract {}
 
     @Nested
     @TestInstance(TestInstance.Lifecycle.PER_CLASS)
@@ -95,7 +96,7 @@ class CassandraRabbitMQLdapJmapJamesServerTest {
             .extension(new EmbeddedElasticSearchExtension())
             .extension(new CassandraExtension())
             .extension(new RabbitMQExtension())
-            .extension(new LdapTestExtention())
+            .extension(new LdapTestExtension())
             .extension(new SwiftBlobStoreExtension())
             .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
@@ -114,7 +115,7 @@ class CassandraRabbitMQLdapJmapJamesServerTest {
             .extension(new EmbeddedElasticSearchExtension())
             .extension(new CassandraExtension())
             .extension(new RabbitMQExtension())
-            .extension(new LdapTestExtention())
+            .extension(new LdapTestExtension())
             .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
                 .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index fbd2fda..b4e4e3e 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -84,13 +84,6 @@
             </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
-                <artifactId>james-server-data-ldap-integration-testing</artifactId>
-                <version>${project.version}</version>
-                <type>test-jar</type>
-                <scope>test</scope>
-            </dependency>
-            <dependency>
-                <groupId>${james.groupId}</groupId>
                 <artifactId>james-server-guice-configuration</artifactId>
                 <version>${project.version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/DockerLdapSingleton.java
----------------------------------------------------------------------
diff --git a/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/DockerLdapSingleton.java b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/DockerLdapSingleton.java
new file mode 100644
index 0000000..ca8fdaa
--- /dev/null
+++ b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/DockerLdapSingleton.java
@@ -0,0 +1,36 @@
+/****************************************************************
+ * 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.user.ldap;
+
+public class DockerLdapSingleton {
+    public static final String JAMES_USER = "james-user";
+    public static final String PASSWORD = "secret";
+    public static final String DOMAIN = "james.org";
+    public static final String ADMIN_PASSWORD = "mysecretpassword";
+
+    public static final LdapGenericContainer ldapContainer = LdapGenericContainer.builder()
+        .domain(DOMAIN)
+        .password(ADMIN_PASSWORD)
+        .build();
+
+    static {
+        ldapContainer.start();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/bf8c0b84/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepositoryTest.java
----------------------------------------------------------------------
diff --git a/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepositoryTest.java b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepositoryTest.java
index 2fdbe54..25d4622 100644
--- a/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepositoryTest.java
+++ b/server/data/data-ldap-integration-testing/src/test/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepositoryTest.java
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.james.user.ldap;
 
+import static org.apache.james.user.ldap.DockerLdapSingleton.ADMIN_PASSWORD;
+import static org.apache.james.user.ldap.DockerLdapSingleton.DOMAIN;
+import static org.apache.james.user.ldap.DockerLdapSingleton.JAMES_USER;
+import static org.apache.james.user.ldap.DockerLdapSingleton.PASSWORD;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 
@@ -34,12 +38,8 @@ import org.slf4j.LoggerFactory;
 public class ReadOnlyUsersLDAPRepositoryTest {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ReadOnlyUsersLDAPRepositoryTest.class);
-    private static final String DOMAIN = "james.org";
-    private static final String ADMIN_PASSWORD = "mysecretpassword";
-    private static final String JAMES_USER = "james-user";
-    private static final String JAMES_USER_MAIL = "james-user" + "@" + DOMAIN;
+    private static final String JAMES_USER_MAIL = JAMES_USER + "@" + DOMAIN;
     private static final String UNKNOWN = "unknown";
-    private static final String PASSWORD = "secret";
     private static final String BAD_PASSWORD = "badpassword";
 
     @ClassRule


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


[7/7] james-project git commit: JAMES-2597 Using RabbitMQDockerSingleton in DockerRabbitMQRule

Posted by bt...@apache.org.
JAMES-2597 Using RabbitMQDockerSingleton in DockerRabbitMQRule


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

Branch: refs/heads/master
Commit: 92a41825d3cd252ea0559827ed22f4710a8c9392
Parents: d9169bb
Author: tran tien duc <dt...@linagora.com>
Authored: Fri Nov 23 12:01:10 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:41:05 2018 +0700

----------------------------------------------------------------------
 .../james/modules/DockerRabbitMQRule.java       | 21 +++--
 ...assandraRabbitMQLdapJmapJamesServerTest.java | 81 ++++++--------------
 2 files changed, 33 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/92a41825/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/modules/DockerRabbitMQRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/modules/DockerRabbitMQRule.java b/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/modules/DockerRabbitMQRule.java
index 5356b6c..3e701a6 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/modules/DockerRabbitMQRule.java
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/test/java/org/apache/james/modules/DockerRabbitMQRule.java
@@ -21,22 +21,22 @@ package org.apache.james.modules;
 
 import static org.apache.james.backend.rabbitmq.RabbitMQFixture.DEFAULT_MANAGEMENT_CREDENTIAL;
 
-import com.google.inject.Module;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.util.Modules;
+import java.net.URISyntaxException;
+
 import org.apache.james.CleanupTasksPerformer;
 import org.apache.james.GuiceModuleTestRule;
 import org.apache.james.backend.rabbitmq.DockerRabbitMQ;
+import org.apache.james.backend.rabbitmq.DockerRabbitMQSingleton;
 import org.apache.james.backend.rabbitmq.RabbitMQConfiguration;
 import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
 
-import java.net.URISyntaxException;
+import com.google.inject.Module;
+import com.google.inject.multibindings.Multibinder;
+import com.google.inject.util.Modules;
 
 public class DockerRabbitMQRule implements GuiceModuleTestRule {
 
-    private DockerRabbitMQ rabbitMQ = DockerRabbitMQ.withoutCookie();
-
     @Override
     public Statement apply(Statement base, Description description) {
         return base;
@@ -52,8 +52,8 @@ public class DockerRabbitMQRule implements GuiceModuleTestRule {
                 try {
                     binder.bind(RabbitMQConfiguration.class)
                         .toInstance(RabbitMQConfiguration.builder()
-                            .amqpUri(rabbitMQ.amqpUri())
-                            .managementUri(rabbitMQ.managementUri())
+                            .amqpUri(DockerRabbitMQSingleton.SINGLETON.amqpUri())
+                            .managementUri(DockerRabbitMQSingleton.SINGLETON.managementUri())
                             .managementCredentials(DEFAULT_MANAGEMENT_CREDENTIAL)
                             .build());
                 } catch (URISyntaxException e) {
@@ -66,14 +66,13 @@ public class DockerRabbitMQRule implements GuiceModuleTestRule {
     }
 
     public DockerRabbitMQ dockerRabbitMQ() {
-        return rabbitMQ;
+        return DockerRabbitMQSingleton.SINGLETON;
     }
 
     public void start() {
-        rabbitMQ.start();
+        DockerRabbitMQSingleton.SINGLETON.start();
     }
 
     public void stop() {
-        rabbitMQ.stop();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/92a41825/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
index 62284a5..7fdb315 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
@@ -20,25 +20,19 @@
 package org.apache.james;
 
 import static org.apache.james.JmapJamesServerContract.JAMES_SERVER_HOST;
+import static org.apache.james.user.ldap.DockerLdapSingleton.JAMES_USER;
+import static org.apache.james.user.ldap.DockerLdapSingleton.PASSWORD;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS;
 
 import java.io.IOException;
 
 import org.apache.commons.net.imap.IMAPClient;
-import org.apache.james.core.Domain;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.SwiftBlobStoreExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.blobstore.BlobStoreChoosingConfiguration;
 import org.apache.james.modules.protocols.ImapGuiceProbe;
-import org.apache.james.modules.protocols.SmtpGuiceProbe;
-import org.apache.james.utils.IMAPMessageReader;
-import org.apache.james.utils.SMTPMessageSender;
-import org.apache.james.utils.SpoolerProbe;
-import org.awaitility.Awaitility;
-import org.awaitility.Duration;
-import org.awaitility.core.ConditionFactory;
+import org.apache.james.server.core.configuration.Configuration;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestInstance;
@@ -46,33 +40,6 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 
 class CassandraRabbitMQLdapJmapJamesServerTest {
     private static final int LIMIT_TO_10_MESSAGES = 10;
-    private static final String JAMES_USER = "james-user";
-    private static final String PASSWORD = "secret";
-    private static Duration slowPacedPollInterval = ONE_HUNDRED_MILLISECONDS;
-
-    private static ConditionFactory calmlyAwait = Awaitility
-        .with().pollInterval(slowPacedPollInterval)
-        .and().with().pollDelay(slowPacedPollInterval)
-        .await();
-
-    interface MailsShouldBeWellReceived {
-        @RegisterExtension
-        IMAPMessageReader imapMessageReader = new IMAPMessageReader();
-        SMTPMessageSender messageSender = new SMTPMessageSender(Domain.LOCALHOST.asString());
-
-        @Test
-        default void mailsShouldBeWellReceived(GuiceJamesServer server) throws Exception {
-            messageSender.connect(JAMES_SERVER_HOST, server.getProbe(SmtpGuiceProbe.class).getSmtpPort())
-                .sendMessage("bob@any.com", JAMES_USER + "@localhost");
-
-            calmlyAwait.until(() -> server.getProbe(SpoolerProbe.class).processingFinished());
-
-            imapMessageReader.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort())
-                .login(JAMES_USER, PASSWORD)
-                .select("INBOX")
-                .awaitMessage(calmlyAwait);
-        }
-    }
 
     interface UserFromLdapShouldLogin {
 
@@ -85,25 +52,15 @@ class CassandraRabbitMQLdapJmapJamesServerTest {
         }
     }
 
-    interface ContractSuite extends JmapJamesServerContract, MailsShouldBeWellReceived,
-        UserFromLdapShouldLogin, JamesServerContract {}
+    interface ContractSuite extends JmapJamesServerContract, UserFromLdapShouldLogin, JamesServerContract {}
 
     @Nested
     @TestInstance(TestInstance.Lifecycle.PER_CLASS)
     class WithSwift implements ContractSuite {
         @RegisterExtension
-        JamesServerExtension testExtension = new JamesServerExtensionBuilder()
-            .extension(new EmbeddedElasticSearchExtension())
-            .extension(new CassandraExtension())
-            .extension(new RabbitMQExtension())
-            .extension(new LdapTestExtension())
+        JamesServerExtension testExtension = baseJamesServerExtensionBuilder()
             .extension(new SwiftBlobStoreExtension())
-            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
-                .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
-                .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)
-                    .toInstance(BlobStoreChoosingConfiguration.objectStorage()))
-                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
-                .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE))
+            .server(configuration -> buildGuiceServer(configuration, BlobStoreChoosingConfiguration.objectStorage()))
             .build();
     }
 
@@ -111,17 +68,25 @@ class CassandraRabbitMQLdapJmapJamesServerTest {
     @TestInstance(TestInstance.Lifecycle.PER_CLASS)
     class WithoutSwift implements ContractSuite {
         @RegisterExtension
-        JamesServerExtension testExtension = new JamesServerExtensionBuilder()
+        JamesServerExtension testExtension = baseJamesServerExtensionBuilder()
+            .server(configuration -> buildGuiceServer(configuration, BlobStoreChoosingConfiguration.cassandra()))
+            .build();
+    }
+
+    JamesServerExtensionBuilder baseJamesServerExtensionBuilder() {
+        return new JamesServerExtensionBuilder()
             .extension(new EmbeddedElasticSearchExtension())
             .extension(new CassandraExtension())
             .extension(new RabbitMQExtension())
-            .extension(new LdapTestExtension())
-            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
-                .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
-                .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)
-                    .toInstance(BlobStoreChoosingConfiguration.cassandra()))
-                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
-                .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE))
-            .build();
+            .extension(new LdapTestExtension());
+    }
+
+    GuiceJamesServer buildGuiceServer(Configuration configuration, BlobStoreChoosingConfiguration choosingConfiguration) {
+        return GuiceJamesServer.forConfiguration(configuration)
+            .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
+            .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)
+                .toInstance(choosingConfiguration))
+            .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+            .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE);
     }
 }


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


[3/7] james-project git commit: JAMES-2597 Add tests with and without Swift to CassandraRabbitMQLdapServer

Posted by bt...@apache.org.
JAMES-2597 Add tests with and without Swift to CassandraRabbitMQLdapServer


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

Branch: refs/heads/master
Commit: b686c7f9e8258986fd23741e85b530118c5399c3
Parents: 620576e
Author: datph <dp...@linagora.com>
Authored: Tue Nov 20 16:16:59 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:40:45 2018 +0700

----------------------------------------------------------------------
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml |  20 ++-
 .../CassandraRabbitMQLdapJamesServerTest.java   |  90 -------------
 ...assandraRabbitMQLdapJmapJamesServerTest.java | 126 +++++++++++++++++++
 .../src/test/resources/ldif-files/Dockerfile    |   3 -
 .../src/test/resources/ldif-files/populate.ldif |  11 --
 server/container/guice/pom.xml                  |   8 ++
 6 files changed, 152 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
index 125adbb..6ba6d33 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -30,7 +48,6 @@
         <dependency>
             <groupId>org.apache.james</groupId>
             <artifactId>apache-james-backends-rabbitmq</artifactId>
-            <version>${project.version}</version>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
@@ -75,7 +92,6 @@
         <dependency>
             <groupId>org.apache.james</groupId>
             <artifactId>james-server-data-ldap-integration-testing</artifactId>
-            <version>${project.version}</version>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
deleted file mode 100644
index 2ed0203..0000000
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************
- * 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;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS;
-
-import java.io.IOException;
-
-import org.apache.commons.net.imap.IMAPClient;
-import org.apache.james.core.Domain;
-import org.apache.james.modules.RabbitMQExtension;
-import org.apache.james.modules.SwiftBlobStoreExtension;
-import org.apache.james.modules.TestJMAPServerModule;
-import org.apache.james.modules.protocols.ImapGuiceProbe;
-import org.apache.james.modules.protocols.SmtpGuiceProbe;
-import org.apache.james.utils.IMAPMessageReader;
-import org.apache.james.utils.SMTPMessageSender;
-import org.apache.james.utils.SpoolerProbe;
-import org.awaitility.Awaitility;
-import org.awaitility.Duration;
-import org.awaitility.core.ConditionFactory;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public class CassandraRabbitMQLdapJamesServerTest implements JmapJamesServerContract {
-    private static final int LIMIT_TO_10_MESSAGES = 10;
-    private static final String JAMES_USER = "james-user";
-    private static final String PASSWORD = "secret";
-    private static Duration slowPacedPollInterval = ONE_HUNDRED_MILLISECONDS;
-    private static ConditionFactory calmlyAwait = Awaitility
-        .with().pollInterval(slowPacedPollInterval)
-        .and().with().pollDelay(slowPacedPollInterval)
-        .await();
-    private IMAPClient imapClient = new IMAPClient();
-
-    @RegisterExtension
-    IMAPMessageReader imapMessageReader = new IMAPMessageReader();
-    SMTPMessageSender messageSender = new SMTPMessageSender(Domain.LOCALHOST.asString());
-
-    @RegisterExtension
-    static JamesServerExtension testExtension = new JamesServerExtensionBuilder()
-        .extension(new EmbeddedElasticSearchExtension())
-        .extension(new CassandraExtension())
-        .extension(new RabbitMQExtension())
-        .extension(new LdapTestExtention())
-        .extension(new SwiftBlobStoreExtension())
-        .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
-            .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
-            .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
-            .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
-        .build();
-
-    @Test
-    void userFromLdapShouldLoginViaImapProtocol(GuiceJamesServer server) throws IOException {
-        imapClient.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort());
-
-        assertThat(imapClient.login(JAMES_USER, PASSWORD)).isTrue();
-    }
-
-    @Test
-    void mailsShouldBeWellReceivedBeforeFirstUserConnectionWithLdap(GuiceJamesServer server) throws Exception {
-        messageSender.connect(JAMES_SERVER_HOST, server.getProbe(SmtpGuiceProbe.class).getSmtpPort())
-            .sendMessage("bob@any.com", JAMES_USER + "@localhost");
-
-        calmlyAwait.until(() -> server.getProbe(SpoolerProbe.class).processingFinished());
-
-        imapMessageReader.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort())
-            .login(JAMES_USER, PASSWORD)
-            .select("INBOX")
-            .awaitMessage(calmlyAwait);
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
new file mode 100644
index 0000000..e79f136
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJmapJamesServerTest.java
@@ -0,0 +1,126 @@
+/****************************************************************
+ * 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;
+
+import static org.apache.james.JmapJamesServerContract.JAMES_SERVER_HOST;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS;
+
+import java.io.IOException;
+
+import org.apache.commons.net.imap.IMAPClient;
+import org.apache.james.core.Domain;
+import org.apache.james.modules.RabbitMQExtension;
+import org.apache.james.modules.SwiftBlobStoreExtension;
+import org.apache.james.modules.TestJMAPServerModule;
+import org.apache.james.modules.blobstore.BlobStoreChoosingConfiguration;
+import org.apache.james.modules.protocols.ImapGuiceProbe;
+import org.apache.james.modules.protocols.SmtpGuiceProbe;
+import org.apache.james.utils.IMAPMessageReader;
+import org.apache.james.utils.SMTPMessageSender;
+import org.apache.james.utils.SpoolerProbe;
+import org.awaitility.Awaitility;
+import org.awaitility.Duration;
+import org.awaitility.core.ConditionFactory;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+class CassandraRabbitMQLdapJmapJamesServerTest {
+    private static final int LIMIT_TO_10_MESSAGES = 10;
+    private static final String JAMES_USER = "james-user";
+    private static final String PASSWORD = "secret";
+    private static Duration slowPacedPollInterval = ONE_HUNDRED_MILLISECONDS;
+
+    private static ConditionFactory calmlyAwait = Awaitility
+        .with().pollInterval(slowPacedPollInterval)
+        .and().with().pollDelay(slowPacedPollInterval)
+        .await();
+
+    interface MailsShouldBeWellReceived {
+        @RegisterExtension
+        IMAPMessageReader imapMessageReader = new IMAPMessageReader();
+        SMTPMessageSender messageSender = new SMTPMessageSender(Domain.LOCALHOST.asString());
+
+        @Test
+        default void mailsShouldBeWellReceived(GuiceJamesServer server) throws Exception {
+            messageSender.connect(JAMES_SERVER_HOST, server.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+                .sendMessage("bob@any.com", JAMES_USER + "@localhost");
+
+            calmlyAwait.until(() -> server.getProbe(SpoolerProbe.class).processingFinished());
+
+            imapMessageReader.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort())
+                .login(JAMES_USER, PASSWORD)
+                .select("INBOX")
+                .awaitMessage(calmlyAwait);
+        }
+    }
+
+    interface UserFromLdapShouldLogin {
+
+        @Test
+        default void userFromLdapShouldLoginViaImapProtocol(GuiceJamesServer server) throws IOException {
+            IMAPClient imapClient = new IMAPClient();
+            imapClient.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort());
+
+            assertThat(imapClient.login(JAMES_USER, PASSWORD)).isTrue();
+        }
+    }
+
+    interface ContractSuite extends JmapJamesServerContract, MailsShouldBeWellReceived, UserFromLdapShouldLogin {}
+
+    @Nested
+    @TestInstance(TestInstance.Lifecycle.PER_CLASS)
+    class WithSwift implements ContractSuite {
+        @RegisterExtension
+        JamesServerExtension testExtension = new JamesServerExtensionBuilder()
+            .extension(new EmbeddedElasticSearchExtension())
+            .extension(new CassandraExtension())
+            .extension(new RabbitMQExtension())
+            .extension(new LdapTestExtention())
+            .extension(new SwiftBlobStoreExtension())
+            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+                .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
+                .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)
+                    .toInstance(BlobStoreChoosingConfiguration.objectStorage()))
+                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+                .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE))
+            .build();
+    }
+
+    @Nested
+    @TestInstance(TestInstance.Lifecycle.PER_CLASS)
+    class WithoutSwift implements ContractSuite {
+        @RegisterExtension
+        JamesServerExtension testExtension = new JamesServerExtensionBuilder()
+            .extension(new EmbeddedElasticSearchExtension())
+            .extension(new CassandraExtension())
+            .extension(new RabbitMQExtension())
+            .extension(new LdapTestExtention())
+            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+                .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
+                .overrideWith(binder -> binder.bind(BlobStoreChoosingConfiguration.class)
+                    .toInstance(BlobStoreChoosingConfiguration.cassandra()))
+                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+                .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE))
+            .build();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
deleted file mode 100644
index d889a35..0000000
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM dinkel/openldap:latest
-
-COPY populate.ldif /etc/ldap/prepopulate/prepop.ldif

http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
deleted file mode 100644
index 9376a6c..0000000
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
+++ /dev/null
@@ -1,11 +0,0 @@
-dn: ou=people, dc=james,dc=org
-ou: people
-objectClass: organizationalUnit
-
-dn: uid=james-user, ou=people, dc=james,dc=org
-objectClass: inetOrgPerson
-uid: james-user
-cn: james-user
-sn: james-user
-userPassword: secret
-description: James user

http://git-wip-us.apache.org/repos/asf/james-project/blob/b686c7f9/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 3d2d561..fbd2fda 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -80,6 +80,14 @@
                 <artifactId>james-server-cassandra-ldap-guice</artifactId>
                 <version>${project.version}</version>
                 <type>test-jar</type>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>${james.groupId}</groupId>
+                <artifactId>james-server-data-ldap-integration-testing</artifactId>
+                <version>${project.version}</version>
+                <type>test-jar</type>
+                <scope>test</scope>
             </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>


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


[4/7] james-project git commit: JAMES-2597 Fix to right JamesServerContract test in CassandraLdapJamesServerTest

Posted by bt...@apache.org.
JAMES-2597 Fix to right JamesServerContract test in CassandraLdapJamesServerTest


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

Branch: refs/heads/master
Commit: 93a9124ef10071f636037b00b329dfc83a0bef21
Parents: b686c7f
Author: datph <dp...@linagora.com>
Authored: Wed Nov 21 11:18:15 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:40:58 2018 +0700

----------------------------------------------------------------------
 .../test/java/org/apache/james/CassandraLdapJamesServerTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/93a9124e/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
index 0f639ea..8a0b9e1 100644
--- a/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
+++ b/server/container/guice/cassandra-ldap-guice/src/test/java/org/apache/james/CassandraLdapJamesServerTest.java
@@ -36,7 +36,7 @@ import org.awaitility.core.ConditionFactory;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
-class CassandraLdapJamesServerTest implements JmapJamesServerContract {
+class CassandraLdapJamesServerTest implements JamesServerContract {
     private static final int LIMIT_TO_10_MESSAGES = 10;
     private static final String JAMES_USER = "james-user";
     private static final String PASSWORD = "secret";


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


[6/7] james-project git commit: JAMES-2597 Rename maven artifact to match with other products

Posted by bt...@apache.org.
JAMES-2597 Rename maven artifact to match with other products


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

Branch: refs/heads/master
Commit: d9169bb6a02513d24af0f06f6309fb8862af33b5
Parents: bf8c0b8
Author: tran tien duc <dt...@linagora.com>
Authored: Fri Nov 23 11:56:29 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:41:05 2018 +0700

----------------------------------------------------------------------
 server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d9169bb6/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
index f7c713f..d2b5672 100644
--- a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
@@ -31,7 +31,7 @@
     <name>Apache James :: Server :: Cassandra/Ldap with RabbitMQ - guice injection</name>
     <description>An advanced email server - Cassandra/Ldap backend and RabbitMQ messaging with guice injection</description>
 
-    <artifactId>james-server-cassandra-rabbitmq-ldap</artifactId>
+    <artifactId>james-server-cassandra-rabbitmq-ldap-guice</artifactId>
     <dependencies>
         <dependency>
             <groupId>org.apache.james</groupId>


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


[2/7] james-project git commit: JAMES-2597 Create a Cassandra + ES + RabbitMQ + Swift + LDAP product

Posted by bt...@apache.org.
JAMES-2597 Create a Cassandra + ES + RabbitMQ + Swift + LDAP product


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

Branch: refs/heads/master
Commit: 620576e1104c3db1e315b4b12999a012859b554c
Parents: 744c989
Author: datph <dp...@linagora.com>
Authored: Tue Nov 20 15:38:04 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Mon Nov 26 16:39:54 2018 +0700

----------------------------------------------------------------------
 .../guice/cassandra-rabbitmq-ldap-guice/pom.xml | 175 +++++++++++++++++++
 .../CassandraRabbitMQLdapJamesServerMain.java   |  44 +++++
 .../CassandraRabbitMQLdapJamesServerTest.java   |  90 ++++++++++
 .../src/test/resources/dnsservice.xml           |  29 +++
 .../src/test/resources/domainlist.xml           |  24 +++
 .../test/resources/fakemailrepositorystore.xml  |  31 ++++
 .../src/test/resources/imapserver.xml           |  54 ++++++
 .../src/test/resources/keystore                 | Bin 0 -> 2245 bytes
 .../src/test/resources/ldif-files/Dockerfile    |   3 +
 .../src/test/resources/ldif-files/populate.ldif |  11 ++
 .../src/test/resources/lmtpserver.xml           |  41 +++++
 .../src/test/resources/mailetcontainer.xml      | 111 ++++++++++++
 .../src/test/resources/mailrepositorystore.xml  |  31 ++++
 .../src/test/resources/managesieveserver.xml    |  65 +++++++
 .../src/test/resources/pop3server.xml           |  42 +++++
 .../src/test/resources/smtpserver.xml           | 102 +++++++++++
 .../src/test/resources/usersrepository.xml      |  31 ++++
 server/container/guice/pom.xml                  |   7 +
 18 files changed, 891 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
new file mode 100644
index 0000000..125adbb
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/pom.xml
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>james-server-guice</artifactId>
+        <groupId>org.apache.james</groupId>
+        <version>3.3.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>Apache James :: Server :: Cassandra/Ldap with RabbitMQ - guice injection</name>
+    <description>An advanced email server - Cassandra/Ldap backend and RabbitMQ messaging with guice injection</description>
+
+    <artifactId>james-server-cassandra-rabbitmq-ldap</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-james-backends-cassandra</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-james-backends-es</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-james-backends-rabbitmq</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>blob-objectstorage</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>blob-objectstorage-guice</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-cassandra-guice</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-cassandra-ldap-guice</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-cassandra-ldap-guice</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-cassandra-rabbitmq-guice</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-cassandra-rabbitmq-guice</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-data-ldap-integration-testing</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-guice-common</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-guice-jmap</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-guice-rabbitmq</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-testing</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>${junit.jupiter.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <includeScope>compile</includeScope>
+                            <includeScope>runtime</includeScope>
+                            <outputDirectory>${project.build.directory}/${project.artifactId}.lib</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>default-jar</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>${project.artifactId}</finalName>
+                            <archive>
+                                <manifest>
+                                    <addClasspath>true</addClasspath>
+                                    <classpathPrefix>${project.artifactId}.lib/</classpathPrefix>
+                                    <mainClass>org.apache.james.CassandraRabbitMQLdapJamesServerMain</mainClass>
+                                    <useUniqueVersions>false</useUniqueVersions>
+                                </manifest>
+                            </archive>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>test-jar</id>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <reuseForks>true</reuseForks>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/main/java/org/apache/james/CassandraRabbitMQLdapJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/main/java/org/apache/james/CassandraRabbitMQLdapJamesServerMain.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/main/java/org/apache/james/CassandraRabbitMQLdapJamesServerMain.java
new file mode 100644
index 0000000..0b59069
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/main/java/org/apache/james/CassandraRabbitMQLdapJamesServerMain.java
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.data.LdapUsersRepositoryModule;
+import org.apache.james.modules.server.JMXServerModule;
+import org.apache.james.server.core.configuration.Configuration;
+
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class CassandraRabbitMQLdapJamesServerMain {
+    public static final Module MODULES = Modules
+        .override(CassandraRabbitMQJamesServerMain.MODULES)
+        .with(new LdapUsersRepositoryModule());
+
+    public static void main(String[] args) throws Exception {
+        Configuration configuration = Configuration.builder()
+            .useWorkingDirectoryEnvProperty()
+            .build();
+
+        GuiceJamesServer server = GuiceJamesServer.forConfiguration(configuration)
+            .combineWith(MODULES, new JMXServerModule());
+
+        server.start();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
new file mode 100644
index 0000000..2ed0203
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/java/org/apache/james/CassandraRabbitMQLdapJamesServerTest.java
@@ -0,0 +1,90 @@
+/****************************************************************
+ * 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;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS;
+
+import java.io.IOException;
+
+import org.apache.commons.net.imap.IMAPClient;
+import org.apache.james.core.Domain;
+import org.apache.james.modules.RabbitMQExtension;
+import org.apache.james.modules.SwiftBlobStoreExtension;
+import org.apache.james.modules.TestJMAPServerModule;
+import org.apache.james.modules.protocols.ImapGuiceProbe;
+import org.apache.james.modules.protocols.SmtpGuiceProbe;
+import org.apache.james.utils.IMAPMessageReader;
+import org.apache.james.utils.SMTPMessageSender;
+import org.apache.james.utils.SpoolerProbe;
+import org.awaitility.Awaitility;
+import org.awaitility.Duration;
+import org.awaitility.core.ConditionFactory;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+public class CassandraRabbitMQLdapJamesServerTest implements JmapJamesServerContract {
+    private static final int LIMIT_TO_10_MESSAGES = 10;
+    private static final String JAMES_USER = "james-user";
+    private static final String PASSWORD = "secret";
+    private static Duration slowPacedPollInterval = ONE_HUNDRED_MILLISECONDS;
+    private static ConditionFactory calmlyAwait = Awaitility
+        .with().pollInterval(slowPacedPollInterval)
+        .and().with().pollDelay(slowPacedPollInterval)
+        .await();
+    private IMAPClient imapClient = new IMAPClient();
+
+    @RegisterExtension
+    IMAPMessageReader imapMessageReader = new IMAPMessageReader();
+    SMTPMessageSender messageSender = new SMTPMessageSender(Domain.LOCALHOST.asString());
+
+    @RegisterExtension
+    static JamesServerExtension testExtension = new JamesServerExtensionBuilder()
+        .extension(new EmbeddedElasticSearchExtension())
+        .extension(new CassandraExtension())
+        .extension(new RabbitMQExtension())
+        .extension(new LdapTestExtention())
+        .extension(new SwiftBlobStoreExtension())
+        .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+            .combineWith(CassandraRabbitMQLdapJamesServerMain.MODULES)
+            .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+            .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
+        .build();
+
+    @Test
+    void userFromLdapShouldLoginViaImapProtocol(GuiceJamesServer server) throws IOException {
+        imapClient.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort());
+
+        assertThat(imapClient.login(JAMES_USER, PASSWORD)).isTrue();
+    }
+
+    @Test
+    void mailsShouldBeWellReceivedBeforeFirstUserConnectionWithLdap(GuiceJamesServer server) throws Exception {
+        messageSender.connect(JAMES_SERVER_HOST, server.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+            .sendMessage("bob@any.com", JAMES_USER + "@localhost");
+
+        calmlyAwait.until(() -> server.getProbe(SpoolerProbe.class).processingFinished());
+
+        imapMessageReader.connect(JAMES_SERVER_HOST, server.getProbe(ImapGuiceProbe.class).getImapPort())
+            .login(JAMES_USER, PASSWORD)
+            .select("INBOX")
+            .awaitMessage(calmlyAwait);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/dnsservice.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<dnsservice>
+  <servers>
+    <server>8.8.8.8</server>
+    <server>62.210.16.6</server>
+  </servers>
+  <autodiscover>false</autodiscover>
+  <authoritative>false</authoritative>
+  <maxcachesize>50000</maxcachesize>
+</dnsservice>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/domainlist.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/domainlist.xml
new file mode 100644
index 0000000..fe17431
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/domainlist.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<domainlist>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
+</domainlist>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/fakemailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/fakemailrepositorystore.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/fakemailrepositorystore.xml
new file mode 100644
index 0000000..2d19a80
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/fakemailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<!--
+  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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <mailrepository class="org.apache.james.mailrepository.None">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/imapserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/imapserver.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/imapserver.xml
new file mode 100644
index 0000000..509fdb3
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/imapserver.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+
+<!--
+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.
+-->
+
+
+<imapservers>
+    <imapserver enabled="true">
+        <jmxName>imapserver</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+              -->
+            <keystore>classpath://keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+    </imapserver>
+    <imapserver enabled="true">
+        <jmxName>imapserver-ssl</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="true">
+            <!-- To create a new keystore execute:
+              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>classpath://keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+    </imapserver>
+</imapservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/keystore
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/keystore b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/keystore
new file mode 100644
index 0000000..536a6c7
Binary files /dev/null and b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/keystore differ

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
new file mode 100644
index 0000000..d889a35
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/Dockerfile
@@ -0,0 +1,3 @@
+FROM dinkel/openldap:latest
+
+COPY populate.ldif /etc/ldap/prepopulate/prepop.ldif

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
new file mode 100644
index 0000000..9376a6c
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/ldif-files/populate.ldif
@@ -0,0 +1,11 @@
+dn: ou=people, dc=james,dc=org
+ou: people
+objectClass: organizationalUnit
+
+dn: uid=james-user, ou=people, dc=james,dc=org
+objectClass: inetOrgPerson
+uid: james-user
+cn: james-user
+sn: james-user
+userPassword: secret
+description: James user

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/lmtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/lmtpserver.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/lmtpserver.xml
new file mode 100644
index 0000000..7739071
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/lmtpserver.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<lmtpservers>
+
+    <lmtpserver enabled="true">
+        <jmxName>lmtpserver</jmxName>
+        <!-- LMTP should not be reachable from outside your network so bind it to loopback-->
+        <bind>127.0.0.1:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <connectiontimeout>1200</connectiontimeout>
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--  This sets the maximum allowed message size (in kilobytes) for this -->
+        <!--  LMTP service. If unspecified, the value defaults to 0, which means no limit. -->
+        <maxmessagesize>0</maxmessagesize>
+        <handlerchain>
+            <handler class="org.apache.james.lmtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </lmtpserver>
+
+</lmtpservers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailetcontainer.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailetcontainer.xml
new file mode 100644
index 0000000..69d03e2
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailetcontainer.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+
+<!--
+  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.
+ -->
+
+<mailetcontainer enableJmx="false">
+
+    <context>
+        <postmaster>postmaster@james.minet.net</postmaster>
+    </context>
+
+    <spooler>
+        <threads>20</threads>
+    </spooler>
+
+    <processors>
+        <processor state="root" enableJmx="false">
+            <mailet match="All" class="PostmasterAlias"/>
+            <mailet match="RelayLimit=30" class="Null"/>
+            <mailet match="All" class="ToProcessor">
+                <processor>transport</processor>
+            </mailet>
+        </processor>
+
+        <processor state="error" enableJmx="false">
+            <mailet match="All" class="Bounce"/>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/error/</repositoryPath>
+            </mailet>
+        </processor>
+
+
+        <processor state="transport" enableJmx="false">
+            <matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or">
+                <matcher match="SMTPAuthSuccessful"/>
+                <matcher match="SMTPIsAuthNetwork"/>
+                <matcher match="SentByMailet"/>
+                <matcher match="org.apache.james.jmap.mailet.SentByJmap"/>
+            </matcher>
+
+            <mailet match="All" class="RemoveMimeHeader">
+                <name>bcc</name>
+            </mailet>
+            <mailet match="All" class="RecipientRewriteTable" />
+            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.VacationMailet"/>
+            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.filter.JMAPFiltering"/>
+            <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+            <mailet match="HostIsLocal" class="ToProcessor">
+                <processor>local-address-error</processor>
+                <notice>550 - Requested action not taken: no such user here</notice>
+            </mailet>
+            <mailet match="relay-allowed" class="RemoteDelivery">
+                <outgoingQueue>outgoing</outgoingQueue>
+                <delayTime>5000, 100000, 500000</delayTime>
+                <maxRetries>25</maxRetries>
+                <maxDnsProblemRetries>0</maxDnsProblemRetries>
+                <deliveryThreads>10</deliveryThreads>
+                <sendpartial>true</sendpartial>
+                <bounceProcessor>bounces</bounceProcessor>
+            </mailet>
+            <mailet match="All" class="ToProcessor">
+                <processor>relay-denied</processor>
+            </mailet>
+        </processor>
+
+        <processor state="local-address-error" enableJmx="false">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/address-error/</repositoryPath>
+            </mailet>
+        </processor>
+
+        <processor state="relay-denied" enableJmx="false">
+            <mailet match="All" class="Bounce">
+                <attachment>none</attachment>
+            </mailet>
+            <mailet match="All" class="ToRepository">
+                <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+                <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+            </mailet>
+        </processor>
+
+        <processor state="bounces" enableJmx="false">
+            <mailet match="All" class="DSNBounce">
+                <passThrough>false</passThrough>
+            </mailet>
+        </processor>
+
+    </processors>
+
+</mailetcontainer>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailrepositorystore.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailrepositorystore.xml
new file mode 100644
index 0000000..3ca4a1d
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/mailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<!--
+  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.
+ -->
+
+<mailrepositorystore>
+    <mailrepositories>
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+            <protocols>
+                <protocol>file</protocol>
+            </protocols>
+            <config FIFO="false" CACHEKEYS="true"/>
+        </mailrepository>
+    </mailrepositories>
+</mailrepositorystore>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/managesieveserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/managesieveserver.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/managesieveserver.xml
new file mode 100644
index 0000000..eee4052
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/managesieveserver.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+ 
+<!--
+   This template file can be used as example for James Server configuration
+   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+-->
+ 
+<!-- See http://james.apache.org/server/3/config.html for usage -->
+
+<managesieveservers>
+
+   <managesieveserver enabled="true">
+
+     <jmxName>managesieveserver</jmxName>
+
+     <bind>0.0.0.0:0</bind>
+
+     <connectionBacklog>200</connectionBacklog>
+
+     <tls socketTLS="false" startTLS="false">
+       <!-- To create a new keystore execute:
+        keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+         -->
+       <keystore>file://conf/keystore</keystore>
+       <secret>james72laBalle</secret>
+       <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+       <!-- The algorithm is optional and only needs to be specified when using something other
+        than the Sun JCE provider - You could use IbmX509 with IBM Java runtime. -->
+       <algorithm>SunX509</algorithm>
+     </tls>
+         
+        <!-- connection timeout in secconds -->
+        <connectiontimeout>360</connectiontimeout>
+
+        <!-- Set the maximum simultaneous incoming connections for this service -->
+        <connectionLimit>0</connectionLimit>
+         
+        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+  
+   </managesieveserver>
+
+</managesieveservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/pop3server.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/pop3server.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/pop3server.xml
new file mode 100644
index 0000000..595c313
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/pop3server.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+
+<pop3servers>
+    <pop3server enabled="true">
+        <jmxName>pop3server</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <!-- To create a new keystore execute:
+                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
+             -->
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+        </tls>
+        <connectiontimeout>1200</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <handlerchain>
+            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </pop3server>
+</pop3servers>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/smtpserver.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/smtpserver.xml
new file mode 100644
index 0000000..c348f04
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/smtpserver.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<!--
+  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.
+ -->
+
+<smtpservers>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-global</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <authRequired>false</authRequired>
+        <verifyIdentity>true</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-TLS</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+    <smtpserver enabled="true">
+        <jmxName>smtpserver-authenticated</jmxName>
+        <bind>0.0.0.0:0</bind>
+        <connectionBacklog>200</connectionBacklog>
+        <tls socketTLS="false" startTLS="false">
+            <keystore>file://conf/keystore</keystore>
+            <secret>james72laBalle</secret>
+            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+            <algorithm>SunX509</algorithm>
+        </tls>
+        <connectiontimeout>360</connectiontimeout>
+        <connectionLimit>0</connectionLimit>
+        <connectionLimitPerIP>0</connectionLimitPerIP>
+        <!--
+           Authorize only local users
+        -->
+        <authRequired>true</authRequired>
+        <!-- Trust authenticated users -->
+        <verifyIdentity>false</verifyIdentity>
+        <maxmessagesize>0</maxmessagesize>
+        <addressBracketsEnforcement>true</addressBracketsEnforcement>
+        <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+        <handlerchain>
+            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+        </handlerchain>
+    </smtpserver>
+</smtpservers>
+
+

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/usersrepository.xml b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/usersrepository.xml
new file mode 100644
index 0000000..6b94f9a
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-ldap-guice/src/test/resources/usersrepository.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+  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.                                           
+ -->
+
+<!-- Read-Only LDAP based UsersRepository -->
+<usersrepository name="LocalUsers"
+                 ldapHost="ldap://myldapserver:389"
+                 principal="cn=admin,dc=james,dc=org"
+                 credentials="mysecretpassword"
+                 userBase="ou=People,dc=james,dc=org"
+                 userIdAttribute="uid"
+                 maxRetries="4"
+                 retryStartInterval="0"
+                 retryMaxInterval="8"
+                 retryIntervalScale="1000"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/620576e1/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 114154f..3d2d561 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -38,6 +38,7 @@
         <module>cassandra-guice</module>
         <module>cassandra-ldap-guice</module>
         <module>cassandra-rabbitmq-guice</module>
+        <module>cassandra-rabbitmq-ldap-guice</module>
         <module>configuration</module>
         <module>custom-mailets</module>
         <module>es-metric-reporter</module>
@@ -76,6 +77,12 @@
         <dependencies>
             <dependency>
                 <groupId>${james.groupId}</groupId>
+                <artifactId>james-server-cassandra-ldap-guice</artifactId>
+                <version>${project.version}</version>
+                <type>test-jar</type>
+            </dependency>
+            <dependency>
+                <groupId>${james.groupId}</groupId>
                 <artifactId>james-server-guice-configuration</artifactId>
                 <version>${project.version}</version>
             </dependency>


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