throw new SLException(Messages.COULD_NOT_CONFIGURE_GIT_TO_SKIP_SSL, e); SystemReader.setInstance(new SystemReader() { @Override public FileBasedConfig openUserConfig(Config parent, FS fs) {
throw new SLException(Messages.COULD_NOT_CONFIGURE_GIT_TO_SKIP_SSL, e); SystemReader.setInstance(new SystemReader() { @Override public FileBasedConfig openUserConfig(Config parent, FS fs) {
@After public void tearDown() throws Exception { RepositoryCache.clear(); for (Repository r : toClose) r.close(); toClose.clear(); // Since memory mapping is controlled by the GC we need to // tell it this is a good time to clean up and unlock // memory mapped files. // if (useMMAP) System.gc(); if (tmp != null) recursiveDelete(tmp, false, true); if (tmp != null && !tmp.exists()) CleanupThread.removed(tmp); SystemReader.setInstance(null); }
@After public void tearDown() throws Exception { RepositoryCache.clear(); for (Repository r : toClose) r.close(); toClose.clear(); // Since memory mapping is controlled by the GC we need to // tell it this is a good time to clean up and unlock // memory mapped files. // if (useMMAP) System.gc(); if (tmp != null) recursiveDelete(tmp, false, true); if (tmp != null && !tmp.exists()) CleanupThread.removed(tmp); SystemReader.setInstance(null); }
/** * Tear down the test * * @throws Exception */ @After public void tearDown() throws Exception { RepositoryCache.clear(); for (Repository r : toClose) r.close(); toClose.clear(); // Since memory mapping is controlled by the GC we need to // tell it this is a good time to clean up and unlock // memory mapped files. // if (useMMAP) System.gc(); if (tmp != null) recursiveDelete(tmp, false, true); if (tmp != null && !tmp.exists()) CleanupThread.removed(tmp); SystemReader.setInstance(null); }
@Before public void setUp() throws Exception { tmp = File.createTempFile("jgit_test_", "_tmp"); CleanupThread.deleteOnShutdown(tmp); if (!tmp.delete() || !tmp.mkdir()) throw new IOException("Cannot create " + tmp); mockSystemReader = new MockSystemReader(); mockSystemReader.userGitConfig = new FileBasedConfig(new File(tmp, "usergitconfig"), FS.DETECTED); ceilTestDirectories(getCeilings()); SystemReader.setInstance(mockSystemReader); final long now = mockSystemReader.getCurrentTime(); final int tz = mockSystemReader.getTimezone(now); author = new PersonIdent("J. Author", "jauthor@example.com"); 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(); }
@Before public void setUp() throws Exception { tmp = File.createTempFile("jgit_test_", "_tmp"); CleanupThread.deleteOnShutdown(tmp); if (!tmp.delete() || !tmp.mkdir()) throw new IOException("Cannot create " + tmp); mockSystemReader = new MockSystemReader(); mockSystemReader.userGitConfig = new FileBasedConfig(new File(tmp, "usergitconfig"), FS.DETECTED); ceilTestDirectories(getCeilings()); SystemReader.setInstance(mockSystemReader); final long now = mockSystemReader.getCurrentTime(); final int tz = mockSystemReader.getTimezone(now); author = new PersonIdent("J. Author", "jauthor@example.com"); 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(); }
mockSystemReader.userGitConfig.save(); ceilTestDirectories(getCeilings()); SystemReader.setInstance(mockSystemReader);