Permalink
Browse files

added subcols count

  • Loading branch information...
zznate
zznate committed Nov 8, 2011
1 parent bafe62b commit 1aa93e78257e86dfc73390cb9c4db52d8ed29a69
@@ -175,6 +175,25 @@ public void testDeleteSubColumns() {
assertEquals(2, result.getColumnNames().size());
}
+ @Test
+ public void testCountSubColumns() {
+ SuperCfTemplate<String, String, String> sTemplate =
+ new ThriftSuperCfTemplate<String, String, String>(keyspace, "Super1", se, se, se);
+ SuperCfUpdater sUpdater = sTemplate.createUpdater("skey3","super1");
+ for (int i = 0; i < 500; i++) {
+ sUpdater.setString("sub1_col_"+i, "sub1_val_"+i);
+ }
+
+ sTemplate.update(sUpdater);
+
+ int countVal = sTemplate.countSubColumns("skey3", "super1");
+
+ SuperCfResult<String,String,String> result = sTemplate.querySuperColumn("skey3","super1");
+ assertEquals(countVal, result.getColumnNames().size());
+
+
+ }
+
@Test
public void testTemplateLevelDeleteSuper() {
SuperCfTemplate<String, String, String> sTemplate =

0 comments on commit 1aa93e7

Please sign in to comment.