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:42:46 GMT
Updated Branches:
  refs/heads/master 5f8896865 -> a0fd157b6


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/98980fe2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/98980fe2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/98980fe2

Branch: refs/heads/master
Commit: 98980fe28e762df6f297a25a990ccc2dcc7265c0
Parents: 5f88968
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 09:42:28 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/98980fe2/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 336e8b3..b216d37 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