zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] TisonKun commented on a change in pull request #839: ZOOKEEPER-3290: Throw detailed KeeperException when a transaction failed
Date Fri, 26 Apr 2019 16:54:57 GMT
TisonKun commented on a change in pull request #839: ZOOKEEPER-3290: Throw detailed KeeperException
when a transaction failed
URL: https://github.com/apache/zookeeper/pull/839#discussion_r279027598
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiTransactionTest.java
 ##########
 @@ -154,8 +154,17 @@ public void processResult(int rc, String path, Object ctx,
                 zk.multi(ops);
                 Assert.fail("Shouldn't have validated in ZooKeeper client!");
             } catch (KeeperException e) {
-                Assert.assertEquals("Wrong exception", expectedErr, e.code()
-                        .name());
+                String[] codeAndPath = expectedErr.split("@");
+                if (codeAndPath.length < 1 || codeAndPath.length > 2) {
+                    Assert.fail("Invalid exceptedErr=" + expectedErr);
+                }
+                Assert.assertEquals("Wrong exception", codeAndPath[0],
+                        e.code().name());
+
+                if (codeAndPath.length == 2) {
+                    Assert.assertEquals("Wrong exception", codeAndPath[1],
 
 Review comment:
   Addressed comment

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message