james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1727401 - /james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java
Date Thu, 28 Jan 2016 16:39:12 GMT
Author: matthieu
Date: Thu Jan 28 16:39:12 2016
New Revision: 1727401

URL: http://svn.apache.org/viewvc?rev=1727401&view=rev
Log:
JAMES-1674 use a small ttl only for expiration test

Modified:
    james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java

Modified: james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java?rev=1727401&r1=1727400&r2=1727401&view=diff
==============================================================================
--- james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java
(original)
+++ james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraMailboxPathRegistrerMapperTest.java
Thu Jan 28 16:39:12 2016
@@ -29,14 +29,15 @@ import org.junit.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import java.util.concurrent.TimeUnit;
+
 public class CassandraMailboxPathRegistrerMapperTest {
 
     private static final CassandraCluster cassandra = CassandraCluster.create(new CassandraRegistrationModule());
     private static final MailboxPath MAILBOX_PATH = new MailboxPath("namespace", "user",
"name");
     private static final MailboxPath MAILBOX_PATH_2 = new MailboxPath("namespace2", "user2",
"name2");
     private static final Topic TOPIC = new Topic("topic");
-    private static final int CASSANDRA_TIME_OUT_IN_S = 1;
-    private static final int CASSANDRA_TIME_OUT_IN_MS = 1000 * CASSANDRA_TIME_OUT_IN_S;
+    private static final int CASSANDRA_TIME_OUT_IN_S = 100;
     private static final Topic TOPIC_2 = new Topic("topic2");
 
     private CassandraMailboxPathRegisterMapper mapper;
@@ -98,8 +99,10 @@ public class CassandraMailboxPathRegistr
 
     @Test
     public void entriesShouldExpire() throws Exception {
+        int verySmallTimeoutInSecond = 1;
+        mapper = new CassandraMailboxPathRegisterMapper(cassandra.getConf(), cassandra.getTypesProvider(),
verySmallTimeoutInSecond);
         mapper.doRegister(MAILBOX_PATH, TOPIC);
-        Thread.sleep(2 * CASSANDRA_TIME_OUT_IN_MS);
+        Thread.sleep(2 * TimeUnit.SECONDS.toMillis(verySmallTimeoutInSecond));
         assertThat(mapper.getTopics(MAILBOX_PATH)).isEmpty();
     }
 



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