Search in sources :

Example 1 with RevisionSegment

use of com.b2international.index.revision.RevisionSegment in project snow-owl by b2ihealthcare.

the class SnomedBranchRequestTest method assertBranchSegmentsValid.

// assert the low level segments
private void assertBranchSegmentsValid(final String parentPath, final String createdFirstPath, final String createdSecondPath) {
    BaseRevisionBranching branching = ApplicationContext.getServiceForClass(RepositoryManager.class).get(REPOSITORY_ID).service(BaseRevisionBranching.class);
    RevisionBranch parent = branching.getBranch(parentPath);
    RevisionBranch createdFirst = branching.getBranch(createdFirstPath);
    RevisionBranch createdSecond = branching.getBranch(createdSecondPath);
    SortedSet<RevisionSegment> firstParentSegments = createdFirst.getParentSegments();
    SortedSet<RevisionSegment> secondParentSegments = createdSecond.getParentSegments();
    // verify that first and second has a common parent start address (END address is their base timestamp, so that will be different)
    assertEquals(firstParentSegments.last().getStartAddress(), secondParentSegments.last().getStartAddress());
    assertNotEquals(firstParentSegments.last().getEndAddress(), secondParentSegments.last().getEndAddress());
    // and parent-parent-segments of first and second are equal
    assertEquals(firstParentSegments.headSet(firstParentSegments.last()), secondParentSegments.headSet(secondParentSegments.last()));
}
Also used : RevisionBranch(com.b2international.index.revision.RevisionBranch) RevisionSegment(com.b2international.index.revision.RevisionSegment) BaseRevisionBranching(com.b2international.index.revision.BaseRevisionBranching)

Aggregations

BaseRevisionBranching (com.b2international.index.revision.BaseRevisionBranching)1 RevisionBranch (com.b2international.index.revision.RevisionBranch)1 RevisionSegment (com.b2international.index.revision.RevisionSegment)1