use of com.b2international.index.revision.RevisionFixtures.RevisionData in project snow-owl by b2ihealthcare.
the class BranchBaseQueryTest method readBaseOfMainBranch.
@Test(expected = IllegalArgumentException.class)
public void readBaseOfMainBranch() throws Exception {
final RevisionData data = new RevisionData(STORAGE_KEY1, "field1", "field2");
indexRevision(MAIN, data);
final Iterable<RevisionData> hits = search(MAIN + RevisionIndex.BASE_REF_CHAR, Query.select(RevisionData.class).where(Expressions.matchAll()).build());
assertThat(hits).isEmpty();
}
use of com.b2international.index.revision.RevisionFixtures.RevisionData in project snow-owl by b2ihealthcare.
the class RevisionBranchAtTimestampQueryTest method branchAtExpression.
@Test
public void branchAtExpression() throws Exception {
final RevisionData rev1 = new RevisionData(STORAGE_KEY1, "field1", "field2");
final RevisionData rev2 = new RevisionData(STORAGE_KEY1, "field1Changed", "field2");
long commit1 = commit(MAIN, Collections.singleton(rev1)).getTimestamp();
long commit2 = commit(MAIN, Collections.singleton(rev2)).getTimestamp();
;
assertDocEquals(rev2, getRevision(MAIN, RevisionData.class, STORAGE_KEY1));
assertDocEquals(rev1, getRevision("MAIN@" + commit1, RevisionData.class, STORAGE_KEY1));
assertDocEquals(rev2, getRevision("MAIN@" + commit2, RevisionData.class, STORAGE_KEY1));
assertNull(getRevision("MAIN@0", RevisionData.class, STORAGE_KEY1));
}
Aggregations