Search in sources :

Example 36 with ProjectInfo

use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.

the class AbstractQueryProjectsTest method asAnonymous.

@Test
public void asAnonymous() throws Exception {
    ProjectInfo project = createProjectRestrictedToRegisteredUsers(name("project"));
    setAnonymous();
    assertQuery("name:" + project.name);
}
Also used : ProjectInfo(com.google.gerrit.extensions.common.ProjectInfo) Test(org.junit.Test)

Example 37 with ProjectInfo

use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.

the class AbstractQueryProjectsTest method format.

protected String format(Iterable<ProjectInfo> projects) {
    StringBuilder b = new StringBuilder();
    b.append("[");
    Iterator<ProjectInfo> it = projects.iterator();
    while (it.hasNext()) {
        ProjectInfo p = it.next();
        b.append("{").append(p.id).append(", ").append("name=").append(p.name).append(", ").append("parent=").append(p.parent).append(", ").append("description=").append(p.description).append("}");
        if (it.hasNext()) {
            b.append(", ");
        }
    }
    b.append("]");
    return b.toString();
}
Also used : ProjectInfo(com.google.gerrit.extensions.common.ProjectInfo)

Example 38 with ProjectInfo

use of com.google.gerrit.extensions.common.ProjectInfo in project gerrit by GerritCodeReview.

the class AbstractQueryProjectsTest method createProjectWithState.

protected ProjectInfo createProjectWithState(String name, ProjectState state) throws Exception {
    ProjectInfo info = createProject(name);
    ConfigInput config = new ConfigInput();
    config.state = state;
    gApi.projects().name(info.name).config(config);
    return info;
}
Also used : ConfigInput(com.google.gerrit.extensions.api.projects.ConfigInput) ProjectInfo(com.google.gerrit.extensions.common.ProjectInfo)

Aggregations

ProjectInfo (com.google.gerrit.extensions.common.ProjectInfo)38 Test (org.junit.Test)25 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)15 ProjectAssert.assertProjectInfo (com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo)10 ProjectState (com.google.gerrit.server.project.ProjectState)10 Project (com.google.gerrit.entities.Project)8 ProjectInput (com.google.gerrit.extensions.api.projects.ProjectInput)5 ImmutableList (com.google.common.collect.ImmutableList)3 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)3 Project (com.google.gerrit.reviewdb.client.Project)3 ProjectResource (com.google.gerrit.server.project.ProjectResource)3 ArrayList (java.util.ArrayList)3 Truth.assertThat (com.google.common.truth.Truth.assertThat)2 RestResponse (com.google.gerrit.acceptance.RestResponse)2 AccountGroup (com.google.gerrit.entities.AccountGroup)2 ConfigInput (com.google.gerrit.extensions.api.projects.ConfigInput)2 LabelTypeInfo (com.google.gerrit.extensions.common.LabelTypeInfo)2 WebLinkInfo (com.google.gerrit.extensions.common.WebLinkInfo)2 PermissionBackend (com.google.gerrit.server.permissions.PermissionBackend)2 PermissionBackendException (com.google.gerrit.server.permissions.PermissionBackendException)2