eolivelli commented on a change in pull request #787: ZOOKEEPER-3253: client 
should not send requests with cxid=-4, -2, or -1
URL: https://github.com/apache/zookeeper/pull/787#discussion_r251150647
 
 

 ##########
 File path: 
zookeeper-server/src/test/java/org/apache/zookeeper/TestableZooKeeper.java
 ##########
 @@ -35,6 +36,39 @@ public TestableZooKeeper(String host, int sessionTimeout,
             Watcher watcher) throws IOException {
         super(host, sessionTimeout, watcher);
     }
+
+    class TestableClientCnxn extends ClientCnxn {
+        TestableClientCnxn(String chrootPath, HostProvider hostProvider, int 
sessionTimeout, ZooKeeper zooKeeper,
+            ClientWatchManager watcher, ClientCnxnSocket clientCnxnSocket, 
boolean canBeReadOnly)
+                throws IOException {
+            super(chrootPath, hostProvider, sessionTimeout, zooKeeper, watcher,
+                clientCnxnSocket, 0, new byte[16], canBeReadOnly);
+        }
+
+        void setXid(int newXid) {
+            xid = newXid;
+        }
+
+        int checkXid() {
+            return xid;
+        }
+    }
+
+    protected ClientCnxn createConnection(String chrootPath,
 
 Review comment:
   what about overriding this method only in your new testcase?

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


With regards,
Apache Git Services

Reply via email to