VersionUtil { public List<Version> getVersions() { return cacheUtil.getCachedVersions(); }  List<Version> getVersions(); Version getVersion(String version); Version getDefaultVersion(); static final String DEFAULT_VERSION; }
@Test public void testVersionUtilCacheDependency() throws Exception { OncotreeTestConfig config = new OncotreeTestConfig(); StringBuilder failureReport = new StringBuilder(); int failureCount = 0; List<Version> versionsFromUtil = versionUtil.getVersions(); config.resetNotWorkingVersionRepository(oncoTreeVersionRepository); try { cacheUtil.resetCache(); } catch (FailedCacheRefreshException e) { } int currentNumberOfVersions = versionUtil.getVersions().size(); if (currentNumberOfVersions != oncoTreeVersionRepositoryMockResponse.size()) { failureReport.append("An invalid recache attempt was recognized by VersionUtil. OncoTree will fail during TopBraid downtime. Expected number of versions: " + String.valueOf(oncoTreeVersionRepositoryMockResponse.size()) + ", Returned number of versions: " + String.valueOf(currentNumberOfVersions) + "\n"); failureCount = failureCount +1; } config.resetAdditionalVersionRepository(oncoTreeVersionRepository); cacheUtil.resetCache(); currentNumberOfVersions = versionUtil.getVersions().size(); if (currentNumberOfVersions != oncoTreeAdditionalVersionRepositoryMockResponse.size()) { failureReport.append("Changes to TopBraid repository were not recognized by VersionUtil after cache refresh. Expected number of versions: " + String.valueOf(oncoTreeAdditionalVersionRepositoryMockResponse.size()) + ", Returned number of versions: " + String.valueOf(currentNumberOfVersions) + "\n"); failureCount = failureCount +1; } if (failureCount > 0) { fail(Integer.toString(failureCount) + " failed test conditions. Details follow... " + failureReport.toString()); } return; }