Search in sources :

Example 11 with InMemoryRepositoryManager

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

the class CodeReviewCommitTest method createCommit.

private ObjectId createCommit() throws Exception {
    InMemoryRepositoryManager repoManager = new InMemoryRepositoryManager();
    Project.NameKey project = Project.nameKey("test");
    try (Repository repo = repoManager.createRepository(project);
        TestRepository<Repository> tr = new TestRepository<>(repo)) {
        PersonIdent ident = new PersonIdent(new PersonIdent("Test Ident", "test@test.com"));
        return tr.commit().author(ident).committer(ident).message("Test commit").create();
    }
}
Also used : Project(com.google.gerrit.entities.Project) TestRepository(org.eclipse.jgit.junit.TestRepository) Repository(org.eclipse.jgit.lib.Repository) TestRepository(org.eclipse.jgit.junit.TestRepository) InMemoryRepositoryManager(com.google.gerrit.testing.InMemoryRepositoryManager) PersonIdent(org.eclipse.jgit.lib.PersonIdent)

Example 12 with InMemoryRepositoryManager

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

the class StalenessCheckerTest method setUp.

@Before
public void setUp() throws Exception {
    repoManager = new InMemoryRepositoryManager();
    r1 = repoManager.createRepository(P1);
    tr1 = new TestRepository<>(r1);
    r2 = repoManager.createRepository(P2);
    tr2 = new TestRepository<>(r2);
}
Also used : 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