james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [james-project] 01/06: JAMES-2813 Use RabbitMQWorkqueue in the distributed TaskManager test
Date Tue, 03 Sep 2019 07:34:23 GMT
This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 292e6dca2b0e2fe3f6745d01d2727c0d773199e6
Author: RĂ©mi Kowalski <rkowalski@linagora.com>
AuthorDate: Thu Aug 22 11:01:19 2019 +0200

    JAMES-2813 Use RabbitMQWorkqueue in the distributed TaskManager test
---
 .../eventsourcing/distributed/DistributedTaskManagerTest.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/server/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
b/server/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
index d84243c..219fd06 100644
--- a/server/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
+++ b/server/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.james.backend.rabbitmq.RabbitMQExtension;
 import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.backends.cassandra.components.CassandraModule;
@@ -36,7 +37,6 @@ import org.apache.james.eventsourcing.eventstore.cassandra.dto.EventDTOModule;
 import org.apache.james.server.task.json.JsonTaskSerializer;
 import org.apache.james.server.task.json.dto.TestTaskDTOModules;
 import org.apache.james.task.CompletedTask;
-import org.apache.james.task.MemoryWorkQueue;
 import org.apache.james.task.SerialTaskManagerWorker;
 import org.apache.james.task.TaskExecutionDetails;
 import org.apache.james.task.TaskId;
@@ -70,6 +70,9 @@ class DistributedTaskManagerTest {
             CassandraTaskExecutionDetailsProjectionModule.MODULE()));
 
     @RegisterExtension
+    static RabbitMQExtension rabbitMQExtension = RabbitMQExtension.singletonRabbitMQ();
+
+    @RegisterExtension
     static CassandraEventStoreExtension eventStoreExtension = new CassandraEventStoreExtension(cassandraCluster,
MODULES);
 
     @Test
@@ -81,7 +84,10 @@ class DistributedTaskManagerTest {
         WorkQueueSupplier workQueueSupplier = eventSourcingSystem -> {
             WorkerStatusListener listener = new WorkerStatusListener(eventSourcingSystem);
             TaskManagerWorker worker = new SerialTaskManagerWorker(listener);
-            return new MemoryWorkQueue(worker);
+            RabbitMQWorkQueue rabbitMQWorkQueue = new RabbitMQWorkQueue(worker, rabbitMQExtension.getRabbitConnectionPool(),
TASK_SERIALIZER);
+            rabbitMQWorkQueue.start();
+            return rabbitMQWorkQueue;
+
         };
         TaskManager taskManager1 = new EventSourcingTaskManager(workQueueSupplier, eventStore,
executionDetailsProjection, new Hostname("foo"));
         TaskManager taskManager2 = new EventSourcingTaskManager(workQueueSupplier, eventStore,
executionDetailsProjection, new Hostname("bar"));


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