Package org.eclipse.jgit.junit

Examples of org.eclipse.jgit.junit.TestRepository


    }
  }

  @Test
  public void testTinyThinPack() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("a");

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

    packHeader(pack, 1);
View Full Code Here


    p.parse(NullProgressMonitor.INSTANCE);
  }

  @Test
  public void testPackWithTrailingGarbage() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("a");

    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
    packHeader(pack, 1);
    pack.write((Constants.OBJ_REF_DELTA) << 4 | 4);
    a.copyRawTo(pack);
View Full Code Here

    }
  }

  @Test
  public void testMaxObjectSizeFullBlob() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    final byte[] data = Constants.encode("0123456789");
    d.blob(data);

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

    packHeader(pack, 1);
    pack.write((Constants.OBJ_BLOB) << 4 | 10);
View Full Code Here

    }
  }

  @Test
  public void testMaxObjectSizeDeltaBlock() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("a");

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

    packHeader(pack, 1);
    pack.write((Constants.OBJ_REF_DELTA) << 4 | 14);
View Full Code Here

    }
  }

  @Test
  public void testMaxObjectSizeDeltaResultSize() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("0123456789");

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

    packHeader(pack, 1);
    pack.write((Constants.OBJ_REF_DELTA) << 4 | 4);
View Full Code Here

    }
  }

  @Test
  public void testNonMarkingInputStream() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("a");

    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
    packHeader(pack, 1);
    pack.write((Constants.OBJ_REF_DELTA) << 4 | 4);
    a.copyRawTo(pack);
View Full Code Here

    }
  }

  @Test
  public void testDataAfterPackFooterSingleRead() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    RevBlob a = d.blob("a");

    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(32*1024);
    packHeader(pack, 1);
    pack.write((Constants.OBJ_REF_DELTA) << 4 | 4);
    a.copyRawTo(pack);
View Full Code Here

    assertEquals(0x7e, in.read());
  }

  @Test
  public void testDataAfterPackFooterSplitHeaderRead() throws Exception {
    TestRepository d = new TestRepository<Repository>(db);
    final byte[] data = Constants.encode("a");
    RevBlob b = d.blob(data);

    int objects = 248;
    TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(32 * 1024);
    packHeader(pack, objects + 1);
    int offset = 13;
View Full Code Here

        HDR_CONTENT_TYPE));
  }

  @Test
  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);
    ((TransportHttp) t).setUseSmartHttp(false);
    try {
      try {
View Full Code Here

    cfg.save();
  }

  @Test
  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

TOP

Related Classes of org.eclipse.jgit.junit.TestRepository

Copyright © 2018 www.massapicom. 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.