PackageListDownloader { public LocalPackageList download(Source source, ProgressReceiver progressReceiver) throws PackageManagerException { try { return downloadPackagesGz(source, progressReceiver); } catch (Exception e) { throw new PackageManagerDownloadException("Package list download failed.", source.getUrl(), e); } } PackageListDownloader(PackageManagerConfiguration configuration, DownloadManager downloadManager); LocalPackageList download(Source source, ProgressReceiver progressReceiver); static final String PACKAGES_GZ; }
@Test public void testCheckForNewUpdatedFiles() throws Exception { final SourcesList sourcesList = new SourcesList(); final Source source = new Source(); source.setUrl(testRepositoryServer.getServerUrl()); source.setEnabled(true); sourcesList.getSources().add(source); final PackageListDownloader packageListDownloader = new PackageListDownloader(packageManagerConfiguration, downloadManager); final LocalPackageList result = packageListDownloader.download(source, new NoopProgressReceiver()); assertNotNull(result); assertEquals(testRepositoryServer.getServerUrl(), result.getSource().getUrl()); assertNotNull(result.getPackagesFile()); assertTrue(result.getPackagesFile().isFile()); }