use of ddf.catalog.resource.download.ReliableResourceDownloadManager in project ddf by codice.
the class DownloadsStatusEventListenerTest method setUp.
@Before
public void setUp() throws IOException {
testFolder.create();
String productCacheDir = testFolder.newFolder("cache").toString();
localResourcePath = testFolder.newFolder("resources").toPath();
ReliableResourceDownloaderConfig downloaderConfig = new ReliableResourceDownloaderConfig();
testDownloadStatusInfo = new DownloadStatusInfoImpl();
testDownloadStatusInfo.setSubjectOperations(new SubjectUtils());
ResourceCacheImpl testResourceCache = new ResourceCacheImpl();
DownloadsStatusEventPublisher testEventPublisher = mock(DownloadsStatusEventPublisher.class);
DownloadsStatusEventListener testEventListener = new DownloadsStatusEventListener();
downloaderConfig.setResourceCache(testResourceCache);
downloaderConfig.setEventPublisher(testEventPublisher);
downloaderConfig.setEventListener(testEventListener);
testDownloadManager = new ReliableResourceDownloadManager(downloaderConfig, testDownloadStatusInfo, Executors.newSingleThreadExecutor());
testDownloadManager.setMaxRetryAttempts(1);
testDownloadManager.setDelayBetweenAttempts(0);
testDownloadManager.setMonitorPeriod(5);
}
Aggregations