Search in sources :

Example 6 with InMemoryRepositoryManager

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

the class RepoSequenceTest method setUp.

@Before
public void setUp() throws Exception {
    repoManager = new InMemoryRepositoryManager();
    project = Project.nameKey("project");
    repoManager.createRepository(project);
}
Also used : InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) Before(org.junit.Before)

Example 7 with InMemoryRepositoryManager

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

the class ProjectResetterTest method setUp.

@Before
public void setUp() throws Exception {
    repoManager = new InMemoryRepositoryManager();
    project = Project.nameKey("foo");
    repo = repoManager.createRepository(project);
}
Also used : InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) Before(org.junit.Before)

Example 8 with InMemoryRepositoryManager

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

the class GerritServer method restart.

public static GerritServer restart(GerritServer server, @Nullable Module testSysModule, @Nullable Module testSshModule) throws Exception {
    checkState(server.desc.sandboxed(), "restarting as slave requires @Sandboxed");
    Config cfg = server.testInjector.getInstance(Key.get(Config.class, GerritServerConfig.class));
    Path site = server.testInjector.getInstance(Key.get(Path.class, SitePath.class));
    InMemoryRepositoryManager inMemoryRepoManager = null;
    if (hasBinding(server.testInjector, InMemoryRepositoryManager.class)) {
        inMemoryRepoManager = server.testInjector.getInstance(InMemoryRepositoryManager.class);
    }
    server.close();
    server.daemon.stop();
    return start(server.desc, cfg, site, testSysModule, null, testSshModule, inMemoryRepoManager);
}
Also used : Path(java.nio.file.Path) SitePath(com.google.gerrit.server.config.SitePath) GerritServerConfig(com.google.gerrit.server.config.GerritServerConfig) InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) Config(org.eclipse.jgit.lib.Config) GlobalPluginConfig(com.google.gerrit.acceptance.config.GlobalPluginConfig) GerritServerConfig(com.google.gerrit.server.config.GerritServerConfig) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) SitePath(com.google.gerrit.server.config.SitePath)

Example 9 with InMemoryRepositoryManager

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

the class NoteDbSchemaVersionCheckTest method setup.

@Before
public void setup() throws Exception {
    AllProjectsName allProjectsName = new AllProjectsName("All-Projects");
    GitRepositoryManager repoManager = new InMemoryRepositoryManager();
    repoManager.createRepository(allProjectsName);
    versionManager = new NoteDbSchemaVersionManager(allProjectsName, repoManager);
    versionManager.init();
    sitePaths = new SitePaths(Paths.get("/tmp/foo"));
}
Also used : AllProjectsName(com.google.gerrit.server.config.AllProjectsName) InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) GitRepositoryManager(com.google.gerrit.server.git.GitRepositoryManager) SitePaths(com.google.gerrit.server.config.SitePaths) Before(org.junit.Before)

Example 10 with InMemoryRepositoryManager

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

the class RepoViewTest method setUp.

@Before
public void setUp() throws Exception {
    InMemoryRepositoryManager repoManager = new InMemoryRepositoryManager();
    Project.NameKey project = Project.nameKey("project");
    repo = repoManager.createRepository(project);
    tr = new TestRepository<>(repo);
    tr.branch(MASTER).commit().create();
    view = new RepoView(repoManager, project);
}
Also used : Project(com.google.gerrit.entities.Project) InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) Before(org.junit.Before)

Aggregations

InMemoryRepositoryManager (com.google.gerrit.testing.InMemoryRepositoryManager)12 Before (org.junit.Before)9 GerritServerConfig (com.google.gerrit.server.config.GerritServerConfig)3 GitRepositoryManager (com.google.gerrit.server.git.GitRepositoryManager)3 PersonIdent (org.eclipse.jgit.lib.PersonIdent)3 GerritConfig (com.google.gerrit.acceptance.config.GerritConfig)2 GlobalPluginConfig (com.google.gerrit.acceptance.config.GlobalPluginConfig)2 Project (com.google.gerrit.entities.Project)2 AllProjectsName (com.google.gerrit.server.config.AllProjectsName)2 AllUsersName (com.google.gerrit.server.config.AllUsersName)2 SitePath (com.google.gerrit.server.config.SitePath)2 Path (java.nio.file.Path)2 Config (org.eclipse.jgit.lib.Config)2 Account (com.google.gerrit.entities.Account)1 FactoryModule (com.google.gerrit.extensions.config.FactoryModule)1 DisabledMetricMaker (com.google.gerrit.metrics.DisabledMetricMaker)1 MetricMaker (com.google.gerrit.metrics.MetricMaker)1 FanOutExecutor (com.google.gerrit.server.FanOutExecutor)1 GerritPersonIdent (com.google.gerrit.server.GerritPersonIdent)1 InternalUser (com.google.gerrit.server.InternalUser)1