zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1755786 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/cli/CliException.java src/java/test/org/apache/zookeeper/ZooKeeperTest.java
Date Wed, 10 Aug 2016 17:32:22 GMT
Author: phunt
Date: Wed Aug 10 17:32:22 2016
New Revision: 1755786

URL: http://svn.apache.org/viewvc?rev=1755786&view=rev
Log:
ZOOKEEPER-2074: Incorrect exit codes for './zkCli.sh cmd arg' (Abraham Fine via phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/CliException.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/ZooKeeperTest.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1755786&r1=1755785&r2=1755786&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Wed Aug 10 17:32:22 2016
@@ -344,6 +344,9 @@ BUGFIXES:
   ZOOKEEPER-2500: Fix compilation warnings for CliException classes
   (Abraham Fine via phunt)
 
+  ZOOKEEPER-2074: Incorrect exit codes for "./zkCli.sh cmd arg"
+  (Abraham Fine via phunt)
+
 IMPROVEMENTS:
   ZOOKEEPER-2024 Major throughput improvement with mixed workloads (Kfir Lev-Ari via shralex)
 

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/CliException.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/CliException.java?rev=1755786&r1=1755785&r2=1755786&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/CliException.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/cli/CliException.java Wed Aug 10 17:32:22
2016
@@ -22,8 +22,10 @@ public class CliException extends Except
 
     protected int exitCode;
 
+    protected static final int DEFAULT_EXCEPTION_EXIT_CODE = 1;
+
     public CliException(String message) {
-        this(message, 1);
+        this(message, DEFAULT_EXCEPTION_EXIT_CODE);
     }
 
     public CliException(String message, int exitCode) {
@@ -32,7 +34,7 @@ public class CliException extends Except
     }
 
     public CliException(Throwable cause) {
-        this(cause, 1);
+        this(cause, DEFAULT_EXCEPTION_EXIT_CODE);
     }
 
     public CliException(Throwable cause, int exitCode) {
@@ -41,7 +43,7 @@ public class CliException extends Except
     }
 
     public CliException(String message, Throwable cause) {
-        super(message, cause);
+        this(message, cause, DEFAULT_EXCEPTION_EXIT_CODE);
     }
 
     public CliException(String message, Throwable cause, int exitCode) {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/ZooKeeperTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/ZooKeeperTest.java?rev=1755786&r1=1755785&r2=1755786&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/ZooKeeperTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/ZooKeeperTest.java Wed Aug 10 17:32:22
2016
@@ -336,6 +336,11 @@ public class ZooKeeperTest extends Clien
     }
 
     @Test
+    public void testDeleteNonexistantNode() throws Exception {
+        testInvalidCommand("delete /blahblahblah", 1);
+    }
+
+    @Test
     public void testStatCommand() throws Exception {
         final ZooKeeper zk = createClient();
         ZooKeeperMain zkMain = new ZooKeeperMain(zk);



Mime
View raw message