curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ChenYangWen (JIRA)" <>
Subject [jira] [Created] (CURATOR-282) In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace
Date Thu, 26 Nov 2015 13:12:10 GMT
ChenYangWen created CURATOR-282:

             Summary: In consist behavior for create EPHEMERAL_SEQUENTIAL with usingNamespace
                 Key: CURATOR-282
             Project: Apache Curator
          Issue Type: Bug
    Affects Versions: 3.0.0
            Reporter: ChenYangWen
            Assignee: Jordan Zimmerman

Here is a junit test write in groovy.

import org.apache.curator.framework.CuratorFramework
import org.apache.curator.framework.CuratorFrameworkFactory
import org.apache.curator.retry.RetryOneTime
import org.apache.curator.test.TestingServer
import org.apache.zookeeper.CreateMode
import org.junit.After
import org.junit.Before
import org.junit.Test

public class PlayZK {
    private TestingServer server
    private CuratorFramework client

    public void setup() {
        server = new TestingServer(8788)
        println "ConnectString: " + server.getConnectString()
        client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(8000))

    public void issues() {
        println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/test/data/sub");
        println "Create " + client.create().creatingParentContainersIfNeeded().forPath("/sub");
        println "Create sub " + client.create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")
        println "Create sub " + client.usingNamespace("test/data").create().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath("/sub/")

        println "Expected sub"
        client.children.forPath("/test/data").each {println it}
        println "Expected 0000000000"
        client.children.forPath("/test/data/sub").each {println it}
        println "Expected 0000000000"
        client.children.forPath("/sub").each {println it}

    public void down() {

// will create /test/data/sub0000000001

// will create /test/data/sub/0000000000

Which one is expected ?

This message was sent by Atlassian JIRA

View raw message