james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 04/06: JAMES-2777 WebAdmin routes; more tests upon Task cancellation
Date Wed, 05 Jun 2019 03:01:30 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 e37240899d3961bbea2a42e116f82f32de831fb6
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Fri May 31 14:56:44 2019 +0700

    JAMES-2777 WebAdmin routes; more tests upon Task cancellation
---
 .../james/webadmin/routes/TasksRoutesTest.java     | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

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 de01cde..c345466 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
@@ -191,6 +191,37 @@ class TasksRoutesTest {
     }
 
     @Test
+    void getAwaitShouldNotFailUponError() {
+        TaskId taskId = taskManager.submit(() -> {
+            throw new RuntimeException();
+        });
+
+        when()
+            .get("/" + taskId.getValue() + "/await")
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("status", is("failed"));
+    }
+
+    @Test
+    void getAwaitShouldNotFailUponFutureError() {
+        TaskId taskId = taskManager.submit(() -> {
+            try {
+                Thread.sleep(200);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            throw new RuntimeException();
+        });
+
+        when()
+            .get("/" + taskId.getValue() + "/await")
+        .then()
+            .statusCode(HttpStatus.OK_200)
+            .body("status", is("failed"));
+    }
+
+    @Test
     void deleteShouldReturnOk() {
         TaskId taskId = taskManager.submit(() -> {
             await();


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