james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 01/02: JAMES-2733 Test that removed mailQueueItems can not be dequeued
Date Mon, 06 May 2019 02:58:17 GMT
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 fd92e5df4aecf6b33ac5618f4e7018fbab81eb53
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Fri May 3 09:43:17 2019 +0700

    JAMES-2733 Test that removed mailQueueItems can not be dequeued
    
    RabbitMQ implementation is failing this test as dequeued items are not checked.
    
    File does not support remove.
---
 .../james/queue/api/ManageableMailQueueContract.java     | 16 ++++++++++++++++
 .../org/apache/james/queue/file/FileMailQueueTest.java   |  7 +++++++
 .../james/queue/rabbitmq/RabbitMQMailQueueTest.java      |  8 ++++++++
 3 files changed, 31 insertions(+)

diff --git a/server/queue/queue-api/src/test/java/org/apache/james/queue/api/ManageableMailQueueContract.java
b/server/queue/queue-api/src/test/java/org/apache/james/queue/api/ManageableMailQueueContract.java
index 336471a..c911e64 100644
--- a/server/queue/queue-api/src/test/java/org/apache/james/queue/api/ManageableMailQueueContract.java
+++ b/server/queue/queue-api/src/test/java/org/apache/james/queue/api/ManageableMailQueueContract.java
@@ -42,6 +42,7 @@ import org.junit.jupiter.api.Test;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterators;
+
 import reactor.core.publisher.Flux;
 
 public interface ManageableMailQueueContract extends MailQueueContract {
@@ -613,4 +614,19 @@ public interface ManageableMailQueueContract extends MailQueueContract
{
         assertThat(getManageableMailQueue().browse()).isEmpty();
     }
 
+    @Test
+    default void deletedElementsShouldNotBeDequeued() throws Exception {
+        enQueue(defaultMail()
+            .name("name1")
+            .build());
+        enQueue(defaultMail()
+            .name("name2")
+            .build());
+
+        getManageableMailQueue().remove(ManageableMailQueue.Type.Name, "name1");
+
+        assertThat(Flux.from(getManageableMailQueue().deQueue()).blockFirst().getMail().getName())
+            .isEqualTo("name2");
+    }
+
 }
diff --git a/server/queue/queue-file/src/test/java/org/apache/james/queue/file/FileMailQueueTest.java
b/server/queue/queue-file/src/test/java/org/apache/james/queue/file/FileMailQueueTest.java
index 217c85f..bfc9bd7 100644
--- a/server/queue/queue-file/src/test/java/org/apache/james/queue/file/FileMailQueueTest.java
+++ b/server/queue/queue-file/src/test/java/org/apache/james/queue/file/FileMailQueueTest.java
@@ -111,4 +111,11 @@ public class FileMailQueueTest implements DelayedManageableMailQueueContract
{
     public void concurrentEnqueueDequeueWithAckNackShouldNotFail() {
 
     }
+
+    @Test
+    @Override
+    @Disabled("JAMES-2544 Not supported yet")
+    public void deletedElementsShouldNotBeDequeued() {
+
+    }
 }
diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
index c636b9d..5f44b02 100644
--- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
+++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
@@ -233,6 +233,14 @@ public class RabbitMQMailQueueTest implements ManageableMailQueueContract,
MailQ
 
     }
 
+    @Disabled("JAMES-2733 Deleted elements are still dequeued")
+    @Test
+    @Override
+    public void deletedElementsShouldNotBeDequeued() {
+
+    }
+
+
     private void enqueueSomeMails(Function<Integer, String> namePattern, int emailCount)
{
         IntStream.rangeClosed(1, emailCount)
             .forEach(Throwing.intConsumer(i -> enQueue(defaultMail()


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