You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2018/02/01 10:44:51 UTC
[18/20] james-project git commit: JAMES-2264 Correct TaskRoute test
synchronisation
JAMES-2264 Correct TaskRoute test synchronisation
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/21a63331
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/21a63331
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/21a63331
Branch: refs/heads/master
Commit: 21a633311c7713cfcaf36f4b0b8d1152b13e558e
Parents: 90bdf71
Author: benwa <bt...@linagora.com>
Authored: Thu Feb 1 11:50:12 2018 +0700
Committer: benwa <bt...@linagora.com>
Committed: Thu Feb 1 17:42:29 2018 +0700
----------------------------------------------------------------------
.../apache/james/webadmin/routes/TasksRoutesTest.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/21a63331/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
index 4317035..486b0b8 100644
--- a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/routes/TasksRoutesTest.java
@@ -112,12 +112,16 @@ public class TasksRoutesTest {
}
@Test
- public void listShouldListTaskWhenStatusFilter() {
+ public void listShouldListTaskWhenStatusFilter() throws Exception {
+ CountDownLatch inProgressLatch = new CountDownLatch(1);
TaskId taskId = taskManager.submit(() -> {
+ inProgressLatch.countDown();
await();
return Task.Result.COMPLETED;
});
+ inProgressLatch.await();
+
given()
.param("status", TaskManager.Status.IN_PROGRESS.getValue())
.when()
@@ -151,12 +155,16 @@ public class TasksRoutesTest {
}
@Test
- public void getShouldReturnTaskDetails() {
+ public void getShouldReturnTaskDetails() throws Exception {
+ CountDownLatch inProgressLatch = new CountDownLatch(1);
TaskId taskId = taskManager.submit(() -> {
+ inProgressLatch.countDown();
await();
return Task.Result.COMPLETED;
});
+ inProgressLatch.await();
+
when()
.get("/" + taskId.getValue())
.then()
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org