james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1703038 - in /james/server/trunk/container/cli/src: main/java/org/apache/james/cli/type/CmdType.java test/java/org/apache/james/cli/type/CmdTypeTest.java
Date Mon, 14 Sep 2015 19:15:30 GMT
Author: btellier
Date: Mon Sep 14 19:15:30 2015
New Revision: 1703038

URL: http://svn.apache.org/r1703038
Log:
JAMES-1610 Fix usage to contain command name - contributed by Matthieu Baechler

Modified:
    james/server/trunk/container/cli/src/main/java/org/apache/james/cli/type/CmdType.java
    james/server/trunk/container/cli/src/test/java/org/apache/james/cli/type/CmdTypeTest.java

Modified: james/server/trunk/container/cli/src/main/java/org/apache/james/cli/type/CmdType.java
URL: http://svn.apache.org/viewvc/james/server/trunk/container/cli/src/main/java/org/apache/james/cli/type/CmdType.java?rev=1703038&r1=1703037&r2=1703038&view=diff
==============================================================================
--- james/server/trunk/container/cli/src/main/java/org/apache/james/cli/type/CmdType.java
(original)
+++ james/server/trunk/container/cli/src/main/java/org/apache/james/cli/type/CmdType.java
Mon Sep 14 19:15:30 2015
@@ -100,7 +100,7 @@ public enum CmdType {
 	}
 
     public String getUsage() {
-		StringBuilder stringBuilder = new StringBuilder();
+		StringBuilder stringBuilder = new StringBuilder(command);
 		for(String argument : arguments) {
 			stringBuilder.append(" <" + argument + ">");
 		}

Modified: james/server/trunk/container/cli/src/test/java/org/apache/james/cli/type/CmdTypeTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/container/cli/src/test/java/org/apache/james/cli/type/CmdTypeTest.java?rev=1703038&r1=1703037&r2=1703038&view=diff
==============================================================================
--- james/server/trunk/container/cli/src/test/java/org/apache/james/cli/type/CmdTypeTest.java
(original)
+++ james/server/trunk/container/cli/src/test/java/org/apache/james/cli/type/CmdTypeTest.java
Mon Sep 14 19:15:30 2015
@@ -153,4 +153,9 @@ public class CmdTypeTest {
         assertThat(CmdType.lookup(null)).isNull();
     }
     
+    @Test
+    public void usageShouldOutputCommandNamesAndArguments() {
+        assertThat(CmdType.CREATEMAILBOX.getUsage()).isEqualTo("createmailbox <namespace>
<user> <name>");
+    }
+    
 }
\ No newline at end of file



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