Repository: incubator-blur
Updated Branches:
  refs/heads/master 3f9079a1d -> 016a38656


Updates to the test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/cc1a2301
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/cc1a2301
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/cc1a2301

Branch: refs/heads/master
Commit: cc1a2301167a11692e6fb5d75a2bebed799d9a01
Parents: 3f9079a
Author: Aaron McCurry <[email protected]>
Authored: Mon Jan 19 15:28:45 2015 -0500
Committer: Aaron McCurry <[email protected]>
Committed: Mon Jan 19 15:28:45 2015 -0500

----------------------------------------------------------------------
 .../org/apache/blur/thrift/BlurClientTest.java  | 26 ++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/cc1a2301/blur-core/src/test/java/org/apache/blur/thrift/BlurClientTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/thrift/BlurClientTest.java 
b/blur-core/src/test/java/org/apache/blur/thrift/BlurClientTest.java
index 7d1834e..dd8cf65 100644
--- a/blur-core/src/test/java/org/apache/blur/thrift/BlurClientTest.java
+++ b/blur-core/src/test/java/org/apache/blur/thrift/BlurClientTest.java
@@ -16,9 +16,11 @@
  */
 package org.apache.blur.thrift;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.blur.MiniCluster;
@@ -27,6 +29,8 @@ import org.apache.blur.thrift.generated.Blur.Iface;
 import org.apache.blur.thrift.generated.BlurException;
 import org.junit.Test;
 
+import com.google.common.base.Splitter;
+
 public class BlurClientTest {
   private static final File TMPDIR = new 
File(System.getProperty("blur.tmp.dir", "./target/tmp_BlurClientTest"));
 
@@ -38,18 +42,36 @@ public class BlurClientTest {
     cluster1.startBlurCluster(new File(testDirectory, 
"cluster1").getAbsolutePath(), 1, 1, true, false);
 
     MiniCluster cluster2 = new MiniCluster();
-    cluster2.startBlurCluster(new File(testDirectory, 
"cluster2").getAbsolutePath(), 1, 1, true, false);
+    cluster2.startBlurCluster(new File(testDirectory, 
"cluster2").getAbsolutePath(), 2, 1, true, false);
 
     Iface client1 = 
BlurClient.getClientFromZooKeeperConnectionStr(cluster1.getZkConnectionString());
     Iface client2 = 
BlurClient.getClientFromZooKeeperConnectionStr(cluster2.getZkConnectionString());
 
     List<String> controllerServerList1 = client1.controllerServerList();
+    List<String> controllerServerList1FromConnectionStr = 
getList(cluster1.getControllerConnectionStr());
     List<String> controllerServerList2 = client2.controllerServerList();
+    List<String> controllerServerList2FromConnectionStr = 
getList(cluster2.getControllerConnectionStr());
+
+    Collections.sort(controllerServerList1);
+    Collections.sort(controllerServerList1FromConnectionStr);
+    Collections.sort(controllerServerList2);
+    Collections.sort(controllerServerList2FromConnectionStr);
 
     cluster1.shutdownBlurCluster();
     cluster2.shutdownBlurCluster();
 
+    assertEquals(controllerServerList1FromConnectionStr, 
controllerServerList1);
+    assertEquals(controllerServerList2FromConnectionStr, 
controllerServerList2);
     assertFalse(controllerServerList1.equals(controllerServerList2));
 
   }
+
+  private List<String> getList(String controllerConnectionStr) {
+    Splitter splitter = Splitter.on(',');
+    List<String> results = new ArrayList<String>();
+    for (String s : splitter.split(controllerConnectionStr)) {
+      results.add(s);
+    }
+    return results;
+  }
 }

Reply via email to