use of jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method disabled_persist_remove_cache_file.
public void disabled_persist_remove_cache_file() throws Exception {
// in order to not load stale data after restart
File repo = repository("1");
RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
repoCache.saveRevision("v1", false, repoCache.getResetCounter());
myConfigBuilder.setPersistentCacheEnabled(false);
repoCache.saveRevision("v1", true, repoCache.getResetCounter());
myConfigBuilder.setPersistentCacheEnabled(true);
RepositoryRevisionCache repoCache2 = new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
// should have no information on v1 after restart, especially 'false'
then(repoCache2.hasRevision("v1")).isNull();
}
use of jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method reset_negative_entries_with_new_commits.
public void reset_negative_entries_with_new_commits() throws Exception {
File repo = repository("1");
RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
repoCache.saveRevision("v1", false, repoCache.getResetCounter());
repoCache.saveRevision("v2", true, repoCache.getResetCounter());
repoCache.saveRevision("v3", false, repoCache.getResetCounter());
myCache.resetNegativeEntries(repo, setOf("v3", "v4"));
then(repoCache.hasRevision("v1")).isFalse();
then(repoCache.hasRevision("v2")).isTrue();
then(repoCache.hasRevision("v3")).isTrue();
then(repoCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method save_revision_entry.
public void save_revision_entry() throws Exception {
File repo = repository("1");
RepositoryRevisionCache commitCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
commitCache.saveRevision("v1", false, commitCache.getResetCounter());
commitCache.saveRevision("v2", true, commitCache.getResetCounter());
commitCache.saveRevision("v3", false, commitCache.getResetCounter());
then(commitCache.hasRevision("v1")).isFalse();
then(commitCache.hasRevision("v2")).isTrue();
then(commitCache.hasRevision("v3")).isFalse();
then(commitCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method save_revision_entry_different_types.
public void save_revision_entry_different_types() throws Exception {
File repo = repository("1");
RepositoryRevisionCache commitCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
RepositoryRevisionCache hintCache = myCache.getRepositoryCache(repo, RevisionCacheType.HINT_CACHE);
commitCache.saveRevision("v1", false, commitCache.getResetCounter());
hintCache.saveRevision("v2", true, hintCache.getResetCounter());
then(commitCache.hasRevision("v1")).isFalse();
then(commitCache.hasRevision("v2")).isNull();
then(hintCache.hasRevision("v1")).isNull();
then(hintCache.hasRevision("v2")).isTrue();
then(commitCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE));
then(hintCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.HINT_CACHE));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.RevisionsCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method should_write_empty_cache.
public void should_write_empty_cache() throws Exception {
File repo = repository("1");
RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE);
repoCache.saveRevision("v1", false, repoCache.getResetCounter());
myCache.resetNegativeEntries(repo);
then(repoCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE));
}
Aggregations