コード例 #1
0
  @Test
  public void testAppendAndGetIndex() throws IOException {
    final Meta meta1 = getMeta1();

    final Meta meta2 = getMeta2();

    // index meta1
    this.indexStore.append(meta1);

    // index meta2
    this.indexStore.append(meta2);

    // assert meta1
    Meta index = indexStore.getIndex(meta1.getKey());
    Assert.assertEquals(meta1.toString(), index.toString());

    // assert meta2
    index = indexStore.getIndex(meta2.getKey());
    Assert.assertEquals(meta2.toString(), index.toString());

    // assert get meta1 by tag
    index = indexStore.getIndex(meta1.getKey(), meta1.getTags().keySet().iterator().next());
    Assert.assertEquals(meta1.toString(), index.toString());
  }
コード例 #2
0
 /** @throws java.lang.Exception */
 @After
 public void tearDown() throws Exception {
   indexStore.close();
   indexStore.delete();
 }