Package org.eclipse.jgit.junit

Examples of org.eclipse.jgit.junit.TestRng


  private WindowCursor wc;

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


  private WindowCursor wc;

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

  }

  @Test
  public void testOneByte() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte test = (byte) new TestRng(getName()).nextInt();
    try {
      b.write(test);
      b.close();
      assertEquals(1, b.length());
      {
View Full Code Here

  }

  @Test
  public void testOneBlock_BulkWrite() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.Block.SZ);
    try {
      b.write(test, 0, 2);
      b.write(test, 2, 4);
      b.write(test, 6, test.length - 6 - 2);
View Full Code Here

  }

  @Test
  public void testOneBlockAndHalf_BulkWrite() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.Block.SZ * 3 / 2);
    try {
      b.write(test, 0, 2);
      b.write(test, 2, 4);
      b.write(test, 6, test.length - 6 - 2);
View Full Code Here

  }

  @Test
  public void testOneBlockAndHalf_SingleWrite() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.Block.SZ * 3 / 2);
    try {
      for (int i = 0; i < test.length; i++)
        b.write(test[i]);
      b.close();
View Full Code Here

  }

  @Test
  public void testOneBlockAndHalf_Copy() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.Block.SZ * 3 / 2);
    try {
      final ByteArrayInputStream in = new ByteArrayInputStream(test);
      b.write(in.read());
      b.copy(in);
View Full Code Here

  }

  @Test
  public void testLarge_SingleWrite() 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);
      b.close();
      assertEquals(test.length, b.length());
View Full Code Here

  }

  @Test
  public void testInCoreInputStream() throws IOException {
    final int cnt = 256;
    final byte[] test = new TestRng(getName()).nextBytes(cnt);
    final TemporaryBuffer.Heap b = new TemporaryBuffer.Heap(cnt + 4);
    b.write(test);
    b.close();

    InputStream in = b.openInputStream();
View Full Code Here

  }

  @Test
  public void testInCoreLimit_SwitchOnAppendByte() throws IOException {
    final TemporaryBuffer b = new TemporaryBuffer.LocalFile();
    final byte[] test = new TestRng(getName())
        .nextBytes(TemporaryBuffer.DEFAULT_IN_CORE_LIMIT + 1);
    try {
      b.write(test, 0, test.length - 1);
      b.write(test[test.length - 1]);
      b.close();
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.