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

[james-project] branch master updated (e7d5585 -> 61e93ef)

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

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


    from e7d5585  JAMES-2744 James download should provide Content-Type header
     new f90d462  JAMES-2717 Replace embedded ES in CassandraJmapExtension
     new d8a5883  JAMES-2717 Replace embedded ES in Cassandra cucumber tests
     new f20869c  JAMES-2717 Replace embedded ES in RabbitMQ cucumber tests
     new 61e93ef  JAMES-2717 Remove embedded ES modules in integration tests

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


Summary of changes:
 .../org/apache/james/DockerElasticSearchRule.java  |  4 ++
 .../TestEmbeddedESMetricReporterModule.java        | 49 --------------------
 .../modules/TestEmbeddedElasticSearchModule.java   | 52 ----------------------
 .../jmap/cassandra/cucumber/CassandraStepdefs.java | 22 ++++-----
 ...on.java => CucumberElasticSearchSingleton.java} |  6 +--
 ...on.java => CucumberElasticSearchSingleton.java} |  6 +--
 .../cucumber/awss3/RabbitMQAwsS3Stepdefs.java      | 25 +++++------
 .../integration/CassandraJmapExtension.java        | 19 ++++----
 8 files changed, 41 insertions(+), 142 deletions(-)
 delete mode 100644 server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedESMetricReporterModule.java
 delete mode 100644 server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedElasticSearchModule.java
 copy server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/{CucumberCassandraSingleton.java => CucumberElasticSearchSingleton.java} (86%)
 copy server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/{CucumberCassandraSingleton.java => CucumberElasticSearchSingleton.java} (87%)


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


[james-project] 03/04: JAMES-2717 Replace embedded ES in RabbitMQ cucumber tests

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

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

commit f20869c59c222bea5247ee98446acea22745ca39
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Wed May 8 16:09:20 2019 +0700

    JAMES-2717 Replace embedded ES in RabbitMQ cucumber tests
---
 .../awss3/CucumberElasticSearchSingleton.java      | 27 ++++++++++++++++++++++
 .../cucumber/awss3/RabbitMQAwsS3Stepdefs.java      | 25 ++++++++++----------
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/CucumberElasticSearchSingleton.java b/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/CucumberElasticSearchSingleton.java
new file mode 100644
index 0000000..d1bfed0
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/CucumberElasticSearchSingleton.java
@@ -0,0 +1,27 @@
+/****************************************************************
+ * 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.jmap.rabbitmq.cucumber.awss3;
+
+import org.apache.james.DockerElasticSearchRule;
+
+class CucumberElasticSearchSingleton {
+
+    static final DockerElasticSearchRule elasticSearch = new DockerElasticSearchRule();
+
+}
diff --git a/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/RabbitMQAwsS3Stepdefs.java b/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/RabbitMQAwsS3Stepdefs.java
index 01d6747..9241c6b 100644
--- a/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/RabbitMQAwsS3Stepdefs.java
+++ b/server/protocols/jmap-integration-testing/rabbitmq-jmap-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/cucumber/awss3/RabbitMQAwsS3Stepdefs.java
@@ -28,16 +28,15 @@ import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
 import org.apache.james.CassandraRabbitMQJamesServerMain;
 import org.apache.james.CleanupTasksPerformer;
 import org.apache.james.DockerCassandraRule;
+import org.apache.james.DockerElasticSearchRule;
 import org.apache.james.GuiceJamesServer;
-import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.jmap.methods.integration.cucumber.ImapStepdefs;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
 import org.apache.james.modules.DockerRabbitMQRule;
-import org.apache.james.modules.TestEmbeddedESMetricReporterModule;
-import org.apache.james.modules.TestEmbeddedElasticSearchModule;
+import org.apache.james.modules.TestDockerESMetricReporterModule;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.TestRabbitMQModule;
 import org.apache.james.modules.objectstorage.aws.s3.DockerAwsS3TestRule;
@@ -58,11 +57,11 @@ public class RabbitMQAwsS3Stepdefs {
     private static final int JMAP_GET_MESSAGE_LIST_MAXIMUM_LIMIT = 10;
     private final MainStepdefs mainStepdefs;
     private final ImapStepdefs imapStepdefs;
-    private TemporaryFolder temporaryFolder = new TemporaryFolder();
-    private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
-    private DockerCassandraRule cassandraServer = CucumberCassandraSingleton.cassandraServer;
-    private DockerRabbitMQRule rabbitMQServer = CucumberRabbitMQSingleton.rabbitMQServer;
-    private DockerAwsS3TestRule swiftServer = CucumberAwsS3Singleton.awsS3Server;
+    private final TemporaryFolder temporaryFolder = new TemporaryFolder();
+    private final DockerCassandraRule cassandraServer = CucumberCassandraSingleton.cassandraServer;
+    private final DockerElasticSearchRule elasticSearch = CucumberElasticSearchSingleton.elasticSearch;
+    private final DockerRabbitMQRule rabbitMQServer = CucumberRabbitMQSingleton.rabbitMQServer;
+    private final DockerAwsS3TestRule swiftServer = CucumberAwsS3Singleton.awsS3Server;
 
     @Inject
     private RabbitMQAwsS3Stepdefs(MainStepdefs mainStepdefs, ImapStepdefs imapStepdefs) {
@@ -75,9 +74,9 @@ public class RabbitMQAwsS3Stepdefs {
         cassandraServer.start();
         rabbitMQServer.start();
         swiftServer.start();
+        elasticSearch.start();
 
         temporaryFolder.create();
-        embeddedElasticSearch.before();
         mainStepdefs.messageIdFactory = new CassandraMessageId.Factory();
         Configuration configuration = Configuration.builder()
                 .workingDirectory(temporaryFolder.newFolder())
@@ -87,16 +86,16 @@ public class RabbitMQAwsS3Stepdefs {
         mainStepdefs.jmapServer = GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(CassandraRabbitMQJamesServerMain.MODULES)
                 .overrideWith(new TestJMAPServerModule(JMAP_GET_MESSAGE_LIST_MAXIMUM_LIMIT))
-                .overrideWith(new TestEmbeddedESMetricReporterModule())
+                .overrideWith(new TestDockerESMetricReporterModule(elasticSearch.getDockerEs().getHttpHost()))
                 .overrideWith(new TestRabbitMQModule(rabbitMQServer.dockerRabbitMQ()))
                 .overrideWith(swiftServer.getModule())
-                .overrideWith(new TestEmbeddedElasticSearchModule(embeddedElasticSearch))
+                .overrideWith(elasticSearch.getModule())
                 .overrideWith(cassandraServer.getModule())
                 .overrideWith(binder -> binder.bind(TextExtractor.class).to(DefaultTextExtractor.class))
                 .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class))
                 .overrideWith(binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class).addBinding().to(CassandraTruncateTableTask.class))
                 .overrideWith((binder -> binder.bind(CleanupTasksPerformer.class).asEagerSingleton()));
-        mainStepdefs.awaitMethod = () -> embeddedElasticSearch.awaitForElasticSearch();
+        mainStepdefs.awaitMethod = () -> elasticSearch.getDockerEs().awaitForElasticSearch();
         mainStepdefs.init();
     }
 
@@ -104,7 +103,7 @@ public class RabbitMQAwsS3Stepdefs {
     public void tearDown() {
         ignoreFailures(imapStepdefs::closeConnections,
                 mainStepdefs::tearDown,
-                () -> embeddedElasticSearch.after(),
+                () -> elasticSearch.getDockerEs().cleanUpData(),
                 () -> temporaryFolder.delete());
     }
 


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


[james-project] 04/04: JAMES-2717 Remove embedded ES modules in integration tests

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

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

commit 61e93ef681540af00b315287a9a0b28992be8d5c
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Wed May 8 16:12:02 2019 +0700

    JAMES-2717 Remove embedded ES modules in integration tests
---
 .../TestEmbeddedESMetricReporterModule.java        | 49 --------------------
 .../modules/TestEmbeddedElasticSearchModule.java   | 52 ----------------------
 2 files changed, 101 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedESMetricReporterModule.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedESMetricReporterModule.java
deleted file mode 100644
index 13284fa..0000000
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedESMetricReporterModule.java
+++ /dev/null
@@ -1,49 +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.modules;
-
-import javax.inject.Singleton;
-
-import org.apache.james.metrics.es.ESReporterConfiguration;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-
-public class TestEmbeddedESMetricReporterModule extends AbstractModule {
-
-    private static final String LOCALHOST = "localhost";
-    private static final int DEFAULT_ES_HTTP_PORT = 9200;
-    public static final String METRICS_INDEX = "metrics";
-
-    @Override
-    protected void configure() {
-    }
-
-    @Provides
-    @Singleton
-    public ESReporterConfiguration provideConfiguration() {
-        return ESReporterConfiguration.builder()
-            .enabled()
-            .onHost(LOCALHOST, DEFAULT_ES_HTTP_PORT)
-            .onIndex(METRICS_INDEX)
-            .periodInSecond(1L)
-            .build();
-    }
-}
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedElasticSearchModule.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedElasticSearchModule.java
deleted file mode 100644
index a0d4748..0000000
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/modules/TestEmbeddedElasticSearchModule.java
+++ /dev/null
@@ -1,52 +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.modules;
-
-import javax.inject.Singleton;
-
-import org.apache.james.backends.es.ElasticSearchConfiguration;
-import org.apache.james.backends.es.EmbeddedElasticSearch;
-import org.apache.james.backends.es.utils.TestingClientProvider;
-import org.apache.james.mailbox.elasticsearch.MailboxIndexCreationUtil;
-import org.elasticsearch.client.Client;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-
-public class TestEmbeddedElasticSearchModule extends AbstractModule {
-
-    private final EmbeddedElasticSearch embeddedElasticSearch;
-
-    public TestEmbeddedElasticSearchModule(EmbeddedElasticSearch embeddedElasticSearch) {
-        this.embeddedElasticSearch = embeddedElasticSearch;
-    }
-
-    @Override
-    protected void configure() {
-
-    }
-
-    @Provides
-    @Singleton
-    protected Client provideClientProvider() {
-        Client client = new TestingClientProvider(embeddedElasticSearch.getNode()).get();
-        return MailboxIndexCreationUtil.prepareDefaultClient(client, ElasticSearchConfiguration.DEFAULT_CONFIGURATION);
-    }
-}


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


[james-project] 01/04: JAMES-2717 Replace embedded ES in CassandraJmapExtension

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

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

commit f90d4621e5d82c091bc36f140b4f5723c61d4888
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Wed May 8 16:07:51 2019 +0700

    JAMES-2717 Replace embedded ES in CassandraJmapExtension
---
 .../org/apache/james/DockerElasticSearchRule.java     |  4 ++++
 .../webadmin/integration/CassandraJmapExtension.java  | 19 ++++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/DockerElasticSearchRule.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/DockerElasticSearchRule.java
index 6287009..fed09ce 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/DockerElasticSearchRule.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/DockerElasticSearchRule.java
@@ -50,4 +50,8 @@ public class DockerElasticSearchRule implements GuiceModuleTestRule {
     public DockerElasticSearch getDockerEs() {
         return elasticSearch;
     }
+
+    public void start() {
+        elasticSearch.start();
+    }
 }
diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/CassandraJmapExtension.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/CassandraJmapExtension.java
index c89aea7..5d7c8b2 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/CassandraJmapExtension.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/CassandraJmapExtension.java
@@ -24,12 +24,11 @@ import java.io.IOException;
 
 import org.apache.james.CleanupTasksPerformer;
 import org.apache.james.DockerCassandraRule;
+import org.apache.james.DockerElasticSearchRule;
 import org.apache.james.GuiceJamesServer;
-import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.store.search.PDFTextExtractor;
-import org.apache.james.modules.TestEmbeddedESMetricReporterModule;
-import org.apache.james.modules.TestEmbeddedElasticSearchModule;
+import org.apache.james.modules.TestDockerESMetricReporterModule;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.server.core.configuration.Configuration;
 import org.apache.james.util.Runnables;
@@ -50,13 +49,13 @@ public class CassandraJmapExtension implements BeforeAllCallback, AfterAllCallba
 
     private final TemporaryFolder temporaryFolder;
     private final DockerCassandraRule cassandra;
-    private final EmbeddedElasticSearch elasticSearch;
+    private final DockerElasticSearchRule elasticSearchRule;
     private GuiceJamesServer james;
 
     public CassandraJmapExtension() {
         this.temporaryFolder = new TemporaryFolder();
         this.cassandra = new DockerCassandraRule();
-        this.elasticSearch = new EmbeddedElasticSearch(temporaryFolder);
+        this.elasticSearchRule = new DockerElasticSearchRule();
     }
 
     private GuiceJamesServer james() throws IOException {
@@ -68,9 +67,9 @@ public class CassandraJmapExtension implements BeforeAllCallback, AfterAllCallba
         return GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE).overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
                 .overrideWith(new TestJMAPServerModule(LIMIT_TO_20_MESSAGES))
-                .overrideWith(new TestEmbeddedESMetricReporterModule())
+                .overrideWith(new TestDockerESMetricReporterModule(elasticSearchRule.getDockerEs().getHttpHost()))
                 .overrideWith(cassandra.getModule())
-                .overrideWith(new TestEmbeddedElasticSearchModule(elasticSearch))
+                .overrideWith(elasticSearchRule.getModule())
                 .overrideWith(binder -> binder.bind(WebAdminConfiguration.class).toInstance(WebAdminConfiguration.TEST_CONFIGURATION))
                 .overrideWith(new UnauthorizedModule())
                 .overrideWith((binder -> binder.bind(CleanupTasksPerformer.class).asEagerSingleton()));
@@ -80,14 +79,12 @@ public class CassandraJmapExtension implements BeforeAllCallback, AfterAllCallba
     public void beforeAll(ExtensionContext context) throws Exception {
         temporaryFolder.create();
 
-        Runnables.runParallel(cassandra::start, elasticSearch::before);
+        Runnables.runParallel(cassandra::start, elasticSearchRule::start);
     }
 
     @Override
     public void afterAll(ExtensionContext context) {
-        elasticSearch.after();
-
-        Runnables.runParallel(cassandra::stop, elasticSearch::after);
+        Runnables.runParallel(cassandra::stop, elasticSearchRule.getDockerEs()::cleanUpData);
     }
 
     @Override


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


[james-project] 02/04: JAMES-2717 Replace embedded ES in Cassandra cucumber tests

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

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

commit d8a5883df5fe264554feaa1a9cc622e3aed89b3a
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Wed May 8 16:08:24 2019 +0700

    JAMES-2717 Replace embedded ES in Cassandra cucumber tests
---
 .../jmap/cassandra/cucumber/CassandraStepdefs.java | 22 +++++++++---------
 .../cucumber/CucumberElasticSearchSingleton.java   | 27 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
index 7f770d6..416106b 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CassandraStepdefs.java
@@ -29,15 +29,14 @@ import org.apache.activemq.store.PersistenceAdapter;
 import org.apache.activemq.store.memory.MemoryPersistenceAdapter;
 import org.apache.james.CleanupTasksPerformer;
 import org.apache.james.DockerCassandraRule;
+import org.apache.james.DockerElasticSearchRule;
 import org.apache.james.GuiceJamesServer;
-import org.apache.james.backends.es.EmbeddedElasticSearch;
 import org.apache.james.jmap.methods.integration.cucumber.ImapStepdefs;
 import org.apache.james.jmap.methods.integration.cucumber.MainStepdefs;
 import org.apache.james.mailbox.cassandra.ids.CassandraMessageId;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
-import org.apache.james.modules.TestEmbeddedESMetricReporterModule;
-import org.apache.james.modules.TestEmbeddedElasticSearchModule;
+import org.apache.james.modules.TestDockerESMetricReporterModule;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.server.CassandraTruncateTableTask;
 import org.apache.james.server.core.configuration.Configuration;
@@ -55,9 +54,9 @@ public class CassandraStepdefs {
 
     private final MainStepdefs mainStepdefs;
     private final ImapStepdefs imapStepdefs;
-    private TemporaryFolder temporaryFolder = new TemporaryFolder();
-    private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
-    private DockerCassandraRule cassandraServer = CucumberCassandraSingleton.cassandraServer;
+    private final TemporaryFolder temporaryFolder = new TemporaryFolder();
+    private final DockerElasticSearchRule elasticSearch = CucumberElasticSearchSingleton.elasticSearch;
+    private final DockerCassandraRule cassandraServer = CucumberCassandraSingleton.cassandraServer;
 
     @Inject
     private CassandraStepdefs(MainStepdefs mainStepdefs, ImapStepdefs imapStepdefs) {
@@ -69,7 +68,8 @@ public class CassandraStepdefs {
     public void init() throws Exception {
         cassandraServer.start();
         temporaryFolder.create();
-        embeddedElasticSearch.before();
+        elasticSearch.start();
+
         mainStepdefs.messageIdFactory = new CassandraMessageId.Factory();
         Configuration configuration = Configuration.builder()
             .workingDirectory(temporaryFolder.newFolder())
@@ -79,14 +79,14 @@ public class CassandraStepdefs {
         mainStepdefs.jmapServer = GuiceJamesServer.forConfiguration(configuration)
             .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
             .overrideWith(new TestJMAPServerModule(10))
-            .overrideWith(new TestEmbeddedESMetricReporterModule())
-            .overrideWith(new TestEmbeddedElasticSearchModule(embeddedElasticSearch))
+            .overrideWith(new TestDockerESMetricReporterModule(elasticSearch.getDockerEs().getHttpHost()))
+            .overrideWith(elasticSearch.getModule())
             .overrideWith(cassandraServer.getModule())
             .overrideWith(binder -> binder.bind(TextExtractor.class).to(DefaultTextExtractor.class))
             .overrideWith((binder) -> binder.bind(PersistenceAdapter.class).to(MemoryPersistenceAdapter.class))
             .overrideWith(binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class).addBinding().to(CassandraTruncateTableTask.class))
             .overrideWith((binder -> binder.bind(CleanupTasksPerformer.class).asEagerSingleton()));
-        mainStepdefs.awaitMethod = () -> embeddedElasticSearch.awaitForElasticSearch();
+        mainStepdefs.awaitMethod = () -> elasticSearch.getDockerEs().awaitForElasticSearch();
         mainStepdefs.init();
     }
 
@@ -94,7 +94,7 @@ public class CassandraStepdefs {
     public void tearDown() {
         ignoreFailures(imapStepdefs::closeConnections,
                 mainStepdefs::tearDown,
-                () -> embeddedElasticSearch.after(),
+                () -> elasticSearch.getDockerEs().cleanUpData(),
                 () -> temporaryFolder.delete());
     }
 
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CucumberElasticSearchSingleton.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CucumberElasticSearchSingleton.java
new file mode 100644
index 0000000..0abec72
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/cucumber/CucumberElasticSearchSingleton.java
@@ -0,0 +1,27 @@
+/****************************************************************
+ * 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.jmap.cassandra.cucumber;
+
+import org.apache.james.DockerElasticSearchRule;
+
+public class CucumberElasticSearchSingleton {
+
+    public static final DockerElasticSearchRule elasticSearch = new DockerElasticSearchRule();
+
+}


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