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/12/10 02:30:22 UTC
[james-project] 19/27: JAMES-2979 add mail should be well received
integration test for guice-cassandra
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 a5bb8ebe9439bc03e9f70f172a550191bb93f1f7
Author: Rémi KOWALSKI <rk...@linagora.com>
AuthorDate: Wed Nov 20 15:56:36 2019 +0100
JAMES-2979 add mail should be well received integration test for guice-cassandra
---
server/container/guice/cassandra-guice/pom.xml | 6 +++
.../apache/james/WithCassandraBlobStoreTest.java | 43 ++++++++++++++++++++++
.../src/test/resources/listeners.xml | 3 ++
.../methods/integration/SpamAssassinModule.java | 11 ------
.../memory/MemorySpamAssassinContractTest.java | 3 +-
.../src/test/resources/listeners.xml | 3 ++
.../src/test/resources/listeners.xml | 3 ++
7 files changed, 59 insertions(+), 13 deletions(-)
diff --git a/server/container/guice/cassandra-guice/pom.xml b/server/container/guice/cassandra-guice/pom.xml
index 76b08f7..347c693 100644
--- a/server/container/guice/cassandra-guice/pom.xml
+++ b/server/container/guice/cassandra-guice/pom.xml
@@ -105,6 +105,12 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>apache-james-spamassassin</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>apache-mailet-icalendar</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/WithCassandraBlobStoreTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/WithCassandraBlobStoreTest.java
new file mode 100644
index 0000000..7157928
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/WithCassandraBlobStoreTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.jmap.draft.JmapJamesServerContract;
+import org.apache.james.jmap.draft.methods.integration.SpamAssassinModuleExtension;
+import org.apache.james.modules.TestJMAPServerModule;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+class WithCassandraBlobStoreTest implements JmapJamesServerContract, MailsShouldBeWellReceived, JamesServerContract {
+
+ static int LIMIT_TO_10_MESSAGES = 10;
+
+ @RegisterExtension
+ static JamesServerExtension jamesServerExtension = new JamesServerBuilder()
+ .extension(new DockerElasticSearchExtension())
+ .extension(new CassandraExtension())
+ .extension(new SpamAssassinModuleExtension())
+ .server(configuration -> GuiceJamesServer
+ .forConfiguration(configuration)
+ .combineWith(CassandraJamesServerMain.ALL_BUT_JMX_CASSANDRA_MODULE)
+ .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+ .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE))
+ .build();
+
+}
diff --git a/server/protocols/jmap-draft-integration-testing/cassandra-jmap-draft-integration-testing/src/test/resources/listeners.xml b/server/protocols/jmap-draft-integration-testing/cassandra-jmap-draft-integration-testing/src/test/resources/listeners.xml
index ff2e517..cac2777 100644
--- a/server/protocols/jmap-draft-integration-testing/cassandra-jmap-draft-integration-testing/src/test/resources/listeners.xml
+++ b/server/protocols/jmap-draft-integration-testing/cassandra-jmap-draft-integration-testing/src/test/resources/listeners.xml
@@ -46,4 +46,7 @@
<name>second</name>
</configuration>
</listener>
+ <listener>
+ <class>org.apache.james.mailbox.spamassassin.SpamAssassinListener</class>
+ </listener>
</listeners>
\ No newline at end of file
diff --git a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SpamAssassinModule.java b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SpamAssassinModule.java
index c14f979..c1edd25 100644
--- a/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SpamAssassinModule.java
+++ b/server/protocols/jmap-draft-integration-testing/jmap-draft-integration-testing-common/src/test/java/org/apache/james/jmap/draft/methods/integration/SpamAssassinModule.java
@@ -55,17 +55,6 @@ public class SpamAssassinModule extends AbstractModule {
new MailetConfigurationOverride(
org.apache.james.transport.mailets.SpamAssassin.class,
spamAssassinMailetConfig()));
-
- Multibinder.newSetBinder(binder(), MailboxListener.GroupMailboxListener.class)
- .addBinding()
- .to(SpamAssassinListener.class);
- }
-
- @Provides
- @Singleton
- SpamAssassinListener provideSpamAssassinListener(SpamAssassin spamAssassin, SystemMailboxesProvider systemMailboxesProvider, MailboxManager mailboxManager, MailboxSessionMapperFactory mapperFactory) {
- return new SpamAssassinListener(spamAssassin, systemMailboxesProvider, mailboxManager, mapperFactory,
- MailboxListener.ExecutionMode.SYNCHRONOUS);
}
@Provides
diff --git a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySpamAssassinContractTest.java b/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySpamAssassinContractTest.java
index 01f0ef6..60b84de 100644
--- a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySpamAssassinContractTest.java
+++ b/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/MemorySpamAssassinContractTest.java
@@ -35,10 +35,9 @@ class MemorySpamAssassinContractTest implements SpamAssassinContract {
private static final int LIMIT_TO_20_MESSAGES = 20;
- private static final SpamAssassinModuleExtension spamAssassinExtension = new SpamAssassinModuleExtension();
@RegisterExtension
static JamesServerExtension testExtension = new JamesServerBuilder()
- .extension(spamAssassinExtension)
+ .extension(new SpamAssassinModuleExtension())
.server(configuration -> GuiceJamesServer.forConfiguration(configuration)
.combineWith(MemoryJamesServerMain.IN_MEMORY_SERVER_AGGREGATE_MODULE)
.overrideWith(new TestJMAPServerModule(LIMIT_TO_20_MESSAGES))
diff --git a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/listeners.xml b/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/listeners.xml
index 59e3fec..ae2e80a 100644
--- a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/listeners.xml
+++ b/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/resources/listeners.xml
@@ -43,4 +43,7 @@
<name>second</name>
</configuration>
</listener>
+ <listener>
+ <class>org.apache.james.mailbox.spamassassin.SpamAssassinListener</class>
+ </listener>
</listeners>
\ No newline at end of file
diff --git a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/listeners.xml b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/listeners.xml
index ff2e517..cac2777 100644
--- a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/listeners.xml
+++ b/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/resources/listeners.xml
@@ -46,4 +46,7 @@
<name>second</name>
</configuration>
</listener>
+ <listener>
+ <class>org.apache.james.mailbox.spamassassin.SpamAssassinListener</class>
+ </listener>
</listeners>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org