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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user