incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Adding a test for the admin calls of a blur server.
Date Thu, 16 Jan 2014 14:41:55 GMT
Updated Branches:
  refs/heads/apache-blur-0.2 1bbc25438 -> 8e40f7b66


Adding a test for the admin calls of a blur server.


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

Branch: refs/heads/apache-blur-0.2
Commit: bdabc9b7f3218c08cdd51d66f7b830cf575cebbd
Parents: 1bbc254
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Thu Jan 16 08:01:29 2014 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Thu Jan 16 08:01:29 2014 -0500

----------------------------------------------------------------------
 .../org/apache/blur/thrift/BlurClusterTest.java | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bdabc9b7/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
index 48d3759..131412e 100644
--- a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
+++ b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTest.java
@@ -60,8 +60,10 @@ import org.apache.blur.thrift.generated.RecordMutation;
 import org.apache.blur.thrift.generated.RowMutation;
 import org.apache.blur.thrift.generated.Schema;
 import org.apache.blur.thrift.generated.Selector;
+import org.apache.blur.thrift.generated.ShardState;
 import org.apache.blur.thrift.generated.TableDescriptor;
 import org.apache.blur.thrift.util.BlurThriftHelper;
+import org.apache.blur.utils.BlurConstants;
 import org.apache.blur.utils.GCWatcher;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -123,6 +125,8 @@ public class BlurClusterTest {
     testLoadTable();
     start("testForEmptySchema");
     testForEmptySchema();
+    start("testAdminCalls");
+    testAdminCalls();
     start("testQueryWithSelector");
     testQueryWithSelector();
     start("testQueryWithFacets");
@@ -143,6 +147,22 @@ public class BlurClusterTest {
     testCreateTableWithCustomType();
   }
 
+  private void testAdminCalls() throws BlurException, TException {
+    Blur.Iface client = getClient();
+    List<String> shardClusterList = client.shardClusterList();
+    assertEquals(1, shardClusterList.size());
+    assertEquals(BlurConstants.DEFAULT, shardClusterList.get(0));
+    
+    Map<String, String> shardServerLayout = client.shardServerLayout("test");
+    assertEquals(5, shardServerLayout.size());
+    
+    Map<String, Map<String, ShardState>> shardServerLayoutState = client.shardServerLayoutState("test");
+    assertEquals(5, shardServerLayoutState.size());
+    
+    List<String> shardServerList = client.shardServerList(BlurConstants.DEFAULT);
+    assertEquals(3, shardServerList.size());
+  }
+
   private void start(String name) {
     System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
     System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<");


Mime
View raw message