james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1685966 - in /james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra: CassandraClusterSingleton.java mail/CassandraACLMapperTest.java
Date Wed, 17 Jun 2015 09:11:49 GMT
Author: btellier
Date: Wed Jun 17 09:11:48 2015
New Revision: 1685966

URL: http://svn.apache.org/r1685966
Log:
MAILBOX-209 Remove warnings from Cassandra mailbox - patch contributed by Matthieu Baechler

Modified:
    james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
    james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java

Modified: james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java?rev=1685966&r1=1685965&r2=1685966&view=diff
==============================================================================
--- james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
(original)
+++ james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraClusterSingleton.java
Wed Jun 17 09:11:48 2015
@@ -86,10 +86,10 @@ public final class CassandraClusterSingl
 
     private Optional<Session> tryInitializeSession() {
         try {
-            Cluster cluster = new ClusterFactory().createClusterForSingleServerWithoutPassWord(CLUSTER_IP,
CLUSTER_PORT_TEST);
-            Cluster clusterWithInitializedKeyspace = new ClusterWithKeyspaceCreatedFactory()
+            Cluster cluster = ClusterFactory.createClusterForSingleServerWithoutPassWord(CLUSTER_IP,
CLUSTER_PORT_TEST);
+            Cluster clusterWithInitializedKeyspace = ClusterWithKeyspaceCreatedFactory
                 .clusterWithInitializedKeyspace(cluster, KEYSPACE_NAME, REPLICATION_FACTOR);
-            return Optional.of(new SessionFactory().createSession(clusterWithInitializedKeyspace,
KEYSPACE_NAME));
+            return Optional.of(SessionFactory.createSession(clusterWithInitializedKeyspace,
KEYSPACE_NAME));
         } catch (NoHostAvailableException exception) {
             sleep(SLEEP_BEFORE_RETRY);
             return Optional.empty();

Modified: james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java?rev=1685966&r1=1685965&r2=1685966&view=diff
==============================================================================
--- james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java
(original)
+++ james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java
Wed Jun 17 09:11:48 2015
@@ -22,6 +22,7 @@ import static org.assertj.core.api.Asser
 import static com.datastax.driver.core.querybuilder.QueryBuilder.insertInto;
 
 import com.google.common.base.Throwables;
+
 import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
 import org.apache.james.mailbox.cassandra.table.CassandraACLTable;
 import org.apache.james.mailbox.exception.MailboxException;
@@ -35,10 +36,12 @@ import org.junit.Test;
 
 import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 
 public class CassandraACLMapperTest {
 
@@ -198,8 +201,9 @@ public class CassandraACLMapperTest {
         assertThat(cassandraACLMapper.getACL()).isEqualTo(new SimpleMailboxACL().union(keyBob,
rights).union(keyAlice, rights).union(keyBenwa, rights));
     }
 
-    private void awaitAll(Future<Boolean>... futures) throws InterruptedException,
java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException {
-        for (Future<Boolean> future : futures) {
+    private void awaitAll(Future<?>... futures) 
+            throws InterruptedException, ExecutionException, TimeoutException {
+        for (Future<?> future : futures) {
             future.get(10l, TimeUnit.SECONDS);
         }
     }



---------------------------------------------------------------------
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