james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [12/21] james-project git commit: MAILBOX-342 Simplify CassandraMailboxMapperConcurrencyTest
Date Fri, 06 Jul 2018 09:27:38 GMT
MAILBOX-342 Simplify CassandraMailboxMapperConcurrencyTest


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

Branch: refs/heads/master
Commit: b0bf0e4851f5d156624189a1fb072523d78fca17
Parents: 6c8b5fc
Author: benwa <btellier@linagora.com>
Authored: Thu Jul 5 10:57:55 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Jul 6 16:25:50 2018 +0700

----------------------------------------------------------------------
 .../CassandraMailboxMapperConcurrencyTest.java  | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b0bf0e48/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
index 20e339d..cceb4f3 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperConcurrencyTest.java
@@ -27,8 +27,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.DockerCassandraRule;
 import org.apache.james.backends.cassandra.init.CassandraModuleComposite;
-import org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
-import org.apache.james.backends.cassandra.utils.CassandraUtils;
+import org.apache.james.mailbox.cassandra.mail.utils.GuiceUtils;
 import org.apache.james.mailbox.cassandra.modules.CassandraAclModule;
 import org.apache.james.mailbox.cassandra.modules.CassandraMailboxModule;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -55,19 +54,10 @@ public class CassandraMailboxMapperConcurrencyTest {
     @Before
     public void setUp() {
         CassandraModuleComposite modules = new CassandraModuleComposite(new CassandraMailboxModule(),
new CassandraAclModule());
-        cassandra = CassandraCluster.create(modules, cassandraServer.getIp(), cassandraServer.getBindingPort());
-        CassandraMailboxDAO mailboxDAO = new CassandraMailboxDAO(cassandra.getConf(), cassandra.getTypesProvider());
-        CassandraMailboxPathDAOImpl mailboxPathDAO = new CassandraMailboxPathDAOImpl(cassandra.getConf(),
cassandra.getTypesProvider());
-        CassandraMailboxPathV2DAO mailboxPathV2DAO = new CassandraMailboxPathV2DAO(cassandra.getConf(),
CassandraUtils.WITH_DEFAULT_CONFIGURATION);
-        CassandraUserMailboxRightsDAO userMailboxRightsDAO = new CassandraUserMailboxRightsDAO(cassandra.getConf(),
CassandraUtils.WITH_DEFAULT_CONFIGURATION);
-        testee = new CassandraMailboxMapper(
-            mailboxDAO,
-            mailboxPathDAO,
-            mailboxPathV2DAO,
-            userMailboxRightsDAO,
-            new CassandraACLMapper(cassandra.getConf(),
-                userMailboxRightsDAO,
-                CassandraConfiguration.DEFAULT_CONFIGURATION));
+        cassandra = CassandraCluster.create(modules, cassandraServer.getHost());
+
+        testee = GuiceUtils.testInjector(cassandra)
+            .getInstance(CassandraMailboxMapper.class);
     }
 
     @After


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


Mime
View raw message