/** * Tests translation of HBase qualifiers have multiple separators (the Kiji qualifier contains the * separator). */ @Test public void testMultipleSeparators() throws Exception { KijiColumnName kijiColumnName = mTranslator.toKijiColumnName(getHBaseColumnName("inMemory", "purchases:left:right")); assertEquals("purchases", kijiColumnName.getFamily()); assertEquals("left:right", kijiColumnName.getQualifier()); }
@Test public void testTranslateFromHBaseToKiji() throws Exception { KijiColumnName infoName = mTranslator.toKijiColumnName(getHBaseColumnName("default", "info:name")); assertEquals("info:name", infoName.toString()); KijiColumnName infoEmail = mTranslator.toKijiColumnName(getHBaseColumnName("default", "info:email")); assertEquals("info:email", infoEmail.toString()); KijiColumnName recommendationsProduct = mTranslator.toKijiColumnName(getHBaseColumnName("inMemory", "recommendations:product")); assertEquals("recommendations:product", recommendationsProduct.toString()); KijiColumnName purchases = mTranslator.toKijiColumnName(getHBaseColumnName("inMemory", "purchases:foo")); assertEquals("purchases:foo", purchases.toString()); }
/** * Tests that an exception is thrown when the first part of the HBase qualifier doesn't match a * Kiji family. */ @Test(expected = NoSuchColumnException.class) public void testNoSuchKijiFamily() throws Exception { mTranslator.toKijiColumnName(getHBaseColumnName("inMemory", "fakeFamily:fakeQualifier")); }
/** * Tests that an exception is thrown when the HBase family doesn't match a Kiji locality group. */ @Test(expected = NoSuchColumnException.class) public void testNoSuchKijiLocalityGroup() throws Exception { mTranslator.toKijiColumnName( getHBaseColumnName("fakeLocalityGroup", "fakeFamily:fakeQualifier")); }