zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] anmolnar commented on a change in pull request #922: ZOOKEEPER-3361: Add multi version of getChildren request
Date Fri, 26 Apr 2019 13:06:11 GMT
anmolnar commented on a change in pull request #922: ZOOKEEPER-3361: Add multi version of getChildren
request
URL: https://github.com/apache/zookeeper/pull/922#discussion_r278937771
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/FinalRequestProcessorTest.java
 ##########
 @@ -227,4 +232,40 @@ private void assertMasked(boolean masked) {
         assertThat("Original ACL list has been modified", testACLs.get(2).getId().getScheme(),
equalTo("world"));
         assertThat("Original ACL list has been modified", testACLs.get(2).getId().getId(),
equalTo("anyone"));
     }
+
+    @Test
+    public void testGetChildrenList_Empty_List() throws IOException {
+        GetChildrenListRequest getChildrenListRequest = new GetChildrenListRequest();
+        getChildrenListRequest.setPathList(new ArrayList<>());
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
+        getChildrenListRequest.serialize(boa, "request");
+        baos.close();
+
+        Request r = new Request(cnxn, 0, 0, ZooDefs.OpCode.getChildrenList,
+                                ByteBuffer.wrap(baos.toByteArray()), new ArrayList<Id>());
+        processor.processRequest(r);
+
+        GetChildrenListResponse rsp = (GetChildrenListResponse)responseRecord[0];
+        assertTrue(rsp.getChildren().isEmpty());
+    }
+
+    @Test
+    public void testGetChildrenList_Normal() throws IOException {
+        GetChildrenListRequest getChildrenListRequest = new GetChildrenListRequest();
+        getChildrenListRequest.setPathList(Arrays.asList("/testPath", "/testPath"));
 
 Review comment:
   Why do you search for the same path twice?
   Is it a test case to validate the results won't be merged?

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