Randgalt commented on a change in pull request #395:
URL: https://github.com/apache/curator/pull/395#discussion_r691149748



##########
File path: 
curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java
##########
@@ -57,11 +57,11 @@ public void testBasic()
         assertFalse(path.startsWith(ZPath.root.child("two")));
 
         ZPath checkIdLike = ZPath.parse("/one/{two}/three");

Review comment:
       The contract for `ZPath.parse()` is that it does _not_ recognize 
parameters. This is why the original test is `assertFalse`. This PR changes 
this contract. `parseWithIds()` should be used instead.

##########
File path: 
curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java
##########
@@ -57,11 +57,11 @@ public void testBasic()
         assertFalse(path.startsWith(ZPath.root.child("two")));
 
         ZPath checkIdLike = ZPath.parse("/one/{two}/three");

Review comment:
       > Perhaps additional documentation would be helpful here (which I'm 
happy to help with).
   
   We'd really appreciate that!
   
   > n the parseWithId's method, I see a "TODO"
   
   Man - I don't remember :( the code looks good to me now though
   
   > Do you concur that the original problem of having something like "/root" 
as the first parameter should be considered valid?
   
   I'm not sure. Curator (and ZooKeeper itself) has historically had a lot of 
trouble with leading slashes and the root path (`/`). I'd like to see copious 
testing on this if we were to make a change. For example, over the years we've 
gotten PRs trying to change how `ZKPaths.java` works and they all introduce 
problems. I'm not saying the way it's implemented is ideal but that it may be 
too late on this.

##########
File path: 
curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java
##########
@@ -57,11 +57,11 @@ public void testBasic()
         assertFalse(path.startsWith(ZPath.root.child("two")));
 
         ZPath checkIdLike = ZPath.parse("/one/{two}/three");

Review comment:
       Up to you - whatever is easiest

##########
File path: 
curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestZPath.java
##########
@@ -57,11 +57,11 @@ public void testBasic()
         assertFalse(path.startsWith(ZPath.root.child("two")));
 
         ZPath checkIdLike = ZPath.parse("/one/{two}/three");

Review comment:
       `ZPath.parse()` doesn't consider IDs. The use-case here people who put 
things in their path that look like ZPath IDs. They don't want them considered 
as IDs and want them treated as normal paths. So, yes, it's correct in this 
test that isResolved() returns true. 




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to