@Test public void downloadFails_retriesThenTaskFails() throws Throwable { DownloadRunner runner = new DownloadRunner(uri1); runner.postDownloadRequest(); FakeDownloader downloader = runner.getDownloader(0); for (int i = 0; i <= MIN_RETRY_COUNT; i++) { downloader.assertStarted(MAX_RETRY_DELAY).fail(); } downloader.assertReleased().assertStartCount(MIN_RETRY_COUNT + 1); runner.getTask().assertFailed(); downloadManagerListener.blockUntilTasksComplete(); assertThat(downloadManager.getCurrentDownloads()).isEmpty(); }
public List<Download> getCurrentDownloads() { return downloads; }
DownloadManager { public List<Download> getCurrentDownloads() { return downloads; } }
DownloadManager { public List<Download> getCurrentDownloads() { return downloads; } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); }
DownloadManager { public List<Download> getCurrentDownloads() { return downloads; } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); boolean isInitialized(); boolean isIdle(); boolean isWaitingForRequirements(); void addListener(Listener listener); void removeListener(Listener listener); Requirements getRequirements(); @Requirements.RequirementFlags int getNotMetRequirements(); void setRequirements(Requirements requirements); int getMaxParallelDownloads(); void setMaxParallelDownloads(int maxParallelDownloads); int getMinRetryCount(); void setMinRetryCount(int minRetryCount); DownloadIndex getDownloadIndex(); List<Download> getCurrentDownloads(); boolean getDownloadsPaused(); void resumeDownloads(); void pauseDownloads(); void setStopReason(@Nullable String id, int stopReason); void addDownload(DownloadRequest request); void addDownload(DownloadRequest request, int stopReason); void removeDownload(String id); void release(); }
DownloadManager { public List<Download> getCurrentDownloads() { return downloads; } DownloadManager(
      Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory);  DownloadManager(
      Context context, WritableDownloadIndex downloadIndex, DownloaderFactory downloaderFactory); boolean isInitialized(); boolean isIdle(); boolean isWaitingForRequirements(); void addListener(Listener listener); void removeListener(Listener listener); Requirements getRequirements(); @Requirements.RequirementFlags int getNotMetRequirements(); void setRequirements(Requirements requirements); int getMaxParallelDownloads(); void setMaxParallelDownloads(int maxParallelDownloads); int getMinRetryCount(); void setMinRetryCount(int minRetryCount); DownloadIndex getDownloadIndex(); List<Download> getCurrentDownloads(); boolean getDownloadsPaused(); void resumeDownloads(); void pauseDownloads(); void setStopReason(@Nullable String id, int stopReason); void addDownload(DownloadRequest request); void addDownload(DownloadRequest request, int stopReason); void removeDownload(String id); void release(); static final int DEFAULT_MAX_PARALLEL_DOWNLOADS; static final int DEFAULT_MIN_RETRY_COUNT; static final Requirements DEFAULT_REQUIREMENTS; }