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()));
}
Aggregations