Package org.eclipse.jgit.junit

Examples of org.eclipse.jgit.junit.TestRng


  }

  @Test
  public void testInCoreLimit_SwitchBeforeAppendByte() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 3);
    try {
      b.write(test, 0, test.length - 1);
      b.write(test[test.length - 1]);
      b.close();
View Full Code Here


  }

  @Test
  public void testInCoreLimit_SwitchOnCopy() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2);
    try {
      final ByteArrayInputStream in = new ByteArrayInputStream(test,
          TemporaryBuffer.DEFAULT_IN_CORE_LIMIT, test.length
              - TemporaryBuffer.DEFAULT_IN_CORE_LIMIT);
View Full Code Here

  @Test
  public void testDestroyWhileOpen() throws IOException {
    @SuppressWarnings("resource" /* java 7 */)
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    try {
      b.write(new TestRng(getName())
          .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2));
    } finally {
      b.destroy();
    }
  }
View Full Code Here

  }

  @Test
  public void testRandomWrites() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final TestRng rng = new TestRng(getName());
    final int max = TemporaryBuffer.DEFAULT_IN_CORE_LIMIT * 2;
    final byte[] expect = new byte[max];
    try {
      int written = 0;
      boolean onebyte = true;
      while (written < max) {
        if (onebyte) {
          final byte v = (byte) rng.nextInt();
          b.write(v);
          expect[written++] = v;
        } else {
          final int len = Math
              .min(rng.nextInt() & 127, max - written);
          final byte[] tmp = rng.nextBytes(len);
          b.write(tmp, 0, len);
          System.arraycopy(tmp, 0, expect, written, len);
          written += len;
        }
        onebyte = !onebyte;
View Full Code Here

public class ObjectLoaderTest {
  private TestRng rng;

  private TestRng getRng() {
    if (rng == null)
      rng = new TestRng(JGitTestUtil.getName());
    return rng;
  }
View Full Code Here

  private ByteArrayOutputStream dstBuf;

  private TestRng getRng() {
    if (rng == null)
      rng = new TestRng(JGitTestUtil.getName());
    return rng;
  }
View Full Code Here

    db.getObjectDatabase().getReaderOptions().setStreamFileThreshold(512);
    DfsBlockCache.reconfigure(new DfsBlockCacheConfig()
      .setBlockSize(512)
      .setBlockLimit(2048));

    byte[] data = new TestRng(JGitTestUtil.getName()).nextBytes(8192);
    DfsInserter ins = (DfsInserter) db.newObjectInserter();
    ins.setCompressionLevel(Deflater.NO_COMPRESSION);
    ObjectId id1 = ins.insert(Constants.OBJ_BLOB, data);
    assertEquals(0, db.getObjectDatabase().listPacks().size());
View Full Code Here

  }

  @Test
  public void testPush_ChunkedEncoding() throws Exception {
    final TestRepository<Repository> src = createTestRepository();
    final RevBlob Q_bin = src.blob(new TestRng("Q").nextBytes(128 * 1024));
    final RevCommit Q = src.commit().add("Q", Q_bin).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    Transport t;

View Full Code Here

  private WindowCursor wc;

  protected void setUp() throws Exception {
    super.setUp();
    rng = new TestRng(getName());
    repo = createBareRepository();
    tr = new TestRepository<FileRepository>(repo);
    wc = (WindowCursor) repo.newObjectReader();
  }
View Full Code Here

  private WindowCursor wc;

  protected void setUp() throws Exception {
    super.setUp();
    rng = new TestRng(getName());
    repo = createBareRepository();
    wc = (WindowCursor) repo.newObjectReader();
  }
View Full Code Here

TOP

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

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.