You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2020/12/18 07:27:41 UTC

[james-project] 13/13: JAMES-3400 Update Webadmin-cli README.md following separation of reindex from mailbox commands group

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 94c18471c781a29397ce0f251976b217dab2123b
Author: quanth <hq...@linagora.com>
AuthorDate: Mon Dec 14 14:10:07 2020 +0700

    JAMES-3400 Update Webadmin-cli README.md following separation of reindex from mailbox commands group
---
 server/protocols/webadmin-cli/README.md              | 20 --------------------
 .../james/cli/mailbox/MailboxCreateCommand.java      |  2 +-
 .../java/org/apache/james/cli/MailboxManageTest.java | 10 ++++++----
 3 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/server/protocols/webadmin-cli/README.md b/server/protocols/webadmin-cli/README.md
index 6ea0203..b8b4235 100644
--- a/server/protocols/webadmin-cli/README.md
+++ b/server/protocols/webadmin-cli/README.md
@@ -73,8 +73,6 @@ Note: the command line before ENTITY will be documented as {cli}.
    - [Delete a mailbox and its children](#delete-a-mailbox-and-its-children)
    - [Delete all mailboxes of a user](#delete-all-mailboxes-of-a-user)
    - [Get mailboxes list](#get-mailboxes-list)
-   - [Reindex a user mailboxes](#reindex-a-user-mailboxes)
-   - [Reindex all users mailboxes](#reindex-all-users-mailboxes)
 - [Manage Domain Mappings](#manage-domain-mappings)
    - [Listing all domain mappings](#listing-all-domain-mappings)
    - [Listing all destination domains for a source domain](#listing-all-destination-domains-for-a-source-domain)
@@ -237,24 +235,6 @@ Resource name usernameToBeUsed should be an existing user
 
 Resource name usernameToBeUsed should be an existing user
 
-### Reindex a user mailboxes
-
-```
-{cli} mailbox reindex <usernameToBeUsed>
-```
-
-Will schedule a task for reIndexing all the mails in “usernameToBeUsed” mailboxes.
-
-Resource name usernameToBeUsed should be an existing user
-
-### Reindex all users mailboxes
-
-```
-{cli} mailbox reindexAll
-```
-
-Will schedule a task for reIndexing all the mails stored on this James server.
-
 ## Manage Domain Mappings
 
 Given a configured source (from) domain and a destination (to) domain, when an email is sent to an address belonging to the source domain, then the domain part of this address is overwritten, the destination domain is then used. A source (from) domain can have many destination (to) domains.
diff --git a/server/protocols/webadmin-cli/src/main/java/org/apache/james/cli/mailbox/MailboxCreateCommand.java b/server/protocols/webadmin-cli/src/main/java/org/apache/james/cli/mailbox/MailboxCreateCommand.java
index 950880d..46a7806 100644
--- a/server/protocols/webadmin-cli/src/main/java/org/apache/james/cli/mailbox/MailboxCreateCommand.java
+++ b/server/protocols/webadmin-cli/src/main/java/org/apache/james/cli/mailbox/MailboxCreateCommand.java
@@ -50,7 +50,7 @@ public class MailboxCreateCommand implements Callable<Integer> {
             MailboxClient mailboxClient = mailboxCommand.fullyQualifiedURL("/users");
             Response rs = mailboxClient.createAMailbox(userName, mailboxName);
             if (rs.status() == CREATED_CODE) {
-                mailboxCommand.out.println("The mailbox now exists on the server.");
+                mailboxCommand.out.println("The mailbox was created successfully.");
                 return WebAdminCli.CLI_FINISHED_SUCCEED;
             } else if (rs.status() == BAD_REQUEST_CODE) {
                 mailboxCommand.err.println(rs.body());
diff --git a/server/protocols/webadmin-cli/src/test/java/org/apache/james/cli/MailboxManageTest.java b/server/protocols/webadmin-cli/src/test/java/org/apache/james/cli/MailboxManageTest.java
index 1ee0305..4835e9a 100644
--- a/server/protocols/webadmin-cli/src/test/java/org/apache/james/cli/MailboxManageTest.java
+++ b/server/protocols/webadmin-cli/src/test/java/org/apache/james/cli/MailboxManageTest.java
@@ -70,7 +70,7 @@ public class MailboxManageTest {
             "--url", "http://127.0.0.1:" + port.getValue(), "mailbox", "exist", "hqtran@linagora.com", "INBOX");
 
         assertThat(exitCode).isEqualTo(0);
-        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The mailbox now exists on the server.\n" +
+        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The mailbox was created successfully.\n" +
             "The mailbox exists.");
     }
 
@@ -108,7 +108,7 @@ public class MailboxManageTest {
 
         assertThat(exitCode).isEqualTo(0);
         assertThat(exitCode2).isEqualTo(0);
-        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The mailbox now exists on the server.");
+        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The mailbox was created successfully.");
     }
 
     @Test
@@ -235,7 +235,8 @@ public class MailboxManageTest {
                 "--url", "http://127.0.0.1:" + port.getValue(), "mailbox", "list", "hqtran@linagora.com");
 
         assertThat(exitCode).isEqualTo(0);
-        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The mailbox now does not exist on the server.");
+        // The outputStreamCaptor should capture the result of delete command and the result of list command(which is nothing)
+        assertThat(outputStreamCaptor.toString()).isEqualTo("The mailbox now does not exist on the server.\n");
     }
 
     @Test
@@ -291,7 +292,8 @@ public class MailboxManageTest {
                 "--url", "http://127.0.0.1:" + port.getValue(), "mailbox", "list", "hqtran@linagora.com");
 
         assertThat(exitCode).isEqualTo(0);
-        assertThat(outputStreamCaptor.toString().trim()).isEqualTo("The user do not have mailboxes anymore.");
+        // The outputStreamCaptor should capture the result of deleteAll command and the result of list command(which is nothing)
+        assertThat(outputStreamCaptor.toString()).isEqualTo("The user do not have mailboxes anymore.\n");
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org