james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1685952 - in /james/mailbox/trunk: cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
Date Wed, 17 Jun 2015 08:58:28 GMT
Author: btellier
Date: Wed Jun 17 08:58:27 2015
New Revision: 1685952

URL: http://svn.apache.org/r1685952
Log:
MAILBOX-220 IMAP ranges over Cassandra mailbox should be inclusive - contributed by Antoine
Duprat

Modified:
    james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
    james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java

Modified: james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java?rev=1685952&r1=1685951&r2=1685952&view=diff
==============================================================================
--- james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
(original)
+++ james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
Wed Jun 17 08:58:27 2015
@@ -23,10 +23,10 @@ import static com.datastax.driver.core.q
 import static com.datastax.driver.core.querybuilder.QueryBuilder.bindMarker;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.decr;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
-import static com.datastax.driver.core.querybuilder.QueryBuilder.gt;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.gte;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.incr;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.insertInto;
-import static com.datastax.driver.core.querybuilder.QueryBuilder.lt;
+import static com.datastax.driver.core.querybuilder.QueryBuilder.lte;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.set;
 import static com.datastax.driver.core.querybuilder.QueryBuilder.update;
@@ -238,11 +238,11 @@ public class CassandraMessageMapper impl
     }
 
     private Where selectFrom(Mailbox<UUID> mailbox, long uid) {
-        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gt(IMAP_UID,
uid));
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gte(IMAP_UID,
uid));
     }
 
     private Where selectRange(Mailbox<UUID> mailbox, long from, long to) {
-        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gt(IMAP_UID,
from)).and(lt(IMAP_UID, to));
+        return select(FIELDS).from(TABLE_NAME).where(eq(MAILBOX_ID, mailbox.getMailboxId())).and(gte(IMAP_UID,
from)).and(lte(IMAP_UID, to));
     }
 
     private Where selectMessage(Mailbox<UUID> mailbox, long uid) {

Modified: james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java?rev=1685952&r1=1685951&r2=1685952&view=diff
==============================================================================
--- james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
(original)
+++ james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
Wed Jun 17 08:58:27 2015
@@ -167,8 +167,6 @@ public abstract class AbstractMessageMap
             .isEqualTo(message1, fetchType);
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void messagesCanBeRetrievedInMailboxWithRangeTypeRange() throws MailboxException,
IOException{
         saveMessages();
@@ -177,8 +175,6 @@ public abstract class AbstractMessageMap
         assertThat(retrievedMessageIterator).containsOnly(message1, message2, message3, message4);
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void messagesCanBeRetrievedInMailboxWithRangeTypeRangeContainingAHole() throws
MailboxException, IOException {
         saveMessages();
@@ -188,8 +184,6 @@ public abstract class AbstractMessageMap
         assertThat(retrievedMessageIterator).containsOnly(message1, message2, message4);
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void messagesCanBeRetrievedInMailboxWithRangeTypeFrom() throws MailboxException,
IOException {
         saveMessages();
@@ -198,8 +192,6 @@ public abstract class AbstractMessageMap
         assertThat(retrievedMessageIterator).containsOnly(message3, message4, message5);
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void messagesCanBeRetrievedInMailboxWithRangeTypeFromContainingAHole() throws
MailboxException, IOException {
         saveMessages();
@@ -495,8 +487,6 @@ public abstract class AbstractMessageMap
         MessageAssert.assertThat(retrieveMessageFromStorage(message1)).hasFlags(new Flags(Flags.Flag.FLAGGED));
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void updateFlagsOnRangeShouldAffectMessagesContainedInThisRange() throws MailboxException
{
         saveMessages();
@@ -504,8 +494,6 @@ public abstract class AbstractMessageMap
             .hasSize(3);
     }
 
-    // Ranges should be inclusive
-    @Ignore
     @Test
     public void updateFlagsWithRangeFromShouldAffectMessagesContainedInThisRange() throws
MailboxException {
         saveMessages();



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