Add a handful of tests for querying changes

This covers a good fraction of search operators for both SQL and
Lucene index types. Over the course of this several bugs and
inconsistencies in the existing implementations were discovered; some
have been fixed in previous changes, and some have the corresponding
assertions commented out in this change.

In addition to the few simple operators not yet covered, we do not yet
test many forms of compound queries.

Change-Id: I6e14116a56fc2a352f99bea930d6aed297c0749d
This commit is contained in:
Dave Borowitz
2013-10-10 17:32:01 -07:00
parent fac1fa5930
commit 1134051b48
7 changed files with 493 additions and 93 deletions

View File

@@ -113,6 +113,10 @@ public class ChangeInserter {
ChangeUtil.computeSortKey(change);
}
public Change getChange() {
return change;
}
public ChangeInserter setMessage(ChangeMessage changeMessage) {
this.changeMessage = changeMessage;
return this;
@@ -152,7 +156,7 @@ public class ChangeInserter {
return patchSetInfo;
}
public void insert() throws OrmException, IOException {
public Change insert() throws OrmException, IOException {
ReviewDb db = dbProvider.get();
db.changes().beginTransaction(change.getId());
try {
@@ -193,5 +197,6 @@ public class ChangeInserter {
}
}
indexFuture.checkedGet();
return change;
}
}