use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.
the class AbstractQueryProjectsTest method withStart.
@Test
public void withStart() throws Exception {
ProjectInfo project1 = createProject(name("project1"));
ProjectInfo project2 = createProject(name("project2"));
ProjectInfo project3 = createProject(name("project3"));
String query = "name:" + project1.name + " OR name:" + project2.name + " OR name:" + project3.name;
List<ProjectInfo> result = assertQuery(query, project1, project2, project3);
assertQuery(newQuery(query).withStart(1), result.subList(1, 3));
}
use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.
the class AbstractQueryProjectsTest method byName.
@Test
public void byName() throws Exception {
assertQuery("name:project");
assertQuery("name:non-existing");
ProjectInfo project = createProject(name("project"));
assertQuery("name:" + project.name, project);
// only exact match
ProjectInfo projectWithHyphen = createProject(name("project-with-hyphen"));
createProject(name("project-no-match-with-hyphen"));
assertQuery("name:" + projectWithHyphen.name, projectWithHyphen);
}
use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.
the class AbstractQueryProjectsTest method withLimit.
@Test
public void withLimit() throws Exception {
ProjectInfo project1 = createProject(name("project1"));
ProjectInfo project2 = createProject(name("project2"));
ProjectInfo project3 = createProject(name("project3"));
String query = "name:" + project1.name + " OR name:" + project2.name + " OR name:" + project3.name;
List<ProjectInfo> result = assertQuery(query, project1, project2, project3);
assertQuery(newQuery(query).withLimit(2), result.subList(0, 2));
}
use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.
the class AbstractQueryProjectsTest method sortedByName.
@Test
public void sortedByName() throws Exception {
ProjectInfo projectFoo = createProject("foo-" + name("project1"));
ProjectInfo projectBar = createProject("bar-" + name("project2"));
ProjectInfo projectBaz = createProject("baz-" + name("project3"));
String query = "name:" + projectFoo.name + " OR name:" + projectBar.name + " OR name:" + projectBaz.name;
assertQuery(newQuery(query), projectBar, projectBaz, projectFoo);
}
use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.
the class AbstractQueryProjectsTest method byState.
@Test
public void byState() throws Exception {
assume().that(getSchemaVersion() >= 2).isTrue();
ProjectInfo project1 = createProjectWithState(name("project1"), ProjectState.ACTIVE);
ProjectInfo project2 = createProjectWithState(name("project2"), ProjectState.READ_ONLY);
assertQuery("state:active", project1);
assertQuery("state:read-only", project2);
}
Aggregations