[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Koch reopened ZOOKEEPER-1220:
------------------------------------


Thank you for your contribution. However could we change the new testcase 
ZooKeeperTest.testCreateNodeWithoutData() a bit?
The test asserts the exact wording of the exception message in case of an 
illegal Path. Therefor this test failed for me, since I'm also reworking the 
internal path handling of ZK and changed the message a bit.
I think the exact exception message is not part of the public API and therefor 
should not be asserted in a test. Only the type of the exception should be 
tested.
                
> ./zkCli.sh 'create' command is throwing ArrayIndexOutOfBoundsException
> ----------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1220
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1220
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.3.3
>            Reporter: kavita sharma
>            Assignee: kavita sharma
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1220.1.patch, ZOOKEEPER-1220.patch
>
>
> Few problems while executing create command,
>  
> If we will give command like 
>  
> 1)[zk: localhost:2181(CONNECTED) 0] create -s -e /node1
> {noformat}
>        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
>       at 
> org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:692)
>       at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:593)
>       at 
> org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:365)
>       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:323)
>       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:282)
> {noformat}
>       but actually it should create emphemeral sequential node.
> 2)[zk: localhost:2181(CONNECTED) 0] create -s -e
> {noformat}
>     Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
> {noformat}
>     here it should print the list of commands that is the default behaviour 
> of zkCli for invalid/incomplete commands.
> 3)[zk: localhost:2181(CONNECTED) 3] create -s -e "data"
> {noformat}
>      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
> {noformat}
>      here command is wrong so it should print list of commnads. . 
> 4)[zk: localhost:2181(CONNECTED) 0] create /node1
>     zkCli is treating it as a invalid command.because for args.length  check 
> (3)is their but behaviour is 
>     if user haven't given any of the option it should create persistent node.
>         {noformat}
>         if (cmd.equals("create") && args.length >= 3) {
>             int first = 0;
>             CreateMode flags = CreateMode.PERSISTENT;
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to