Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.WindowCacheConfig


    assertArrayEquals(data1, data2);
    assertEquals(load2.getType(), load1.getType());
  }

  private static void whackCache() {
    final WindowCacheConfig config = new WindowCacheConfig();
    config.setPackedGitOpenFiles(1);
    WindowCache.reconfigure(config);
  }
View Full Code Here


    author = new PersonIdent(author, now, tz);

    committer = new PersonIdent("J. Committer", "jcommitter@example.com");
    committer = new PersonIdent(committer, now, tz);

    final WindowCacheConfig c = new WindowCacheConfig();
    c.setPackedGitLimit(128 * WindowCacheConfig.KB);
    c.setPackedGitWindowSize(8 * WindowCacheConfig.KB);
    c.setPackedGitMMAP(useMMAP);
    c.setDeltaBaseCacheLimit(8 * WindowCacheConfig.KB);
    c.install();
  }
 
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();

    WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setStreamFileThreshold(streamThreshold);
    cfg.install();

    repo = createBareRepository();
    tr = new TestRepository<Repository>(repo);
    wc = (WindowCursor) repo.newObjectReader();
  }
View Full Code Here

  @After
  public void tearDown() throws Exception {
    if (wc != null)
      wc.release();
    new WindowCacheConfig().install();
    super.tearDown();
  }
View Full Code Here

    assertEquals(96, toLoad.size());
  }

  @Test
  public void testCache_Defaults() throws IOException {
    WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.install();
    doCacheTests();
    checkLimits(cfg);

    final WindowCache cache = WindowCache.getInstance();
    assertEquals(6, cache.getOpenFiles());
View Full Code Here

    assertEquals(17346, cache.getOpenBytes());
  }

  @Test
  public void testCache_TooFewFiles() throws IOException {
    final WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setPackedGitOpenFiles(2);
    cfg.install();
    doCacheTests();
    checkLimits(cfg);
  }
View Full Code Here

    checkLimits(cfg);
  }

  @Test
  public void testCache_TooSmallLimit() throws IOException {
    final WindowCacheConfig cfg = new WindowCacheConfig();
    cfg.setPackedGitWindowSize(4096);
    cfg.setPackedGitLimit(4096);
    cfg.install();
    doCacheTests();
    checkLimits(cfg);
  }
View Full Code Here

public class WindowCacheReconfigureTest extends RepositoryTestCase {
  @Test
  public void testConfigureCache_PackedGitLimit_0() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitLimit(0);
      cfg.install();
      fail("incorrectly permitted PackedGitLimit = 0");
    } catch (IllegalArgumentException e) {
      //
    }
  }
View Full Code Here

  }

  @Test
  public void testConfigureCache_PackedGitWindowSize_0() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitWindowSize(0);
      cfg.install();
      fail("incorrectly permitted PackedGitWindowSize = 0");
    } catch (IllegalArgumentException e) {
      assertEquals("Invalid window size", e.getMessage());
    }
  }
View Full Code Here

  }

  @Test
  public void testConfigureCache_PackedGitWindowSize_512() {
    try {
      final WindowCacheConfig cfg = new WindowCacheConfig();
      cfg.setPackedGitWindowSize(512);
      cfg.install();
      fail("incorrectly permitted PackedGitWindowSize = 512");
    } catch (IllegalArgumentException e) {
      assertEquals("Invalid window size", e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.WindowCacheConfig

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.