Elasticsearch: Add tests for queries against version 5
Add separate test classes to test queries with Elasticsearch version 5. The entire test classes are basically copied from the existing ones, with the only difference being the version passed into the config and into the container creation. This cannot be achieved using an abstract class due to the container being created in the @BeforeClass annotated method which is static and cannot be overridden by a derived class. The byOwnerInvalidQuery test is moved up from ElasticQueryChangesTest to AbstractQueryChangesTest to avoid having to repeat it in all the Elasticsearch test classes. Bug: Issue 6094 Change-Id: I9b91cbcbc24924dce43b1be9530543097b5fd174
This commit is contained in:
@@ -2197,6 +2197,14 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
||||
assertQuery("query:query4");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byOwnerInvalidQuery() throws Exception {
|
||||
TestRepository<Repo> repo = createProject("repo");
|
||||
insert(repo, newChange(repo), userId);
|
||||
String nameEmail = user.asIdentifiedUser().getNameEmail();
|
||||
assertQuery("owner: \"" + nameEmail + "\"\\");
|
||||
}
|
||||
|
||||
protected ChangeInserter newChange(TestRepository<Repo> repo) throws Exception {
|
||||
return newChange(repo, null, null, null, null);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ public class LuceneQueryChangesTest extends AbstractQueryChangesTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Override
|
||||
public void byOwnerInvalidQuery() throws Exception {
|
||||
TestRepository<Repo> repo = createProject("repo");
|
||||
Change change1 = insert(repo, newChange(repo), userId);
|
||||
|
||||
Reference in New Issue
Block a user