zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #279: ZOOKEEPER-2804:Node creation fails with NPE if ...
Date Sat, 08 Jul 2017 21:02:44 GMT
Github user hanm commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/279#discussion_r126290078
  
    --- Diff: src/java/test/org/apache/zookeeper/test/ACLTest.java ---
    @@ -189,4 +191,110 @@ public void process(WatchedEvent event) {
                 }
             }
         }
    +    
    +    @Test
    +    public void testNullACL() throws Exception {
    +        File tmpDir = ClientBase.createTmpDir();
    +        ClientBase.setupTestEnv();
    +        ZooKeeperServer zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
    +        final int PORT = Integer.parseInt(HOSTPORT.split(":")[1]);
    +        ServerCnxnFactory f = ServerCnxnFactory.createFactory(PORT, -1);
    +        f.startup(zks);
    +        ZooKeeper zk = ClientBase.createZKClient(HOSTPORT);
    +        try {
    +            // case 1 : null ACL with create
    +            try {
    +                zk.create("/foo", "foo".getBytes(), null, CreateMode.PERSISTENT);
    --- End diff --
    
    All tests can be consolidated into a single try block to avoid duplicate the boilerplate
code. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message