Skip to content

Instantly share code, notes, and snippets.

@rantav
Created April 28, 2010 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rantav/382575 to your computer and use it in GitHub Desktop.
Save rantav/382575 to your computer and use it in GitHub Desktop.
/**
* Test insertion of a supercolumn using insert
*/
@Test
public void testInsertSuper() throws IllegalArgumentException, NoSuchElementException,
IllegalStateException, NotFoundException, Exception {
// insert value
ColumnPath cp = new ColumnPath("Super1");
cp.setColumn(bytes("testInsertSuper_column"));
cp.setSuper_column(bytes("testInsertSuper_super"));
keyspace.insert("testInsertSuper_key", cp, bytes("testInsertSuper_value"));
// get value and assert
SuperColumn sc = keyspace.getSuperColumn("testInsertSuper_key", cp);
assertNotNull(sc);
assertEquals("testInsertSuper_super", string(sc.getName()));
assertEquals(1, sc.getColumns().size());
assertEquals("testInsertSuper_value", string(sc.getColumns().get(0).getValue()));
// remove value
keyspace.remove("testInsertSuper_super", cp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment