zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] eolivelli commented on a change in pull request #787: ZOOKEEPER-3253: client should not send requests with cxid=-4, -2, or -1
Date Fri, 25 Jan 2019 22:02:21 GMT
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message