Search in sources :

Example 1 with DfsRepositoryDescription

use of org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription in project gitiles by GerritCodeReview.

the class PaginatorTest method setUp.

@Before
public void setUp() throws Exception {
    repo = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("test")));
    walk = new RevWalk(repo.getRepository());
}
Also used : InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) RevWalk(org.eclipse.jgit.revwalk.RevWalk) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Before(org.junit.Before)

Example 2 with DfsRepositoryDescription

use of org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription in project gitiles by GerritCodeReview.

the class RevisionParserTest method setUp.

@Before
public void setUp() throws Exception {
    repo = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("test")));
    parser = new RevisionParser(repo.getRepository(), new TestGitilesAccess(repo.getRepository()).forRequest(null), new VisibilityCache(false, CacheBuilder.newBuilder().maximumSize(0)));
}
Also used : InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Before(org.junit.Before)

Example 3 with DfsRepositoryDescription

use of org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription in project gitiles by GerritCodeReview.

the class GitwebRedirectFilterTest method setUp.

@Before
public void setUp() throws Exception {
    repo = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("test")));
    servlet = TestGitilesServlet.create(repo);
}
Also used : InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Before(org.junit.Before)

Example 4 with DfsRepositoryDescription

use of org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription in project gerrit by GerritCodeReview.

the class GerritPublicKeyCheckerTest method setUpInjector.

@Before
public void setUpInjector() throws Exception {
    Config cfg = InMemoryModule.newDefaultConfig();
    cfg.setInt("receive", null, "maxTrustDepth", 2);
    cfg.setStringList("receive", null, "trustedKey", ImmutableList.of(Fingerprint.toString(keyB().getPublicKey().getFingerprint()), Fingerprint.toString(keyD().getPublicKey().getFingerprint())));
    Injector injector = Guice.createInjector(new InMemoryModule(cfg, new TestNotesMigration()));
    lifecycle = new LifecycleManager();
    lifecycle.add(injector);
    injector.injectMembers(this);
    lifecycle.start();
    db = schemaFactory.open();
    schemaCreator.create(db);
    userId = accountManager.authenticate(AuthRequest.forUser("user")).getAccountId();
    Account userAccount = db.accounts().get(userId);
    // Note: does not match any key in TestKeys.
    userAccount.setPreferredEmail("user@example.com");
    db.accounts().update(ImmutableList.of(userAccount));
    user = reloadUser();
    requestContext.setContext(new RequestContext() {

        @Override
        public CurrentUser getUser() {
            return user;
        }

        @Override
        public Provider<ReviewDb> getReviewDbProvider() {
            return Providers.of(db);
        }
    });
    storeRepo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
    store = new PublicKeyStore(storeRepo);
}
Also used : Account(com.google.gerrit.reviewdb.client.Account) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) CurrentUser(com.google.gerrit.server.CurrentUser) Config(org.eclipse.jgit.lib.Config) LifecycleManager(com.google.gerrit.lifecycle.LifecycleManager) TestNotesMigration(com.google.gerrit.testutil.TestNotesMigration) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Provider(com.google.inject.Provider) Injector(com.google.inject.Injector) ThreadLocalRequestContext(com.google.gerrit.server.util.ThreadLocalRequestContext) RequestContext(com.google.gerrit.server.util.RequestContext) InMemoryModule(com.google.gerrit.testutil.InMemoryModule) Before(org.junit.Before)

Example 5 with DfsRepositoryDescription

use of org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription in project gerrit by GerritCodeReview.

the class PublicKeyStoreTest method setUp.

@Before
public void setUp() throws Exception {
    tr = new TestRepository<>(new InMemoryRepository(new DfsRepositoryDescription("pubkeys")));
    store = new PublicKeyStore(tr.getRepository());
}
Also used : InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Before(org.junit.Before)

Aggregations

DfsRepositoryDescription (org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription)12 InMemoryRepository (org.eclipse.jgit.internal.storage.dfs.InMemoryRepository)12 Before (org.junit.Before)10 RevWalk (org.eclipse.jgit.revwalk.RevWalk)3 Config (org.eclipse.jgit.lib.Config)2 TestKey (com.google.gerrit.gpg.testutil.TestKey)1 LifecycleManager (com.google.gerrit.lifecycle.LifecycleManager)1 Account (com.google.gerrit.reviewdb.client.Account)1 CurrentUser (com.google.gerrit.server.CurrentUser)1 RequestContext (com.google.gerrit.server.util.RequestContext)1 ThreadLocalRequestContext (com.google.gerrit.server.util.ThreadLocalRequestContext)1 InMemoryModule (com.google.gerrit.testutil.InMemoryModule)1 TestNotesMigration (com.google.gerrit.testutil.TestNotesMigration)1 Injector (com.google.inject.Injector)1 Provider (com.google.inject.Provider)1 DfsRepository (org.eclipse.jgit.internal.storage.dfs.DfsRepository)1 MockSystemReader (org.eclipse.jgit.junit.MockSystemReader)1 BatchRefUpdate (org.eclipse.jgit.lib.BatchRefUpdate)1 CommitBuilder (org.eclipse.jgit.lib.CommitBuilder)1 PersonIdent (org.eclipse.jgit.lib.PersonIdent)1