use of com.google.gerrit.lifecycle.LifecycleManager in project gerrit by GerritCodeReview.
the class ProjectControlTest method setUp.
@Before
public void setUp() throws Exception {
Injector injector = Guice.createInjector(new InMemoryModule());
injector.injectMembers(this);
lifecycle = new LifecycleManager();
lifecycle.add(injector);
lifecycle.start();
db = schemaFactory.open();
schemaCreator.create(db);
// Need to create at least one user to be admin before creating a "normal"
// registered user.
// See AccountManager#create().
accountManager.authenticate(AuthRequest.forUser("admin")).getAccountId();
admins = groupCache.get(new AccountGroup.NameKey("Administrators")).getGroupUUID();
setUpPermissions();
Account.Id userId = accountManager.authenticate(AuthRequest.forUser("user")).getAccountId();
user = userFactory.create(userId);
Project.NameKey name = new Project.NameKey("project");
InMemoryRepository inMemoryRepo = repoManager.createRepository(name);
project = new ProjectConfig(name);
project.load(inMemoryRepo);
repo = new TestRepository<>(inMemoryRepo);
requestContext.setContext(new RequestContext() {
@Override
public CurrentUser getUser() {
return user;
}
@Override
public Provider<ReviewDb> getReviewDbProvider() {
return Providers.of(db);
}
});
}
use of com.google.gerrit.lifecycle.LifecycleManager in project gerrit by GerritCodeReview.
the class ProcMetricModuleTest method setup.
@Before
public void setup() {
Injector injector = Guice.createInjector(new DropWizardMetricMaker.ApiModule());
LifecycleManager mgr = new LifecycleManager();
mgr.add(injector);
mgr.start();
injector.injectMembers(this);
}
use of com.google.gerrit.lifecycle.LifecycleManager in project gerrit by GerritCodeReview.
the class AbstractQueryGroupsTest method setUpInjector.
@Before
public void setUpInjector() throws Exception {
lifecycle = new LifecycleManager();
injector = createInjector();
lifecycle.add(injector);
injector.injectMembers(this);
lifecycle.start();
setUpDatabase();
}
use of com.google.gerrit.lifecycle.LifecycleManager in project gerrit by GerritCodeReview.
the class SchemaUpdaterTest method setUp.
@Before
public void setUp() throws Exception {
lifecycle = new LifecycleManager();
db = InMemoryDatabase.newDatabase(lifecycle);
lifecycle.start();
}
use of com.google.gerrit.lifecycle.LifecycleManager in project gerrit by GerritCodeReview.
the class AbstractQueryChangesTest method setUpInjector.
@Before
public void setUpInjector() throws Exception {
lifecycle = new LifecycleManager();
injector = createInjector();
lifecycle.add(injector);
injector.injectMembers(this);
lifecycle.start();
setUpDatabase();
}
Aggregations