Search in sources :

Example 6 with InMemoryModule

use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.

the class OpenIdRealmTest method setUpInjector.

@Before
public void setUpInjector() throws Exception {
    Injector injector = Guice.createInjector(new InMemoryModule());
    injector.injectMembers(this);
}
Also used : Injector(com.google.inject.Injector) InMemoryModule(com.google.gerrit.testing.InMemoryModule) Before(org.junit.Before)

Example 7 with InMemoryModule

use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.

the class LdapRealmTest method setUpInjector.

@Before
public void setUpInjector() throws Exception {
    Injector injector = Guice.createInjector(new InMemoryModule(), new CacheModule() {

        @Override
        protected void configure() {
            cache(GROUP_CACHE, String.class, new TypeLiteral<Set<AccountGroup.UUID>>() {
            }).loader(LdapRealm.MemberLoader.class);
            cache(USERNAME_CACHE, String.class, new TypeLiteral<Optional<Account.Id>>() {
            }).loader(LdapRealm.UserLoader.class);
            cache(GROUP_EXIST_CACHE, String.class, new TypeLiteral<Boolean>() {
            }).loader(LdapRealm.ExistenceLoader.class);
            cache(PARENT_GROUPS_CACHE, String.class, new TypeLiteral<ImmutableSet<String>>() {
            });
        }
    });
    injector.injectMembers(this);
}
Also used : Account(com.google.gerrit.entities.Account) ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) Optional(java.util.Optional) CacheModule(com.google.gerrit.server.cache.CacheModule) AccountGroup(com.google.gerrit.entities.AccountGroup) TypeLiteral(com.google.inject.TypeLiteral) Injector(com.google.inject.Injector) InMemoryModule(com.google.gerrit.testing.InMemoryModule) Before(org.junit.Before)

Example 8 with InMemoryModule

use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.

the class DiffOperationsTest method setUpInjector.

@Before
public void setUpInjector() throws Exception {
    Injector injector = Guice.createInjector(new InMemoryModule());
    injector.injectMembers(this);
    repo = repoManager.createRepository(testProjectName);
}
Also used : Injector(com.google.inject.Injector) InMemoryModule(com.google.gerrit.testing.InMemoryModule) Before(org.junit.Before)

Example 9 with InMemoryModule

use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.

the class FakeQueryChangesTest method createInjector.

@Override
protected Injector createInjector() {
    Config fakeConfig = new Config(config);
    InMemoryModule.setDefaults(fakeConfig);
    fakeConfig.setString("index", null, "type", "fake");
    return Guice.createInjector(new InMemoryModule(fakeConfig));
}
Also used : Config(org.eclipse.jgit.lib.Config) InMemoryModule(com.google.gerrit.testing.InMemoryModule)

Example 10 with InMemoryModule

use of com.google.gerrit.testing.InMemoryModule in project gerrit by GerritCodeReview.

the class FakeQueryGroupsTest method createInjector.

@Override
protected Injector createInjector() {
    Config fakeConfig = new Config(config);
    InMemoryModule.setDefaults(fakeConfig);
    fakeConfig.setString("index", null, "type", "fake");
    return Guice.createInjector(new InMemoryModule(fakeConfig));
}
Also used : Config(org.eclipse.jgit.lib.Config) IndexConfig(com.google.gerrit.testing.IndexConfig) InMemoryModule(com.google.gerrit.testing.InMemoryModule)

Aggregations

InMemoryModule (com.google.gerrit.testing.InMemoryModule)19 Before (org.junit.Before)11 Injector (com.google.inject.Injector)9 Config (org.eclipse.jgit.lib.Config)9 IndexConfig (com.google.gerrit.testing.IndexConfig)6 LifecycleManager (com.google.gerrit.lifecycle.LifecycleManager)2 Repository (org.eclipse.jgit.lib.Repository)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Account (com.google.gerrit.entities.Account)1 AccountGroup (com.google.gerrit.entities.AccountGroup)1 LabelType (com.google.gerrit.entities.LabelType)1 CacheModule (com.google.gerrit.server.cache.CacheModule)1 MetaDataUpdate (com.google.gerrit.server.git.meta.MetaDataUpdate)1 ProjectConfig (com.google.gerrit.server.project.ProjectConfig)1 TypeLiteral (com.google.inject.TypeLiteral)1 Optional (java.util.Optional)1 Set (java.util.Set)1 DfsRepositoryDescription (org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription)1 InMemoryRepository (org.eclipse.jgit.internal.storage.dfs.InMemoryRepository)1 TestRepository (org.eclipse.jgit.junit.TestRepository)1