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:28 UTC

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

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