Examples of TestRepository


Examples of org.eclipse.jgit.junit.TestRepository

    cfg.setBoolean("http", null, "receivepack", true);
    cfg.save();
  }

  public void testPush_CreateBranch() throws Exception {
    final TestRepository src = createTestRepository();
    final RevBlob Q_txt = src.blob("new text");
    final RevCommit Q = src.commit().add("Q", Q_txt).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    Transport t;
    PushResult result;

    t = Transport.open(db, remoteURI);
    try {
      final String srcExpr = Q.name();
      final boolean forceUpdate = false;
      final String localName = null;
      final ObjectId oldId = null;

      RemoteRefUpdate update = new RemoteRefUpdate(src.getRepository(),
          srcExpr, dstName, forceUpdate, localName, oldId);
      result = t.push(NullProgressMonitor.INSTANCE, Collections
          .singleton(update));
    } finally {
      t.close();
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

  private RevCommit A, B;

  protected void setUp() throws Exception {
    super.setUp();

    final TestRepository src = createTestRepository();
    final File srcGit = src.getRepository().getDirectory();
    final URI base = srcGit.getParentFile().toURI();

    ServletContextHandler app = server.addContext("/git");
    app.setResourceBase(base.toString());
    app.addServlet(DefaultServlet.class, "/");

    server.setUp();

    remoteRepository = src.getRepository();
    remoteURI = toURIish(app, srcGit.getName());

    A_txt = src.blob("A");
    A = src.commit().add("A_txt", A_txt).create();
    B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
    src.update(master, B);
  }
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

      is.close();
    }
  }

  public void testTinyThinPack() throws Exception {
    TestRepository d = new TestRepository(db);
    RevBlob a = d.blob("a");

    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);

    packHeader(pack, 1);
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

    assertEquals(0, loose.get(0).getParameters().size());
    assertEquals(200, loose.get(0).getStatus());
  }

  public void testInitialClone_Packed() throws Exception {
    new TestRepository(remoteRepository).packAndPrune();

    Repository dst = createBareRepository();
    assertFalse(dst.hasObject(A_txt));

    Transport t = Transport.open(dst, remoteURI);
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

  private TestRepository testDb;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    testDb = new TestRepository(db);
    rd = new RenameDetector(db);
  }
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

        .startsWith("JGit/"));
    assertEquals(200, event.getStatus());
  }

  public void testPushNotSupported() throws Exception {
    final TestRepository src = createTestRepository();
    final RevCommit Q = src.commit().create();
    final Repository db = src.getRepository();

    Transport t = Transport.open(db, remoteURI);
    try {
      try {
        t.push(NullProgressMonitor.INSTANCE, push(src, Q));
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

    return server.getRequests(path);
  }

  protected static void fsck(Repository db, RevObject... tips)
      throws Exception {
    new TestRepository(db).fsck(tips);
  }
View Full Code Here

Examples of org.eclipse.jgit.junit.TestRepository

    super.setUp();

    diskRepo = createBareRepository();
    refdir = (RefDirectory) diskRepo.getRefDatabase();

    repo = new TestRepository(diskRepo);
    A = repo.commit().create();
    B = repo.commit(repo.getRevWalk().parseCommit(A));
    v1_0 = repo.tag("v1_0", B);
    repo.getRevWalk().parseBody(v1_0);
  }
View Full Code Here

Examples of org.opensolaris.opengrok.util.TestRepository

   
    /**
     * Set up the test environment with repositories and a cache instance.
     */
    @Override protected void setUp() throws Exception {
        repositories = new TestRepository();
        repositories.create(getClass().getResourceAsStream("repositories.zip"));

        cache = new FileHistoryCache();
        cache.initialize();
    }
View Full Code Here

Examples of org.opensolaris.opengrok.util.TestRepository

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctags = new Ctags();
        ctags.setBinary(RuntimeEnvironment.getInstance().getCtags());
        repository = new TestRepository();
        repository.create(JFlexXrefTest.class.getResourceAsStream(
                "/org/opensolaris/opengrok/index/source.zip"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.