use of jetbrains.buildServer.buildTriggers.vcs.git.RepositoryRevisionCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method reset_negative_entries.
public void reset_negative_entries() 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());
myCache.resetNegativeEntries(repo);
then(commitCache.hasRevision("v1")).isNull();
then(commitCache.hasRevision("v3")).isNull();
then(commitCache).isEqualTo(new RevisionsCache(myConfig).getRepositoryCache(repo, RevisionCacheType.COMMIT_CACHE));
}
use of jetbrains.buildServer.buildTriggers.vcs.git.RepositoryRevisionCache in project teamcity-git by JetBrains.
the class RevisionsCacheTest method reset_all_caches.
public void reset_all_caches() throws Exception {
List<File> repos = new ArrayList<>();
for (int i = 0; i < 4; i++) {
File repo = repository(String.valueOf(i));
repos.add(repo);
for (RevisionCacheType type : RevisionCacheType.values()) {
RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, type);
repoCache.saveRevision("v1", true, repoCache.getResetCounter());
}
}
myCache.reset();
for (File repo : repos) {
for (RevisionCacheType type : RevisionCacheType.values()) {
RepositoryRevisionCache repoCache = myCache.getRepositoryCache(repo, type);
then(repoCache.hasRevision("v1")).isNull();
then(RepositoryRevisionCache.getCacheFile(repo, type)).doesNotExist();
repoCache.saveRevision("v2", false, 0);
then(repoCache.hasRevision("v2")).isNull();
}
}
}
Aggregations