Exemplo n.º 1
0
  @Test
  public void testSimpleDelete() {

    metadataStore.write("a/repo", "");
    assertEquals("", metadataStore.read("a/repo").get().getOrigin());

    metadataStore.delete("a/repo");
    assertFalse(metadataStore.read("a/repo").isPresent());
  }
Exemplo n.º 2
0
  @Test
  public void testComplexForkTracking() {

    metadataStore.write("b/repo", "a/repo");
    metadataStore.write("c/repo", "b/repo");
    metadataStore.write("d/repo", "c/repo");

    assertEquals("c/repo", metadataStore.read("d/repo").get().getOrigin());
    assertEquals("b/repo", metadataStore.read("c/repo").get().getOrigin());
    assertEquals("a/repo", metadataStore.read("b/repo").get().getOrigin());

    assertEquals("b/repo", metadataStore.read("a/repo").get().getForks().get(0));
    assertEquals("c/repo", metadataStore.read("b/repo").get().getForks().get(0));
    assertEquals("d/repo", metadataStore.read("c/repo").get().getForks().get(0));
  }
Exemplo n.º 3
0
  @Test
  public void testComplexDelete() {

    metadataStore.write("b/repo", "a/repo");
    metadataStore.write("c/repo", "b/repo");
    metadataStore.write("d/repo", "c/repo");

    metadataStore.delete("c/repo");

    assertEquals("", metadataStore.read("d/repo").get().getOrigin());
    assertEquals("a/repo", metadataStore.read("b/repo").get().getOrigin());

    assertEquals("b/repo", metadataStore.read("a/repo").get().getForks().get(0));
    assertEquals(0, metadataStore.read("b/repo").get().getForks().size());
    assertFalse(metadataStore.read("c/repo").isPresent());
  }