Fix SchemaUpdaterTest and ListChildProjectsIT

The AllUsersName binding is required, but was missing.
The All-Users repository exists as a child of All-Users.

Change-Id: Iaf3ddec01c8a3419ceb044bc29f155f6f8eb0f68
This commit is contained in:
Shawn Pearce
2014-03-27 08:06:35 -07:00
parent c548fac493
commit eb206dfab5
2 changed files with 9 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ public class ListChildProjectsIT extends AbstractDaemonTest {
assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertEquals(HttpStatus.SC_OK, r.getStatusCode());
List<ProjectInfo> projectInfoList = toProjectInfoList(r); List<ProjectInfo> projectInfoList = toProjectInfoList(r);
// Project 'p' was already created in the base class // Project 'p' was already created in the base class
assertTrue(projectInfoList.size() == 1); assertTrue(projectInfoList.size() == 2);
} }
@Test @Test
@@ -67,7 +67,11 @@ public class ListChildProjectsIT extends AbstractDaemonTest {
RestResponse r = GET("/projects/" + allProjects.get() + "/children/"); RestResponse r = GET("/projects/" + allProjects.get() + "/children/");
assertEquals(HttpStatus.SC_OK, r.getStatusCode()); assertEquals(HttpStatus.SC_OK, r.getStatusCode());
assertProjects(Arrays.asList(existingProject, child1, child2), toProjectInfoList(r)); assertProjects(
Arrays.asList(
new Project.NameKey("All-Users"),
existingProject, child1, child2),
toProjectInfoList(r));
} }
@Test @Test

View File

@@ -19,6 +19,7 @@ import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.GerritPersonIdent; import com.google.gerrit.server.GerritPersonIdent;
import com.google.gerrit.server.GerritPersonIdentProvider; import com.google.gerrit.server.GerritPersonIdentProvider;
import com.google.gerrit.server.config.AllProjectsName; import com.google.gerrit.server.config.AllProjectsName;
import com.google.gerrit.server.config.AllUsersName;
import com.google.gerrit.server.config.AnonymousCowardName; import com.google.gerrit.server.config.AnonymousCowardName;
import com.google.gerrit.server.config.AnonymousCowardNameProvider; import com.google.gerrit.server.config.AnonymousCowardNameProvider;
import com.google.gerrit.server.config.FactoryModule; import com.google.gerrit.server.config.FactoryModule;
@@ -89,6 +90,8 @@ public class SchemaUpdaterTest {
bind(AllProjectsName.class) bind(AllProjectsName.class)
.toInstance(new AllProjectsName("All-Projects")); .toInstance(new AllProjectsName("All-Projects"));
bind(AllUsersName.class)
.toInstance(new AllUsersName("All-Users"));
bind(GitRepositoryManager.class) bind(GitRepositoryManager.class)
.toInstance(new InMemoryRepositoryManager()); .toInstance(new InMemoryRepositoryManager());