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/03/12 03:19:44 UTC
[james-project] 06/15: JAMES-2665 Basic first integration test for
Cassandra and the vault
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 1d4ae5cc8bbd0283fa7e12f10bcacd8240788729
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Mar 5 14:56:37 2019 +0700
JAMES-2665 Basic first integration test for Cassandra and the vault
Exercise it on Cassandra mail repositories
---
.../CassandraDeletedMessageVaultTest.java | 55 ++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraDeletedMessageVaultTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraDeletedMessageVaultTest.java
new file mode 100644
index 0000000..e6f1cf5
--- /dev/null
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraDeletedMessageVaultTest.java
@@ -0,0 +1,55 @@
+/****************************************************************
+ * 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;
+
+import java.io.IOException;
+
+import org.apache.james.CassandraJmapTestRule;
+import org.apache.james.DockerCassandraRule;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.jmap.methods.integration.DeletedMessagesVaultTest;
+import org.apache.james.mailrepository.api.MailRepositoryUrl;
+import org.apache.james.modules.mailbox.PreDeletionHookConfiguration;
+import org.apache.james.modules.mailbox.PreDeletionHooksConfiguration;
+import org.apache.james.vault.DeletedMessageVaultHook;
+import org.apache.james.vault.MailRepositoryDeletedMessageVault;
+import org.apache.james.webadmin.WebAdminConfiguration;
+import org.junit.ClassRule;
+import org.junit.Rule;
+
+public class CassandraDeletedMessageVaultTest extends DeletedMessagesVaultTest {
+
+ @ClassRule
+ public static DockerCassandraRule cassandra = new DockerCassandraRule();
+
+ @Rule
+ public CassandraJmapTestRule rule = CassandraJmapTestRule.defaultTestRule();
+
+ @Override
+ protected GuiceJamesServer createJmapServer() throws IOException {
+ return rule.jmapServer(cassandra.getModule(),
+ binder -> binder.bind(PreDeletionHooksConfiguration.class)
+ .toInstance(PreDeletionHooksConfiguration.forHooks(
+ PreDeletionHookConfiguration.forClass(DeletedMessageVaultHook.class))),
+ binder -> binder.bind(WebAdminConfiguration.class).toInstance(WebAdminConfiguration.TEST_CONFIGURATION),
+ binder -> binder.bind(MailRepositoryDeletedMessageVault.Configuration.class)
+ .toInstance(new MailRepositoryDeletedMessageVault.Configuration(MailRepositoryUrl.from("cassandra://var/deletedMessages/user"))));
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org