[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2017-01-31 Thread rakeshadr
Github user rakeshadr closed the pull request at:

https://github.com/apache/zookeeper/pull/131


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2016-12-21 Thread rakeshadr
Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/131#discussion_r93579277
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java 
---
@@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
 return connectStr.toString();
 }
 
-protected int[] startQuorum(final int serverCount, StringBuilder 
connectStr,
-Map authConfigs, int authServerCount) throws 
IOException {
+/**
+ * Starts the given number of quorum servers and will wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected String startQuorum(final int serverCount, int ObserverCount,
+Map authConfigs, int authServerCount)
+throws IOException {
+StringBuilder connectStr = new StringBuilder();
+final int[] clientPorts = startQuorum(serverCount, 0, connectStr,
+authConfigs, authServerCount);
+for (int i = 0; i < serverCount; i++) {
+Assert.assertTrue("waiting for server " + i + " being up",
+ClientBase.waitForServerUp("127.0.0.1:" + 
clientPorts[i],
+ClientBase.CONNECTION_TIMEOUT));
+}
+return connectStr.toString();
+}
+
+/**
+ * Starts the given number of quorum servers and won't wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param connectStr
+ *connection string where clients can used for connection
+ *establishment
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected int[] startQuorum(final int serverCount, int ObserverCount,
--- End diff --

Done


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2016-12-21 Thread rakeshadr
Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/131#discussion_r93579253
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java 
---
@@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
 return connectStr.toString();
 }
 
-protected int[] startQuorum(final int serverCount, StringBuilder 
connectStr,
-Map authConfigs, int authServerCount) throws 
IOException {
+/**
+ * Starts the given number of quorum servers and will wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected String startQuorum(final int serverCount, int ObserverCount,
--- End diff --

Changed to "observerCount"


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2016-12-21 Thread rgs1
Github user rgs1 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/131#discussion_r93572633
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java 
---
@@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
 return connectStr.toString();
 }
 
-protected int[] startQuorum(final int serverCount, StringBuilder 
connectStr,
-Map authConfigs, int authServerCount) throws 
IOException {
+/**
+ * Starts the given number of quorum servers and will wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected String startQuorum(final int serverCount, int ObserverCount,
--- End diff --

why is ObserverCount uppercased and also why is not used?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2016-12-21 Thread rgs1
Github user rgs1 commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/131#discussion_r93572708
  
--- Diff: 
src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumAuthTestBase.java 
---
@@ -78,15 +78,73 @@ protected String startQuorum(final int serverCount,
 return connectStr.toString();
 }
 
-protected int[] startQuorum(final int serverCount, StringBuilder 
connectStr,
-Map authConfigs, int authServerCount) throws 
IOException {
+/**
+ * Starts the given number of quorum servers and will wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected String startQuorum(final int serverCount, int ObserverCount,
+Map authConfigs, int authServerCount)
+throws IOException {
+StringBuilder connectStr = new StringBuilder();
+final int[] clientPorts = startQuorum(serverCount, 0, connectStr,
+authConfigs, authServerCount);
+for (int i = 0; i < serverCount; i++) {
+Assert.assertTrue("waiting for server " + i + " being up",
+ClientBase.waitForServerUp("127.0.0.1:" + 
clientPorts[i],
+ClientBase.CONNECTION_TIMEOUT));
+}
+return connectStr.toString();
+}
+
+/**
+ * Starts the given number of quorum servers and won't wait for the 
quorum
+ * formation.
+ *
+ * @param serverCount
+ *total server count includes participants + observers
+ * @param ObserverCount
+ *number of observers
+ * @param connectStr
+ *connection string where clients can used for connection
+ *establishment
+ * @param authConfigs
+ *configuration parameters for authentication
+ * @param authServerCount
+ *number of auth enabled servers
+ * @return client port for the respective servers
+ * @throws IOException
+ */
+protected int[] startQuorum(final int serverCount, int ObserverCount,
--- End diff --

ditto about variable ObserverCount being uppercased 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #131: ZOOKEEPER-2650: Test Improvement by adding more...

2016-12-21 Thread rakeshadr
GitHub user rakeshadr opened a pull request:

https://github.com/apache/zookeeper/pull/131

ZOOKEEPER-2650: Test Improvement by adding more QuorumPeer Auth relat…



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/rakeshadr/zookeeper-1 ZK-2650

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/zookeeper/pull/131.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #131


commit 46b438e968300c61b10f7e8966fccbde85f84637
Author: Rakesh Radhakrishnan 
Date:   2016-12-21T15:24:55Z

ZOOKEEPER-2650: Test Improvement by adding more QuorumPeer Auth related 
test cases




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---