コード例 #1
0
  @Test
  public void storeProjectWithParentAndVerifyParentRelationship() throws Exception {
    final ProjectVersionRef project =
        new SimpleProjectVersionRef("org.apache.maven", "maven-core", "3.0.3");
    final ProjectVersionRef parent =
        new SimpleProjectVersionRef("org.apache.maven", "maven", "3.0.3");

    final EProjectDirectRelationships rels =
        new EProjectDirectRelationships.Builder(sourceUri, project).withParent(parent).build();

    graph.storeRelationships(rels.getExactAllRelationships());

    final ProjectVersionRef parentResult = CartoGraphUtils.getParent(project, graph);
    assertThat(parentResult, equalTo(parent));
  }