KijiTableKeyValueStore implements Configurable, KeyValueStore<KijiRowKeyComponents, V> { public static Builder builder() { return new Builder(); } KijiTableKeyValueStore(); private  KijiTableKeyValueStore(Builder builder); static Builder builder(); @Override void setConf(Configuration conf); @Override Configuration getConf(); @Override void storeToConf(KeyValueStoreConfiguration conf); @Override void initFromConf(KeyValueStoreConfiguration conf); @Override KeyValueStoreReader<KijiRowKeyComponents, V> open(); @Override boolean equals(Object otherObj); @Override int hashCode();  }
@Test public void testRequiresRealTable() throws IOException { final KijiURI tableURI = KijiURI.newBuilder(getKiji().getURI().toString() + "/table_name_not_real").build(); try { KijiTableKeyValueStore<String> input = KijiTableKeyValueStore.builder() .withTable(tableURI) .withColumn("some", "column") .withMinTimestamp(42) .withMaxTimestamp(512) .withCacheLimit(2121) .build(); fail("Should have thrown an IllegalArgumentException."); } catch (IllegalArgumentException iae) { assertEquals("Could not open table: " + tableURI, iae.getMessage()); } }
@Test public void testRequiresTableUri() { try { KijiTableKeyValueStore<String> input = KijiTableKeyValueStore.builder() .withColumn("some", "column") .withMinTimestamp(42) .withMaxTimestamp(512) .withCacheLimit(2121) .build(); fail("Should have thrown an IllegalArgumentException."); } catch (IllegalArgumentException iae) { assertEquals("Must specify non-null table URI", iae.getMessage()); } }
@Test public void testRequiresTableNameInUri() throws IOException { try { KijiTableKeyValueStore<String> input = KijiTableKeyValueStore.builder() .withTable(getKiji().getURI()) .withColumn("some", "column") .withMinTimestamp(42) .withMaxTimestamp(512) .withCacheLimit(2121) .build(); fail("Should have thrown an IllegalArgumentException."); } catch (IllegalArgumentException iae) { assertEquals("Must specify a non-empty table name", iae.getMessage()); } }
@Test public void testRequiresColumn() throws IOException { try { KijiTableKeyValueStore<String> input = KijiTableKeyValueStore.builder() .withTable( KijiURI.newBuilder(getKiji().getURI().toString()).withTableName("table").build()) .withMinTimestamp(42) .withMaxTimestamp(512) .withCacheLimit(2121) .build(); fail("Should have thrown an IllegalArgumentException."); } catch (IllegalArgumentException iae) { assertEquals("Must specify a fully-qualified column", iae.getMessage()); } }